Use Wix Payments server-to-server API integration to accept different payment methods and manage transactions. Wix Payments act as a standalone solution to independently process payments, deal with chargebacks and disputes via Wix infrastructure, and can be used by any third-party.
The Transactions API supports the following flows:
Wix Payments supports the following payment methods:
Wix Payments API allows merchants to set up recurring payments. It adds flexibility and full control of the entire business flow. For subsequent transactions, only the card_number
should be tokenized using the Create Card Token endpoint, and the appropriate token passed to the Create Transaction.
Note to achieve the best approve ratio, the correct MIT/CIT flag must be passed as well. To achieve the best approve ratio, pass all possible values received from the card schemes:
Create Transaction endpoint is fully compatible with the new PSD2 regulations and supports 3DS 2 mechanism.
Interaction Type | Additional Parameters | Comments |
---|---|---|
ONE_TIME | Regular one-time transaction | |
SETUP_COF_ONSESSION | Initial transaction with the subsequent CIT (setup one-click) | |
SETUP_COF_RECURRING | Initial transaction with the subsequent MIT transactions according to a defined schedule | |
SETUP_COF_UNSCHEDULED | Initial transaction with the subsequent MIT transactions without the defined schedule | |
COF_ONSESSION | transaction_reference | Subsequent transaction initiated by the customer (perform one-click) |
COF_RECURRING | transaction_reference | Recurring transactions initiated by the merchant according to the defined schedule |
COF_UNSCHEDULED | transaction_reference | Recurring transactions initiated by the merchant without a schedule |
Create and manage transactions with the following flows:
Transaction info: $10 USD, one-time credit card transaction, using a card token. A new card_token
must be generated for each transaction request.
(A card token must be passed to Create Transaction when a credit/debit card is the chosen payment method.)
To create a transaction, call Create Transaction.
Parameters to include:
{
"accountId": "81c79a2-9bd5-4852-9296-6a24c640f1ef",
"amount": "1000",
"currency": "USD",
"paymentMethodTypeId": "creditCard",
"card": {
"numberToken": "41c29a2-9bd5-4552-1296-6a24c6g0f1ef",
"expiryMonth": 11,
"expiryYear": 2027,
"holderName": "John Doe",
"securityCodeToken": "71c7932-9bd5-48d2-9196-6df4c640f1ef"
},
"automaticCapture": {},
"oneTimePayment": {}
}
Note: Pass an empty object for the type of transaction oneTimePayment
, but not null or missing.
Transaction info: $10 USD, one-time credit card transaction, using a card token. A new card_token
must be generated for each transaction request.
(A card token must be passed to Create Transaction when a credit/debit card is the chosen payment method.)
Parameters to include:
POST https://www.wixapis.com/payments/v3/transactions
{
"accountId": "81c79a2-9bd5-4852-9296-6a24c640f1ef",
"amount": "1000",
"currency": "USD",
"paymentMethodTypeId": "creditCard",
"card": {
"numberToken": "41c29a2-9bd5-4552-1296-6a24c6g0f1ef",
"expiryMonth": 11,
"expiryYear": 2027,
"holderName": "John Doe",
"securityCodeToken": "71c7932-9bd5-48d2-9196-6df4c640f1ef"
},
"oneTimePayment": {}
}
Parameters to include:
POST https://www.wixapis.com/payments/v3/transactions/2ac75a2-91d5-4752-6h96-6aj74640f1ef/capture
{
"accountId": "81c79a2-9bd5-4852-9296-6a24c640f1ef"
}
Transaction info: $10 USD, one-time credit card transaction, using a card token. A new card_token must be generated for each transaction request.
(A card token must be passed to Create Transaction when a credit/debit card is the chosen payment method.)
When creating a recurring transaction (MIT/CIT), you only need to tokenize the card_number
and pass it in the Create Transaction request together with COF.
Parameters to include:
{
"accountId": "81c79a2-9bd5-4852-9296-6a24c640f1ef",
"amount": "1000",
"currency": "USD",
"paymentMethodTypeId": "creditCard",
"card": {
"numberToken": "41c29a2-9bd5-4552-1296-6a24c6g0f1ef",
"expiryMonth": 11,
"expiryYear": 2027,
"holderName": "John Doe",
"securityCodeToken": "71c7932-9bd5-48d2-9196-6df4c640f1ef"
},
"automaticCapture": {}
"setupCofRecurring": {}
}
Retrieve the transactionId
of the created transaction from the response from step 1. (In this example, transactionId
= 01csa932-9bd5-38d2-91d6-6jf5c640f1ef). You’ll need to pass it as the transactionReference
in all subsequent transactions.
When a subsequent payment is due, call Create Transaction and pass the transactionId
from step 1 as the transactionReference
.
Parameters to include:
{
"accountId": "81c79a2-9bd5-4852-9296-6a24c640f1ef",
"amount": "1000",
"currency": "USD",
"paymentMethodTypeId": "creditCard",
"card": {
"numberToken": "41c29a2-9bd5-4552-1296-6a24c6g0f1ef",
"expiryMonth": 11,
"expiryYear": 2027,
"holderName": "John Doe"
},
"automaticCapture": {},
"cofRecurring": {
"transactionReference": {
"transactionId": "01csa932-9bd5-38d2-91d6-6jf5c640f1ef"
}
}
}
Transaction info: $10 USD, one-time credit card transaction, using a card token. A new card_token must be generated for each transaction request.
(A card token must be passed to Create Transaction when a credit/debit card is the chosen payment method.)
When creating a recurring transaction (MIT/CIT), you only need to tokenize the card_number
and pass it in the Create Transaction request together with COF.
Parameters to include:
{
"accountId": "81c79a2-9bd5-4852-9296-6a24c640f1ef",
"amount": "1000",
"currency": "USD",
"paymentMethodTypeId": "creditCard",
"card": {
"numberToken": "41c29a2-9bd5-4552-1296-6a24c6g0f1ef",
"expiryMonth": 11,
"expiryYear": 2027,
"holderName": "John Doe",
"securityCodeToken": "71c7932-9bd5-48d2-9196-6df4c640f1ef"
},
"automaticCapture": {},
"setupCofOnSession": {}
}
Retrieve the transactionId (in this example, transactionId
= 01csa932-9bd5-38d2-91d6-6jf5c640f1ef). You’ll need to pass it as the transactionReference
in all subsequent transactions.
Call Create Transaction.
transactionReference
is the ID of the transaction in the response from step 1.
Parameters to include:
{
"accountId": "81c79a2-9bd5-4852-9296-6a24c640f1ef",
"amount": "1000",
"currency": "USD",
"paymentMethodTypeId": "creditCard",
"card": {
"numberToken": "41c29a2-9bd5-4552-1296-6a24c6g0f1ef",
"expiryMonth": 11,
"expiryYear": 2027,
"holderName": "John Doe",
"securityCodeToken": "71c7932-9bd5-48d2-9196-6df4c640f1ef"
},
"automaticCapture": {},
"cofOnSession": {
"transactionReference": {
"transactionId": "01csa932-9bd5-38d2-91d6-6jf5c640f1ef"
}
}
}
Transaction info: $50 USD, one-time credit card transaction, using a card token.
Parameters to include:
{
"accountId": "81c79a2-9bd5-4852-9296-6a24c640f1ef",
"amount": "5000",
"currency": "USD",
"paymentMethodTypeId": "creditCard",
"card": {
"numberToken": "41c29a2-9bd5-4552-1296-6a24c6g0f1ef",
"expiryMonth": 11,
"expiryYear": 2027,
"holderName": "John Doe",
"securityCodeToken": "71c7932-9bd5-48d2-9196-6df4c640f1ef"
},
"automaticCapture": {},
"oneTimePayment": {}
}
a. For a full refund:
POST https://www.wixapis.com/payments/v3/transactions/71c7932-9bd5-48d2-9196-6df4c640f1ef/capture
{
"accountId": "81c79a2-9bd5-4852-9296-6a24c640f1ef"
}
b. For a partial refund of $25:
POST https://www.wixapis.com/payments/v3/transactions/71c7932-9bd5-48d2-9196-6df4c640f1ef/capture
{
"accountId": "81c79a2-9bd5-4852-9296-6a24c640f1ef",
"amount": 2500
}