Capture an authorization

Learn how to capture authorized amounts and complete transactions.

After making an authorization, in order to complete the transaction and transfer the reserved amount on your customer's card to your merchant account, you need to execute a capture operation.

This capture operation could be partial (an amount less than the authorized amount is transferred), or it can capture the full authorized amount.

Parameter details

Body

PropertyTypeMandatory?Description
authorization_idstringRequiredID of the Authorization to be captured.
amountnumberRequiredAmount to be captured (in the currency specified in currency). Must be equal to or less than the authorized amount.
If not included, the capture will be for the total amount of the authorization.
currencystringOptionalTransaction currency in ISO 4217. Each country accepts USD and local currency.
Required if amount is present.
order_idstringOptionalID of the capture given by the merchant in their system. Think of it as an external id of the capture.

Example

$ curl -X POST \
    -H 'X-Date: 2018-02-20T15:44:42.310Z' \
    -H 'X-Login: sak223k2wdksdl2' \
    -H 'X-Trans-Key: fm12O7G9' \
    -H 'X-Version: 2.1' \
    -H 'User-Agent: MerchantTest / 1.0 ' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: V2-HMAC-SHA256, Signature: 1bd227f9d892a7f4581b998c21e353b1686a6bdad5940e7bb6aa596c96e0a6ec' \
    -d '{body}'
    https://api.dlocal.com/payments

{
    "authorization_id": "D-4-e2227981-8ec8-48fd-8e9a-19fedb08d73a",
    "amount": 120,
    "currency": "USD",
    "order_id": "657434343-1"
}
{
    "id": "D-4-09f52dd0-5cfa-4b0e-a471-1608ea0dba24",
    "amount": 120,
    "currency": "USD",
    "country": "BR",
    "created_date": "2019-02-07T13:47:06.000+0000",
    "approved_date": "2019-02-07T13:47:06.000+0000",
    "status": "PAID",
    "status_detail": "The payment was paid",
    "status_code": "200",
    "order_id": "657434343-1",
    "authorization_id": "D-4-e2227981-8ec8-48fd-8e9a-19fedb08d73a"
}

📘

For a complete overview about the authorization process, we suggest you read the Authorization and Capture guide.