Send MXN

Sending MXN payments is a key feature of the Coba API, allowing you to programmatically initiate and manage payments in Mexican Pesos. On this page, you’ll find everything you need to send MXN payments through our API using USDC.

In a nutshell, the process involves:

  1. Creating a User: First, you need to create a user in the Coba through the API.
  2. Creating a Bank Account: Next, create a bank account for the user where the MXN payment will be sent.
  3. Request a Quote: Obtain a quote for the MXN payment to understand the fees and exchange rates involved.
  4. Create an Order for the Quote: This step involves creating an order based on the quote.
  5. Fund the Order: Finally, fund the order using USDC to complete the MXN payment.
POST/users

1. Create a user

Refer to the Users section to create a user.

POST/crypto/bank_accounts

2. Create a bank account

Refer to the Bank Accounts section to create a bank account.

POST/crypto/quotes

3. Request a quote

This endpoint allows you to request a quote for sending MXN payments.

Required attributes

  • Name
    user_id
    Type
    string
    Description

    The unique identifier of the user who owns the bank account.

  • Name
    crypto
    Type
    string
    Description

    The cryptocurrency to be used for the payment (e.g., USDC).

    One of: USDC, USDC_POLYGON_NXTB, SOL_USDC_PTHX, USDT_POLYGON, USDT_ERC20, TRX_USDT_S2UZ

  • Name
    fiat
    Type
    string
    Description

    MXN

  • Name
    country
    Type
    string
    Description

    MX

  • Name
    amount_fiat
    Type
    number
    Description

    The amount in fiat currency to be sent.

  • Name
    side
    Type
    string
    Description

    The side of the transaction, in this case sell

Request

POST
/crypto/quotes
curl -X POST https://sandbox.api.coba.ai/metal/crypto/quotes \
  -H "Authorization: Bearer {token}" \
  -H "X-Coba-Metal-API-Key: {client_api_key}" \
  -d '{
      "quote": {
      "crypto": "USDC_POLYGON_NXTB",
      "fiat": "MXN",
      "side": "sell",
      "country": "MX",
      "user_id": "210hre129n1209n12",
      "amount_fiat": 100   
      }
  }'

Successful Response

  {
    "id": "893nr89nf8932fnnifn2if",
    "user_id": "210hre129n1209n12",
    "crypto": "USDC_POLYGON_NXTB",
    "fiat": "MXN",
    "country": "MX",
    "side": "sell",
    "amount_fiat": 100,
    "amount_crypto": 4.5
  }
POST/crypto/orders

4. Create an order for the quote

This endpoint allows you to create an order based on a previously obtained quote.

The quote expires after 10 seconds. This means to create an order, you must have a valid quote within that time frame.

Required attributes

  • Name
    quote_id
    Type
    string
    Description

    The unique identifier of the user who owns the bank account.

  • Name
    payout_bank_account_id
    Type
    string
    Description

    The unique identifier of the bank account where the MXN payment will be sent.

  • Name
    notes
    Type
    string
    Description

    Optional notes for the order. This is optional

Request

POST
/crypto/orders
curl -X POST https://sandbox.api.coba.ai/metal/crypto/orders\
  -H "Authorization: Bearer {token}" \
  -H "X-Coba-Metal-API-Key: {client_api_key}" \
  -d '{
    "order": {
        "quote_id": "b9023nf023nf32nf32ndw",
        "payout_bank_account_id": "68c0592bc5e913h092nc92be",
        "notes": "testing"
    }
  }'
  {
    "id": "893nr89nf8932fnnifn2if",
  }
GET/crypto/orders/:id

5. Fund the order

This endpoint return an order object with instructions to fund the order.

The status of the order should be awaitingPayment for instructions to be included in the response.

You can use the instructions to fund the order using USDC.

Request

GET
/crypto/orders/:id
curl -X GET https://sandbox.api.coba.ai/metal/crypto/orders/:id\
  -H "Authorization: Bearer {token}" \
  -H "X-Coba-Metal-API-Key: {client_api_key}"

Successful Response

  {
    "id": "893nr89nf8932fnnifn2if",
    "user_id": "210hre129n1209n12",
    "quote_id": "b9023nf023nf32nf32ndw",
    "status": "awaitingPayment",
    "crypto": "USDC_POLYGON_NXTB",
    "fiat": "MXN",
    "country": "MX",
    "side": "sell",
    "amount_fiat": 100,
    "amount_crypto": 4.5,
    "payment_instructions": {
      "dueDate": "2024-06-04T15:02:13.097Z",
      "bankName": "Bank Name",
      "companyName": "Company Name",
      "companyAddress": "Company Address",
      "bankAddress": "Sandbox Bank Address, 12345, Sandbox City, Sandbox Country",
      "accountNumber": "<string>",
      "routingNumber": "123456789",
      "reference": "9f5676",
      "CLABE": "01212345678901",
      "RUC": "<string>",
      "RFC": "RBL123456789",
      "CCI": "00111233001112345678",
      "blockchainAddress": "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C"
    }
  }

Was this page helpful?