Capture, refund, and cancel an authorized Payment.
After a Payment has been authorized and Checkout has created an Order, you might need to perform actions on the Payment during its lifecycle. The Checkout Payment Intents API lets you send requests to capture, refund, or cancel an authorized Payment.
Following your request via the Checkout Payment Intents API, Checkout will request the payment service provider (PSP) to perform the related financial process.
Use the Payment Intents API only for payments created by Checkout.
Scope
Scope | Permission granted |
---|---|
manage_checkout_payment_intents:{projectKey} | Send capture, refund, or cancel requests to the payment service provider (PSP) and update the Payment by calling the payment Connector. |
Representations
PaymentIntentAction
Depending on the action specified, Checkout requests the payment service provider (PSP) to capture, refund, or cancel the authorization for the given Payment.
action | Action to execute for the given Payment. |
amount | Amount to be captured or refunded. |
merchantReference String | A merchant-defined identifier associated with the Payment to track and reconcile the Payment Intent Action on the merchant's side. For example, an invoice number. |
PaymentIntentOperation
The possible values for a Payment Intent Action.
Manage Payment by ID
Specific Error Codes:
manage_checkout_payment_intents:{projectKey}
manage_projects:{projectKey}
projectKey String | Identifier of your Checkout entity and |
paymentId String |
|
region String |
application/json
any
application/json
curl https://checkout.{region}.commercetools.com/{projectKey}/payment-intents/{paymentId} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"actions" : [ {
"action" : "capturePayment",
"amount" : {
"centAmount" : 10000,
"currencyCode" : "EUR"
},
"merchantReference" : "example-reference"
} ]
}
DATA
{
}
Manage Payment Intents actions
Capture Payment
Requests to capture the given amount from the customer. Checkout will request the PSP to proceed with the financial process to capture the amount.
action String | "capturePayment" |
amount | Amount to be captured. It must be less than or equal to the authorized amount. |
merchantReference String | A merchant-defined identifier associated with the Payment to track and reconcile the Payment Intent Action on the merchant's side. For example, an invoice number. |
{
"action": "capturePayment",
"amount": {
"centAmount": 10000,
"currencyCode": "EUR"
},
"merchantReference": "example-reference"
}
Refund Payment
Requests to refund the given amount to the customer. Checkout will request the PSP to proceed with the financial process to refund the amount.
action String | "refundPayment" |
amount | Amount to be refunded. It must be less than or equal to the captured amount. |
merchantReference String | A merchant-defined identifier associated with the Payment to track and reconcile the Payment Intent Action on the merchant's side. For example, an invoice number. |
{
"action": "refundPayment",
"amount": {
"centAmount": 10000,
"currencyCode": "EUR"
},
"merchantReference": "example-reference"
}
Cancel Payment
Requests to cancel the authorization for a Payment. Checkout will cancel the Payment and will request the PSP to proceed with the financial process to cancel the authorization.
You cannot request to cancel the authorization for a Payment that has already been captured.
action String | "cancelPayment" |
merchantReference String | A merchant-defined identifier associated with the Payment to track and reconcile the Payment Intent Action on the merchant's side. For example, an invoice number. |
{
"action": "cancelPayment",
"merchantReference": "example-reference"
}