New Feature Opened: PAY API!

This is fresh out of the oven, and boy is it smelling good!

You can use Wix Code Pay API to collect payments from your site’s visitors outside the context of a Wix App (like Wix Stores). The API allows you to collect a payment when triggered by any user interaction on any page.

Here are some examples:
Example site: https://code-examples.wixsite.com/wix-pay- demo
Open example in the editor: http://editor.wix.com/html/editor/web/renderer/new?siteId=42a94205-0783-42a8-9b71-3d75745141dc&metaSiteId=4b3c177f-b87c-4a17-bee2-045115c95749
Warning: Before starting with payments, it is important that you fully understand the security concerns that arise when collecting payments. For more details, see the article linked below.
Also: Due to the nature of the API, the API requires the site to be saved and published, to have a payment method setup for the site (in site settings → accept payments), and to have currency selected for the site (in the site settings > general info).

How does it work?

The Pay API consists of three parts:

  1. createPayment() - A backend function for securely creating a payment.

  2. startPayment() - A client-side function for prompting your users to enter their payment information.

  3. onPaymentUpdate() - A backend event for handling payment status updates.
    A typical payment lifecycle looks something like this:

  4. A site visitor clicks a button to start the payment process.

  5. The click triggers a call to a backend function that securely creates the payment and its corresponding unique payment ID.

  6. The payment ID is used client-side to open a payment popup.

  7. The site visitor enters the payment information, such as credit card number.

  8. Optionally, you can react to updates in the payments status that trigger a backend event.

Learn More

To learn more about the payment process, security concerns, and for code examples see:

faints

You guys are truly awesome ! Thank you so much !

3 Likes

<3 <3 <3 The Wix Code Team is on FIRE!

4 Likes

The example is not working, anyone else? :slight_smile:

1 Like

Ack!!

we are checking…

2 Likes

You guys Rock!!!

1 Like

Is it possible to use the pay API to process purchases of plans from the Paid Plans app ? Or does it only work with products in WIX Store ?

1 Like

Can we define Currency ourselves ? in the future ?

1 Like

Where do we edit/translate/create the Payment Details PopUp and where do we edit/create the confirmation email?

1 Like

good questions! Let me see what I can find. :slight_smile:

Hi! you can pass the product details from any collection, not only from Stores

Hi! you can define it yourself on the BE. However, make sure that the payment-providers you are working with support the currency you set, otherwise the transaction might fail.

Hi! both the checkout and the default emails are not open to customization. However, you can turn off the default email that’s being sent to your clients and trigger your own.
As for translations, what languages do you need to support? we do localize to several.

@moranl , thanks, but I don’t see how I can write to the Paid Plans database. This is controlled by WIX. How can I create a purchase in the WIX Paid Plans after the user has paid?

@moranl Hi Moran, I see that I can turn off the thankyoupage, but I cannot find where to turn off the email. Could you give me a hint?

1 Like

@moranl Is the Spanish translation ready yet? Because I have my site language set to Spanish, currency ARS, but the pop-up is in English. The currency is picked up OK, though. If you need help with the translation, let me know.

And when a true Payment Provider Gateway will be added that will support payment providers like Klarna Payments all my US clients will scream hurray…

1 Like

What would I do differently in the code to be able to enter a custom dollar amount? I’m using the Wix Pay API on the admin side of our site where we can take orders and process payment through a custom form and I just want to be able to enter the amount to charge. Help?

1 Like

to enable the customer to purchase a qunatity of their choosing? what would i need to do?

1 Like