The Payment Company Logo

Crypto

Crypto On/Off Ramp API

This guide explains how to integrate with The Payment Company Crypto On/Off Ramp API. It supports seamless on-ramp (fiat to crypto) and off-ramp (crypto to fiat) transactions through a single endpoint, with endpoint details, payload information, and examples in multiple programming languages.

SectionCrypto
Topics08
Pathcrypto / on-off-ramp

API Endpoint

Live APIProduction environment
POSThttps://api.thepayment.company/api/v1/live/crypto
Test APISandbox environment
POSThttps://api.thepayment.company/api/v1/test/crypto

Overview

The Crypto On/Off Ramp API provides a single solution for both on-ramp and off-ramp cryptocurrency transactions:

  • On-ramp (fiat to crypto): Convert fiat currency into cryptocurrency
  • Off-ramp (crypto to fiat): Convert cryptocurrency into fiat currency

Both transaction types are handled through the same API endpoint, with the transaction type specified in the request payload.

Request Fields

ParameterTypeDescriptionRequired
first_nameStringUser first name, 3-191 letters onlyYes
last_nameStringUser last name, 3-191 letters onlyYes
phone_numberStringUser phone number, 8-19 digits with an optional + prefixYes
transaction_typeStringTransaction type: ONRAMP (fiat to crypto) or OFFRAMP (crypto to fiat)Yes
fiat_currencyStringFiat currency code, 3 characters, for example USD or EURYes
crypto_currencyStringCryptocurrency code, for example BTC, ETH, or USDTYes
crypto_networkStringCryptocurrency network, for example ETHEREUM or BITCOINYes
crypto_amountNumberCryptocurrency amount, required for OFFRAMP and not allowed for ONRAMPConditional
fiat_amountNumberFiat amount, required for ONRAMP and not allowed for OFFRAMPConditional
wallet_addressStringCrypto wallet address used to receive or send fundsYes
ip_addressStringUser IP addressYes
emailStringUser email addressYes
countryStringCountry code in ISO 3166-1 alpha-2 formatYes
payment_methodStringPayment method: CARD, BANK, or WALLETNo
redirect_urlStringURL where the user is redirected after the transactionYes
webhook_urlStringURL used for server-to-server webhook updatesNo
order_idStringMerchant-side unique order referenceNo
terminal_idStringUnique connector terminal ID, useful when choosing a primary or fallback connectorNo

Transaction Type Rules

ONRAMP transactions:
  • fiat_amount is required
  • crypto_amount should not be sent
  • The user pays in fiat currency and receives cryptocurrency
OFFRAMP transactions:
  • crypto_amount is required
  • fiat_amount should not be sent
  • The user sends cryptocurrency and receives fiat currency

Sample Payloads

On-Ramp Transaction (Fiat to Crypto)

{
  "first_name": "John",
  "last_name": "Doe",
  "phone_number": "+1234567890",
  "transaction_type": "ONRAMP",
  "fiat_currency": "USD",
  "crypto_currency": "BTC",
  "crypto_network": "BITCOIN",
  "fiat_amount": 1000,
  "wallet_address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
  "ip_address": "192.168.1.1",
  "email": "john.doe@example.com",
  "country": "US",
  "order_id": "ORD123456789",
  "redirect_url": "https://example.com/success",
  "webhook_url": "https://example.com/webhook"
}

Off-Ramp Transaction (Crypto to Fiat)

{
  "first_name": "Jane",
  "last_name": "Smith",
  "phone_number": "+1987654321",
  "transaction_type": "OFFRAMP",
  "fiat_currency": "EUR",
  "crypto_currency": "ETH",
  "crypto_network": "ETHEREUM",
  "crypto_amount": 2.5,
  "wallet_address": "0x32Be343B94f860124dC4fEe278FDCBD38C102D88",
  "ip_address": "192.168.1.2",
  "email": "jane.smith@example.com",
  "country": "DE",
  "order_id": "ORD123456789",
  "redirect_url": "https://example.com/success",
  "webhook_url": "https://example.com/webhook"
}

Sample Responses

{
"status": "REDIRECT",
"message": "Please redirect user to complete the payment.",
"redirect_url": "https://example.com/success",
"data": {
  "transaction_id": "TXN123456789",
  "fiat": "USD",
  "fiat_amount": 1000,
  "crypto": "BTC",
  "crypto_amount": 0.025,
  "customer": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com"
  }
}
}

Integration Notes

Encrypted payment APIs must use AES-256-CBC before transmitting sensitive fields. Authentication, headers, encryption steps, and sample implementations for Node.js, PHP, Python, and Java are documented in Integration Examples.

On this page