> 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 # CaptureTransaction # Package: paymentServiceProviderServicePlugin # Namespace: PspTransactionsService # Method link: https://dev.wix.com/docs/api-reference/business-management/payments/payment-service-provider-service-plugin/transactions/capture-transaction.md ## Introduction This endpoint is used to send requests to capture transactions to a Payment Service Provider (PSP). Wix calls this endpoint to capture a transaction. Learn more about [implementing this endpoint](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/capturing-and-voiding-payments.md). --- ## REST API ### Schema ``` Method: captureTransaction Description: This endpoint is used to send requests to capture transactions to a Payment Service Provider (PSP). Wix calls this endpoint to capture a transaction. Learn more about [implementing this endpoint](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/capturing-and-voiding-payments.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, pluginTransactionId, captureAmount, merchantCredentials Method parameters: param name: captureAmount | type: captureAmount | description: Total amount to capture 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). | required: true 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: pluginTransactionId | type: pluginTransactionId | description: PSP transaction GUID. | required: true param name: siteId | type: siteId | description: Wix site GUID. param name: wixTransactionId | type: wixTransactionId | description: Wix transaction GUID. | required: true Return type: CaptureTransactionResponse - name: reasonCode | type: integer | description: Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes.md#capture-declined) indicating a failed request. - name: errorCode | type: string | description: PSP-specific error code. - name: errorMessage | type: string | description: PSP-specific error message. ``` ### Examples ### Capture Already Captured Transaction ```curl curl -X POST https://psp.example.com/capture \ -H 'Content-Type: application/json' \ -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \ -d ' { "wixTransactionId": "a57c2c68-61d2-480c-930b-9982b058730d", "pluginTransactionId": "bb5fd2a7-05a7-4958-bf3f-66daf4db0a4a", "captureAmount": "1540", "merchantCredentials": { "client_id": "e89b-12d3-a456-42665", "client_secret": "a15a3ee3-22d3-4a3f-920e-2186e13a19d1" } }' ``` ### Capture Transaction ```curl curl -X POST https://psp.example.com/capture \ -H 'Content-Type: application/json' \ -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \ -d ' { "wixTransactionId": "a57c2c68-61d2-480c-930b-9982b058730d", "pluginTransactionId": "bb5fd2a7-05a7-4958-bf3f-66daf4db0a4a", "captureAmount": "1540", "merchantCredentials": { "client_id": "e89b-12d3-a456-42665", "client_secret": "a15a3ee3-22d3-4a3f-920e-2186e13a19d1" } }' ``` ### Capture Already Voided Transaction ```curl curl -X POST https://psp.example.com/capture \ -H 'Content-Type: application/json' \ -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \ -d ' { "wixTransactionId": "a57c2c68-61d2-480c-930b-9982b058730d", "pluginTransactionId": "bb5fd2a7-05a7-4958-bf3f-66daf4db0a4a", "captureAmount": "1540", "merchantCredentials": { "client_id": "e89b-12d3-a456-42665", "client_secret": "a15a3ee3-22d3-4a3f-920e-2186e13a19d1" } }' ``` ---