POST

Void Or 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.

Voids or refunds the transaction by ID. Voids if the transaction was only authorized. Refunds if the transaction was already captured.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Managed Payments- All Permissions
Manage Refunds
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/transaction-service/v3/transactions/{transactionId}/refund

Path Params
transactionIdstringRequired

Transaction ID.

Body Params
accountIdstringRequiredformat GUID

Wix Payments account ID.


amountintegerformat uint64

Amount to capture in minor units (for example, cents). Leave empty to capture the whole transaction amount.


capturableAmountintegerdeprecatedformat uint64

Amount that can be captured or voided in minor units to place a hold on a card to reserve funds. Specify the amount to prevent double partial refunds.


refundableAmountintegerdeprecatedformat uint64

Amount in minor units that can be refunded. Specify the amount to prevent double partial refunds.


idempotencyKeystringminLength 1maxLength 100

Key to ensure idempotency.


externalVoidOrRefundIdstringminLength 1maxLength 36

Corresponding void or refund ID within the external entity that made the request.


reasonstring

Reason for void or refund.


metadataMap <string, string>maxItems 16format map

Metadata to store within the created void or refund.

Response Object
transactionTransaction

Voided or refunded transaction information.


ONE OF:

voidIdstringformat GUID

Void Id.


refundIdstringformat GUID

Refund ID.

Refund previously captured transaction

Request
cURL
curl -X POST \ https://www.wixapis.com/payments/v3/transactions/4f68983f-9b70-438e-8130-4fff0b97cf48/refund \ -H 'Content-Type: application/json; charset=utf-8' \ -H 'Authorization: <AUTH>' \ -d '{ "accountId": "6f82b2ce-2a15-4bd7-84b5-392c74b3719c", "reason": "BUYER_REQUEST" }'
Response
JSON
{ "transaction": { "id": "4f68983f-9b70-438e-8130-4fff0b97cf48", "currency": "USD", "capturableAmount": "0", "refundableAmount": "0", "providerTransactionId": "pi_1H83lWAaXaGogcA7gt5WsjjP", "metadata": { "metadataKey": "metadataValue" }, "authorization": { "amount": "200", "status": "SUCCEEDED", "networkReference": { "networkTransactionId": "WvTnyhZlYER07Ate" }, "authCode": "123456" }, "captures": [ { "id": "4f68983f-9b70-438e-8130-4fff0b97cf48", "amount": "200", "status": "SUCCEEDED", "metadata": {} } ], "refunds": [ { "id": "1dd0bfdc-bf5d-47cb-8d9b-bc2c6d6591d6", "amount": "200", "reason": "BUYER_REQUEST", "status": "SUCCEEDED", "providerRefundId": "re_1H83mOAaXaGogcA7QYx89USb", "metadata": {} } ], "disputes": [], "voids": [], "accountId": "6f82b2ce-2a15-4bd7-84b5-392c74b3719c", "paymentMethod": { "typeId": "creditCard" } }, "refundId": "1dd0bfdc-bf5d-47cb-8d9b-bc2c6d6591d6" }
Errors
409Already Exists

There are 2 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?