Skip to main content

Prerequisites

Before you begin, make sure you have:
  1. A User with GLOBAL_NETWORK Rail enabled
  2. Valid payment method (bank account, card, etc.)

Step 1: Create Account

POST /v2/users/{userId}/accounts
curl --request POST \
     --url https://production.hifibridge.com/v2/users/{userId}/accounts \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '{
  "rail": "onramp",
  "type": "mexicoGlobalNetwork",
  "accountHolder": {
    "name": "María González",
    "type": "individual",
    "address": {
      "city": "Mexico City",
      "country": "MX",
      "postalCode": "01000",
      "addressLine1": "123 Reforma",
      "addressLine2": "Piso 5",
      "stateProvinceRegion": "CDMX"
    },
    "dateOfBirth": "1988-07-12",
    "idNumber": "MX12345678901",
    "nationality": "MEX"
  },
  "mexicoGlobalNetwork": {
    "bankName": "Banco Santander",
    "accountNumber": "1234567890",
    "currency": "mxn"
  }
}'
Response:
{
  "id": "acc_456789123",
  "type": "mexicoGlobalNetwork",
  "rail": "offramp",
  "status": "ACTIVE",
  "accountHolder": {
    "name": "María González",
    "type": "individual"
  },
  "mexicoGlobalNetwork": {
    "bankName": "Banco Santander",
    "accountNumber": "1234567890",
    "currency": "mxn"
  },
  "createdAt": "2025-02-03T17:15:31.927121+00:00"
}

Step 2: Create Offramp

Create the offramp transaction directly: POST /v2/offramps
curl --request POST \
     --url https://production.hifibridge.com/v2/offramps \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '{
  "requestId": "string",
  "purposeOfPayment": "gift",
  "isInstant": false,
  "source": {
    "amount": 1000,
    "currency": "usdc",
    "transferType": "crypto",
    "accountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  },
  "destination": {
    "amount": 17000,
    "currency": "mxn",
    "chain": "POLYGON_AMOY",
    "userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "externalWalletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "virtualAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  },
  "fee": {
    "type": "FIX",
    "value": 0
  }
}'
Response:
{
  "transferType": "OFFRAMP",
  "transferDetails": {
    "id": "b26927e6-2771-423c-af44-a3c7a3e815c5",
    "requestId": "e1047def-6942-4fd7-be04-e62eb41813b6",
    "createdAt": "2025-02-03T17:15:31.927121+00:00",
    "updatedAt": "2025-02-03T17:15:35.882+00:00",
    "status": "AWAITING_FUNDS",
    "failedReason": null,
    "source": {
      /* source wallet details */
    },
    "destination": {
      /* destination account details */
    },
    "receipt": {
      /* transaction receipt */
    },
    "developerFee": null,
    "quoteInformation": {
      /* exchange rate and fees */
    }
  }
}

Refresh Quote

While the quote is still valid, you can refresh it to get updated rates: POST /v2/offramps/{transferId}/quote/refresh
curl --request POST \
     --url https://production.hifibridge.com/v2/offramps/{transferId}/quote/refresh \
     --header 'accept: application/json'
Info: You can only refresh quotes while the offramp is in AWAITING_FUNDS status and before the quote expires.

Step 3: Accept Quote

Once you’re satisfied with the quote, accept it to proceed with the offramp: POST /v2/offramps/{transferId}/quote/accept
curl --request POST \
     --url https://production.hifibridge.com/v2/offramps/{transferId}/quote/accept \
     --header 'accept: application/json'
Info: Once you accept the quote, you cannot refresh it again. Make sure you’re ready to proceed with the withdrawal.

Step 4: Process Withdrawal

The offramp will be processed automatically once the quote is accepted. Monitor the transaction status.

Step 5: Confirm Transaction

Listen for Webhooks

Set up webhook notifications to track status changes: Webhook Events:
  • OFFRAMP.CREATE - Creation for offramps
  • OFFRAMP.UPDATE - Updates for offramps

Check Bank Account

Verify the MXN has been received in your bank account: GET /v2/users/{userId}/accounts/{accountId}/balance
curl -X GET "https://production.hifibridge.com/v2/users/{userId}/accounts/{accountId}/balance" \
  -H "Authorization: Bearer YOUR_API_KEY"
I