Skip to main content

Capture Transaction

Sandbox Only

This endpoint is available in the Sandbox environment only. Transaction capture is not supported in production at this time.

Use this route to capture a transaction previously authorized with the POST v3/transactions/authorize endpoint. Capturing finalizes the charge on the customer's card, moving the transaction status from authorized to paid.

Attention

Only transactions with authorized status can be captured. Attempting to capture a transaction with any other status will return a 403 error.

POSTv3/transactions/:transaction_id/capture

Request Variable Path

AttributeTypeDescription
transaction_idstringMarlim transaction ID with authorized status.
caution

It is necessary to save the transaction_id that Marlim returns in the authorization request in your application. Only with this ID will it be possible to proceed with the capture.

This endpoint does not require a body in the request.

Response Object

PropertyTypeDescription
statusstringRepresents the current state of the transaction. For this endpoint, the returned value will be paid.
amountint32Amount in cents charged in the transaction.
net_valueint32Optional parameter for the net value to be received for the transaction.
authorized_amountint32Amount in cents authorized in the transaction.
paid_amountint32Amount in cents captured in the transaction.
refunded_amountint32Amount in cents refunded in the transaction.
installmentsstringNumber of installments the customer paid in.
nsustringCode that identifies the transaction in the Acquirer.
authorization_codestringAuthorization code returned by the issuing bank.
transaction_idstringMarlim transaction identifier number.
item_idstringTransaction ID in your platform.
payment_methodstringPayment method used in the transaction. Possible values: credit_card.
date_createddateTimeTransaction creation date in ISODateTime format.
date_updateddateTimeTransaction status update date in ISODateTime format.
card_holder_namestringName of the cardholder used in payment.
card_brandstringCard brand used in payment. Possible values: visa, mastercard, amex, hipercard and elo.
card_first_digitsstringFirst 6 digits of the card used in payment.
card_last_digitsstringLast 4 digits of the card used in payment.
acquirer_status_codestringResponse identifier code from the Issuing Bank.
acquirer_status_messagestringMessage regarding the Issuing Bank's response code.
Response example
{
"status": "paid",
"nsu": "98765432",
"authorization_code": "112233",
"date_created": "2025-01-01T00:00:00.000Z",
"date_updated": "2025-01-01T00:00:01.000Z",
"amount": 1000,
"authorized_amount": 1000,
"paid_amount": 1000,
"refunded_amount": 0,
"installments": "1",
"transaction_id": "HcDscltTIVK3VMAAOj7J",
"item_id": "ABC123456789",
"payment_method": "credit_card",
"card_holder_name": "Luke Skywalker",
"card_brand": "visa",
"card_first_digits": "555544",
"card_last_digits": "2222",
"acquirer_status_code": "0000",
"acquirer_status_message": "The acquirer captured the amount on the card."
}

Error Object

AttributeTypeDescription
api_referencestringURL for the documentation.
errorsarrayArray with all errors found when processing the request.
errors[][type]stringType of error that occurred.
errors[][message]stringDetailed message of the error that occurred.
Error Response example — Transaction not authorized
{
"api_reference": "https://docs.api.marlim.co/transactions/create/card",
"errors": [
{
"type": "status",
"message": "Only transactions with authorized status can be captured."
}
]
}

Examples

Request
curl -X POST "https://api.marlim.co/v3/transactions/HcDscltTIVK3VMAAOj7J/capture" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
-d '{}'
Response200
{
"status": "paid",
"nsu": "98765432",
"authorization_code": "112233",
"date_created": "2026-06-09T12:37:17.147Z",
"date_updated": "2026-06-09T12:37:17.147Z",
"amount": 1000,
"authorized_amount": 1000,
"paid_amount": 1000,
"refunded_amount": 0,
"installments": "1",
"transaction_id": "HcDscltTIVK3VMAAOj7J",
"item_id": "ABC123456789",
"payment_method": "credit_card",
"card_holder_name": "Luke Skywalker",
"card_brand": "visa",
"card_first_digits": "555544",
"card_last_digits": "2222",
"acquirer_status_code": "0000",
"acquirer_status_message": "The acquirer captured the amount on the card."
}