Skip to main content

Capture a payment

Learn how to collect a pre-authorized payment with the Dojo Payments API.

A created pre-authorized payment isn't complete until it has been captured. When completing a payment, you can capture the amount in full, or in partial increments.

You can only capture a payment that hasn't yet been refunded or reversed.

Capture using the Dojo API

To capture a payment, use the endpoint:

POST /payment-intents/{paymentIntentId}/captures

In your request, include:

  • paymentIntentId: This identifies the payment intent to be captured.

  • amount: This is the amount to capture.

For the full API specification, see the reference.

Request example

The next example shows the capture of 10.00 GBP.

# The sandbox API key passed in 'authorization' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.

curl -v --request POST \
--url https://api.dojo.tech/payment-intents/<paymentIntentId> \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <your_api_key>' \
--header 'Version: 2024-02-05' \
--data '{
"amount": 1000
}'

Response example

If your request is successful, the response will return information about the capture.

{
"message": "collect payment for the order 3443",
"captureId": "cp_itIiJMEAvES3ynYF_Yhs2g"
}