Fonbnk Docs
  • Intro
  • Integration Guide
  • On-ramp
    • How it works
    • URL Parameters
    • Webhook
  • Off-ramp
    • How it works
    • URL Parameters
    • Webhook
  • Reference
    • Servers
    • Signing requests
    • Endpoints
      • On-ramp
        • Assets
        • Order
        • Orders
        • Price
        • Providers
        • Limits
      • Off-ramp
        • Order
        • Orders
        • Best offer
        • Limits
        • Countries
        • Wallets
        • Validate fields
        • Create order
        • Confirm order
      • Util
        • Check address
        • Assets
      • Kyc
        • State
        • Submit
    • Specification
Powered by GitBook
On this page
  1. Reference
  2. Endpoints
  3. Off-ramp

Confirm order

PreviousCreate orderNextUtil

Confirm order

post

Confirms an order by providing a transaction hash for crypto orders and order ID returned from the create order endpoint.

Authorizations
Body
orderIdstringRequired

ID of the order returned from create order endpoint

hashstringRequired

Transaction hash for crypto orders

Responses
200
Order confirmed successfully
application/json
post
POST /api/offramp/confirm-order HTTP/1.1
Host: sandbox-api.fonbnk.com
x-client-id: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 114

{
  "orderId": "660528663163c4652145aaba",
  "hash": "0xf4c04687dca90a9060861493d7baa8ce761081c44949ec3507c5413304b13ae3"
}
200

Order confirmed successfully

{
  "_id": "6603f8fc1c3f3f94d6b30818",
  "offerId": "65b8c6b8b188250081f30165",
  "paymentType": "CRYPTO_WALLET",
  "network": "CELO",
  "asset": "CUSD",
  "exchangeRate": 1268.6275,
  "cashout": {
    "localCurrencyAmount": 1294,
    "usdAmount": 1.02,
    "feeAmountUsd": 0.02,
    "feeAmountUsdFonbnk": 0.02,
    "feeAmountUsdPartner": 0,
    "feeAmountLocalCurrency": 26,
    "feeAmountLocalCurrencyFonbnk": 26,
    "feeAmountLocalCurrencyPartner": 0,
    "cryptoAmount": 1.02,
    "feeAmountCrypto": 0.02,
    "feeAmountCryptoFonbnk": 0.02,
    "feeAmountCryptoPartner": 0
  },
  "fromAddress": "0x5b7ae3c6c87F4A3F94b35c77233b13191eBFAD20",
  "toAddress": "0xe9bBDDCF0E8fcD41Bd1345aa5688B565931B0184",
  "status": "offramp_success",
  "createdAt": "2024-03-27T10:46:20.513Z",
  "expiresAt": "2024-03-27T11:46:20.509Z",
  "hash": "0xbda5dd11b17d65249238137f5d542320b66141ac96be3b750804354a6eadfb04",
  "statusHistory": [
    {
      "status": "initiated",
      "changedAt": "2024-03-27T10:46:20.522Z"
    },
    {
      "status": "awaiting_transaction_confirmation",
      "changedAt": "2024-03-27T10:46:31.007Z"
    },
    {
      "status": "transaction_confirmed",
      "changedAt": "2024-03-27T10:46:43.357Z"
    },
    {
      "status": "offramp_pending",
      "changedAt": "2024-03-27T10:46:44.568Z"
    },
    {
      "status": "offramp_success",
      "changedAt": "2024-03-27T10:50:02.649Z"
    }
  ],
  "requiredFields": {
    "bankCode": "011:02",
    "buyerBankAccountNumber": "3159586782",
    "phoneNumber": "2347000000007"
  },
  "countryIsoCode": "NG",
  "currencyIsoCode": "NGN",
  "offerRequiredFields": [
    {
      "label": "Phone number",
      "type": "phone",
      "value": "2347000000007"
    },
    {
      "label": "Bank name",
      "type": "enum",
      "value": "First Bank of Nigeria"
    },
    {
      "label": "Bank account Number",
      "type": "string",
      "value": "3179586682"
    }
  ],
  "orderParams": "43"
}