Skip to main content

Capturing a transaction

About late capture#

By default, a charge created with auto_capture: true is authorized and captured automatically. When created with auto_capture: false, the amount is only reserved in the customer's wallet (authorization without capture) and must be captured in a second call.

Use this flow when you need to confirm the exact purchase amount after authorization — for example, in cases with variable shipping costs.

Attention

Transactions in authorized state (awaiting capture) must be captured within 6 days. After this period, the transaction automatically moves to EXPIRED and the reservation is released.

Endpoint#

POST https://ecommerce-api.svc.picpay.com/v1/payments/capture

Request example#

curl --location --request POST 'https://ecommerce-api.svc.picpay.com/v1/payments/capture' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'x-Idempotency-Key: {{idempotency_key}}' \
--header 'Content-Type: application/json' \
--data '{
"transaction_id": "bdc7bfd7-98bc-4910-801e-99206076947d",
"reference_id": "dfecee7e-2414-4966-8911-104f6389b071",
"value": 99.99
}'

Body parameters#

FieldTypeRequiredDescription
transaction_idstringYes*Transaction identifier generated by PicPay at the time of the charge
reference_idstringYes*Unique transaction identifier generated by the partner
valuenumberYesAmount in BRL to be captured. Can be less than or equal to the authorized amount

*At least one of the identifiers (transaction_id or reference_id) must be provided.

Successful response#

HTTP 204 No Content indicates the capture was successful. The response body is empty. The transaction moves from AUTHORIZED to PAID.

Possible errors#

business_codeHTTPDescription
TRANSACTION_CANT_BE_CAPTURED409Current status does not allow capture (already captured, canceled, or expired)
CAPTURED_INVALID_VALUE422Invalid amount (e.g., greater than the authorized amount)
TRANSACTION_NOT_FOUND404Transaction not found

Next steps#