Skip to main content
This guide shows you how to create a payment using Tonder’s unified Process Transaction endpoint. You can process various payment methods, from credit cards to local options like SPEI and OXXO Pay, through a single, consistent API call.

Step 1: The Core Request

All payments are created by sending a POST request to the Process Transaction endpoint. The request body must contain required fields that are common to all payment methods, plus a payment_method object with specific fields for your chosen payment method.

Basic Request Structure

Every payment request to the Process Transaction endpoint follows this structure:
These fields are required for all payment requests:
Depending on the payment method you choose, additional fields may be required inside the payment_method object (for example: card details, SPEI, OXXO Pay, etc.). For detailed information about each payment method and their specific requirements, see the section below or the Payment Methods Overview.

Step 2: Processing Different Payment Methods

To process a specific payment method, you change the type inside the payment_method object and provide any required additional fields. The examples below show how to process different payment methods.
To process a card payment, set the type to CARD and provide the tokenized card details. Here’s an example request:
A successful card payment response will have a status of authorized and includes the transaction details:
Card Payment Response
For cards that require extra security, see the guide for creating a payment with 3DS.
To let a customer pay via a SPEI transfer, set the type to SPEI. The API will generate payment instructions for the customer. Here’s an example request:
SPEI Bank Transfer
A successful SPEI response will have a status of pending and includes payment instructions for the customer:
SPEI Payment Response
To generate a voucher for a cash payment at an OXXO store, set the type to oxxopay. Here’s an example request:
OXXO Cash Payment
A successful OXXO Pay response will have a status of pending and includes payment instructions with a barcode and reference for the customer:
OXXO Payment Response
For detailed information about each payment method and their specific requirements, see the Payment Methods Overview.

Step 3: Handling the Response

After you send the request, the API will respond immediately with the initial status of the transaction. The status field can have one of the following values:
Validation of id and status fieldsFor proper payment validation, you must check:
  • id is the unique transaction identifier - store this for future reference.
  • status is the current payment state - determines next actions.
Never rely on HTTP status codes alone for payment validation.
In this example, the payment has been authorized, but not yet completed. Always check the status field in your response and implement appropriate logic based on the status value received. The table below details the fields that are returned in the response:

Synchronous vs. Asynchronous Payments

Bear in mind that different payment methods have different response flows.
  • Card Payments are typically synchronous. You will get a final status (authorized or declined) in the initial API response.
  • SPEI and OXXO Payments are asynchronous. The initial status will be pending because they require the customer to take further action. You must use Webhooks or poll the transaction status endpoint to know when the payment is completed.

Step 4: Check the Transaction Status

For asynchronous payments, or if you need to confirm the final status of any transaction, you can query the transaction status using the Get Transaction Status endpoint with the id from the payment response:
cURL
This will return the full transaction object with its current status (e.g., success, failed, expired). Always validate both the id and status fields in the response.

Next Steps