POST

Refund 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 refund requests to a Payment Service Provider (PSP).

Wix calls this endpoint when a merchant initiates a refund from the Wix dashboard. 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
wixTransactionIdstringRequiredformat GUID

Wix transaction ID.


wixRefundIdstringRequiredformat GUID

Refund ID.


pluginTransactionIdstringRequired

PSP transaction ID.


merchantCredentialsMerchantCredentialsRequiredformat map

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


refundAmountnumber

Total amount to refund in a currency’s smallest unit.

Learn more about currency units.


modestring

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


reasonstring

Reason for refund. Defined by the merchant.

Response Object
pluginRefundIdstring

PSP refund ID.


reasonCodeinteger

Wix reason code indicating a failed request.


errorCodestring

PSP-specific error code.


errorMessagestring

PSP-specific error message.


statusstringdeprecated

This field is ignored, do not send it.

Request
cURL
curl -X POST https://psp.example.com/refund \ -H 'Content-Type: application/json' \ -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \ -d '{ "wixTransactionId": "a15a3ee3-22d3-4a3f-920e-2186e13a19d1", "wixRefundId": "fcd2655f-e261-4c5b-8129-72a241461a27", "pluginTransactionId": "e89b-12d3-a456-42665", "merchantCredentials": { "client_id": "e89b-12d3-a456-42665", "client_secret": "a15a3ee3-22d3-4a3f-920e-2186e13a19d1" }, "refundAmount": 1000, "mode": "live", "reason": "REQUESTED_BY_CUSTOMER" }'
Response
JSON
{ "pluginRefundId": "ce590272-87bf-428f-943a-0ff594059712" }
Errors

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

Did this help?