Overview

DirectPay API enables seamless generation of offramp quotes for multiple tokens on multiple chains.

Base URL

<https://directpay-api.vercel.app>

Setup & Configuration

Create a quote for offramp

1. Generate Quote

Endpoint: POST /api/quote

Required Parameters

Parameter Type Description
originToken string Token address to send (e.g., USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48")
refundTo string Address for refunds
originChainId string Chain ID of origin token (e.g., "1" for Ethereum)
tradeType string Trade type: "EXACT_INPUT", "EXACT_OUTPUT", or "EXPECTED_OUTPUT"
amount string Represents the quantity of tokens you want to swap, but it must be provided in the token's smallest unit (e.g., for ETH use wei, for USDC use the smallest unit where 1 USDC = 1000000 units).
To convert your desired amount to the smallest unit, multiply your amount by 10^(number of decimals). You can get the number of decimals a token has from the currencies search endpoint.
user string User's address
bankDetails object Bank account details

Bank Details Object (All Required)

Field Type Description
institution string Bank code (e.g., "PALMNGPC")
accountIdentifier string Account number
accountName string Account holder name
memo string Transaction reference

Optional Parameters

Parameter Type Default Description
slippageTolerance string "50" Slippage tolerance in basis points
refundOnOrigin boolean true Enable refund on origin chain
enableTrueExactOutput boolean false Ensure exact output amount
useExternalLiquidity boolean false Use external liquidity sources
useDepositAddress boolean false Enable this to use a deposit address when offramping, in scenarios where calldata cannot be sent alongside the transaction. only works on few currency offramps. {ETH, SOL, MATIC, BNB etc.}

Example Request

{
  "originToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "refundTo": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  "originChainId": "1",
  "tradeType": "EXACT_INPUT",
  "bankDetails": {
    "institution": "PALMNGPC",
    "accountIdentifier": "8022537291",
    "accountName": "Johnny Depp",
    "memo": "DirectPay Transfer"
  },
  "amount": "10000000", 
  "user": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  "slippageTolerance": "50",
  "refundOnOrigin": true,
  "enableTrueExactOutput": false
}

Example Response

{
  "steps": [
    {
      "id": "deposit",
      "action": "Deposit USDC",
      "description": "Send USDC to the deposit address",
      "kind": "deposit",
      "items": [
        {
          "status": "pending",
          "data": {
            "transactionHash": null
          },
          "check": {
            "endpoint": "/api/status/relay/abc123",
            "method": "GET"
          }
        }
      ],
      "requestId": "abc123",
      "depositAddress": "0x123..." // Only if useDepositAddress is true
    }
  ],
  "fees": {
    "gas": {
      "amount": "0.005",
      "amountFormatted": "0.005 ETH",
      "amountUsd": "10.00",
      "amountNgn": "8000.00"
    },
    "relayer": {
      "amount": "1000000",
      "amountFormatted": "1 USDC",
      "amountUsd": "1.00",
      "amountNgn": "800.00"
    },
    "relayerGas": {
      "amount": "0.003",
      "amountFormatted": "0.003 ETH",
      "amountUsd": "6.00",
      "amountNgn": "4800.00"
    },
    "relayerService": {
      "amount": "500000",
      "amountFormatted": "0.5 USDC",
      "amountUsd": "0.50",
      "amountNgn": "400.00"
    },
    "app": {
      "amount": "200000",
      "amountFormatted": "0.2 USDC",
      "amountUsd": "0.20",
      "amountNgn": "160.00"
    }
  },
  "details": {
    "operation": "swap",
    "sender": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
    "recipient": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "currencyIn": {
      "amount": "10000000",
      "amountFormatted": "10 USDC",
      "amountUsd": "10.00",
      "amountNgn": "1560.00"
    },
    "currencyOut": {
      "amount": "9700000",
      "amountFormatted": "9.7 USDC",
      "amountUsd": "9.70",
      "amountNgn": "15132.00"
    },
    "totalImpact": {
      "usd": "0.30",
      "ngn": "240.00",
      "percent": "3.00"
    },
    "swapImpact": {
      "usd": "0.20",
      "ngn": "160.00",
      "percent": "2.00"
    },
    "timeEstimate": 1800
  },
  "settlement": {
    "paycrestOrderId": "ord_123abc",
    "bankDetails": {
      "institution": "PALMNGPC",
      "accountIdentifier": "7045620184",
      "accountName": "Ajibola Margaret Adunbi",
      "memo": "DirectPay Transfer"
    },
    "expectedDeliveryTime": "10-30 minutes"
  }
}