Capture

This endpoint is used to capture a previously authorized payment transaction. It requires a JSON payload containing transaction details, capture information, and device information.

The URL for this endpoint is https://api.firstoken.co/v1/payments/:id/capture

Request Headers

  • Content-Type: application/json

  • x-api-key: <Your API Key>

id: string

The unique identifier of the transaction to be captured.

Request Body

The request body should be a JSON object with the following structure:

Example of the JSON request
{
  "transaction_info": {
    "type": "capture",
    "reference_code": "123456789"
  },
  "capture_info": {
    "amount_details": {
      "total_amount": 1000,
      "currency": "MXN"
    },
    "installments": 1
  },
    "device_info": {
        "ip_address": "12.7.8.120"
    }
}

Response

The response will be a JSON object with the following structure:

Example of the JSON response
{
    "status": "success",
    "message": "Capture successful",
    "data": {
        "transaction_info": {
            "type": "capture_response",
            "reference_code": "123456789",
            "transaction_id": "0001733749102035492129",
            "request_id": "7337491022116075204953",
            "status": "Pending",
            "reconciliation_id": "hrklh3wWGoek",
            "created_at": "2024-12-09T12:58:22Z"
        },
        "order_info": {
            "amount_details": {
                "total_amount": "1000.00",
                "currency": "MXN"
            }
        }
    }
}

In case of an error, the response will have a status of fail and a descriptive message. The data object provides more details about the specific issues encountered.

Last updated

Was this helpful?