> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # RefundTransaction # Package: paymentServiceProviderServicePlugin # Namespace: PspRefundsService # Method link: https://dev.wix.com/docs/api-reference/business-management/payments/payment-service-provider-service-plugin/refunds/refund-transaction.md ## Introduction 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](https://dev.wix.com/docs/rest/api-reference/payment-provider-spi/processing-refunds.md). --- ## REST API ### Schema ``` Method: refundTransaction Description: 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](https://dev.wix.com/docs/rest/api-reference/payment-provider-spi/processing-refunds.md). URL: null Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: wixTransactionId, wixRefundId, pluginTransactionId, merchantCredentials Method parameters: param name: merchantCredentials | type: merchantCredentials | description: Credentials that the PSP provided when the merchant connected their account. | required: true - name: key | type: string | description: none - name: value | type: string | description: none param name: mode | type: Mode - enum: undefined - Undefined mode. live - Request is live. sandbox - Request is for testing purposes. param name: pluginTransactionId | type: pluginTransactionId | description: PSP transaction GUID. | required: true param name: reason | type: RefundReason - enum: UNKNOWN - DUPLICATE - FRAUDULENT - REQUESTED_BY_CUSTOMER - param name: refundAmount | type: refundAmount | description: Total amount to refund in a currency’s minor units. Learn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies.md). param name: siteId | type: siteId | description: Wix site GUID. param name: wixRefundId | type: wixRefundId | description: Refund GUID. | required: true param name: wixTransactionId | type: wixTransactionId | description: Wix transaction GUID. | required: true Return type: CreateRefundResponse - name: pluginRefundId | type: string | description: PSP refund GUID. - name: reasonCode | type: integer | description: Wix [reason code](https://dev.wix.com/docs/rest/api-reference/payment-provider-spi/reason-codes.md#all-apis_provider-platform_reason-codes_refund-declined) indicating a failed request. - name: errorCode | type: string | description: PSP-specific error code. - name: errorMessage | type: string | description: PSP-specific error message. ``` ### Examples ### Indicating a successful refund ```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" }' ``` ### Indicating a failed refund ```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" }' ``` ---