POST

Create Transaction


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

This endpoint is used to send a merchant's payment requests to a Payment Service Provider (PSP).

Wix calls this endpoint when a buyer chooses make a payment using the PSP on a merchant's Wix site. Learn more about implementing this endpoint.

You cannot try out this endpoint because it has to be implemented by a payment plugin and can have an arbitrary URL. So please ignore the Authorization and POST sections below as well as the Try It Out button.

Body Params
wixTransactionIdstringRequired

Wix transaction ID.


paymentMethodstring

Requested payment method. If the value of this field is creditCard, the paymentMethodData field's value includes credit card data in the value of the card field. A PSP can specify the payment methods they accept in the Wix Dev Ceter.


merchantCredentialsMap <string, string>Requiredformat map

Credentials that the PSP provided when the merchant connected their account.


orderOrderRequired

Order information.


modestring

Connection mode. Identifies whether a request is live or for testing purposes.


installmentsintegerformat int32

Number of payment installments requested.


wixMerchantIdstringRequired

Wix merchant ID.


paymentMethodDataPaymentMethodData

Payment method data such as credit card information.


fraudInformationFraudInformation

Fraud prevention data.


setupCredentialsOnFileSetupCredentialsOnFile

Data about recurring payment setup.


offSessionboolean

Whether the request is for a recurring payment or merchant initiated transaction. If the value of this field is true, the PSP should use a payment method token to process the payment. Learn more about recurring payments.


motoboolean

Whether the request is for a Mail Order/Telephone Order payment.


scaRequestedboolean

Request transaction to be made using strong customer authentication e.g. 3-D Secure.

Response Object
pluginTransactionIdstring

PSP transaction ID.


reasonCodeinteger

Wix reason code indicating a failed or pending request.


errorCodestring

PSP-specific error code.


errorMessagestring

PSP-specific error message.


redirectUrlstring

URL where Wix can redirect the buyer to complete the payment.


statusstringdeprecated

This field is ignored, do not send it.


credentialsOnFileCredentialsOnFile

Reference to a saved payment method.

Request
cURL
curl -X POST https://psp.example.com/payment \ -H 'Content-Type: application/json' \ -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \ -d '{ "wixMerchantId": "fcd2655f-e261-4c5b-8129-72a241461a27", "wixTransactionId": "a15a3ee3-22d3-4a3f-920e-2186e13a19d1", "paymentMethod": "creditCard", "merchantCredentials": { "client_id": "e89b-12d3-a456-42665", "client_secret": "a15a3ee3-22d3-4a3f-920e-2186e13a19d1" }, "order": { "id": "ce590272-87bf-428f-943a-0ff594059712", "description": { "totalAmount": 1000, "currency": "USD", "items": [ { "id": "it_1", "name": "Digital camera", "quantity": 1, "price": 1000, "description": "Portable digital camera", "category": "physical" } ], "buyerInfo": { "buyerId": "ffc0a971-60cb-4c63-8016-39b1bce41e8d", "buyerLanguage": "en" } }, "returnUrls": { "successUrl": "https://merchant.com/success", "errorUrl": "https://merchant.com/error", "cancelUrl": "https://merchant.com/cancel", "pendingUrl": "https://merchant.com/pending" } }, "installments": 1, "mode": "live", "moto": false, "paymentMethodData": { "card": { "number": "4111111111111111", "year": 2030, "month": 12, "cvv": "777", "holderName": "John Smith" } } }'
Response
JSON
{ "pluginTransactionId": "e89b-12d3-a456-42665" }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?