# Off Ramp

Off-ramp

## Get off-ramp order

> Returns a single order by its ID.

```json
{"openapi":"3.1.0","info":{"title":"Fonbnk On-ramp API","version":"1.0.0"},"tags":[{"name":"off-ramp","description":"Off-ramp"}],"servers":[{"url":"https://sandbox-api.fonbnk.com","description":"Development server"},{"url":"https://aten.fonbnk-services.com","description":"Production server"}],"security":[{"ClientIdHeader":[]},{"TimestampHeader":[]},{"SignatureHeader":[]}],"components":{"securitySchemes":{"ClientIdHeader":{"type":"apiKey","in":"header","name":"x-client-id"},"TimestampHeader":{"type":"apiKey","in":"header","name":"x-timestamp"},"SignatureHeader":{"type":"apiKey","in":"header","name":"x-signature"}},"schemas":{"OfframpOrder":{"type":"object","properties":{"_id":{"type":"string"},"offerId":{"type":"string"},"paymentType":{"$ref":"#/components/schemas/OfframpPaymentType"},"network":{"$ref":"#/components/schemas/OfframpNetwork"},"asset":{"$ref":"#/components/schemas/OfframpAsset"},"exchangeRate":{"type":"number"},"cashout":{"type":"object","properties":{"localCurrencyAmount":{"type":"number"},"usdAmount":{"type":"number"},"feeAmountUsd":{"type":"number"},"feeAmountUsdFonbnk":{"type":"number"},"feeAmountUsdPartner":{"type":"number"},"feeAmountLocalCurrency":{"type":"number"},"feeAmountLocalCurrencyFonbnk":{"type":"number"},"feeAmountLocalCurrencyPartner":{"type":"number"},"cryptoAmount":{"type":"number"},"feeAmountCrypto":{"type":"number"},"feeAmountCryptoFonbnk":{"type":"number"},"feeAmountCryptoPartner":{"type":"number"}}},"fromAddress":{"type":"string"},"toAddress":{"type":"string"},"status":{"$ref":"#/components/schemas/OfframpOrderStatus"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"hash":{"type":"string"},"statusHistory":{"type":"array","items":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/OfframpOrderStatus"},"changedAt":{"type":"string","format":"date-time"}}}},"requiredFields":{"type":"object","description":"Fields that was required to be filled by the user"},"countryIsoCode":{"type":"string"},"userPhoneNumber":{"type":"string"},"userEmail":{"type":"string"},"currencyIsoCode":{"type":"string"},"offerRequiredFields":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}}}},"orderParams":{"type":"string"}}},"OfframpPaymentType":{"type":"string","enum":["CRYPTO_WALLET","VIRTUAL_WALLET"],"description":"- CRYPTO_WALLET: User will pay with a crypto wallet\n- VIRTUAL_WALLET: Order will be paid from a merchant's virtual wallet"},"OfframpNetwork":{"type":"string","enum":["AVALANCHE","POLYGON","CELO","ETHEREUM"]},"OfframpAsset":{"type":"string","enum":["USDC","USDT","CUSD","CKES"]},"OfframpOrderStatus":{"type":"string","enum":["initiated","awaiting_transaction_confirmation","transaction_confirmed","transaction_failed","offramp_success","offramp_pending","offramp_failed","offramp_retry","refunding","refunded","refund_failed","expired","cancelled","validating_transaction","transaction_invalid"],"description":"- initiated: The offramp order has been initiated\n- awaiting_transaction_confirmation: User sent the transaction hash and system is awaiting confirmation\n- transaction_confirmed: User transaction has been confirmed\n- transaction_failed: User transaction has failed\n- offramp_success: The offramp transaction has been successful\n- offramp_pending: The offramp transaction is pending\n- offramp_failed: The offramp transaction has failed\n- offramp_retry: The offramp transaction is being retried\n- refunding: The offramp transaction is being refunded\n- refunded: The offramp transaction has been refunded\n- refund_failed: The offramp transaction refund has failed\n- expired: The offramp order has expired\n- cancelled: The offramp order has been cancelled by the user\n- validating_transaction: The offramp transaction is being validated\n- transaction_invalid: The offramp transaction is invalid"}}},"paths":{"/api/offramp/order/{id}":{"get":{"tags":["off-ramp"],"summary":"Get off-ramp order","description":"Returns a single order by its ID.","operationId":"getOfframpOrderById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfframpOrder"}}}}}}}}}
```

## Get off-ramp orders

> Returns a paginated list of orders. Filters can be applied to the list by providing query parameters.

```json
{"openapi":"3.1.0","info":{"title":"Fonbnk On-ramp API","version":"1.0.0"},"tags":[{"name":"off-ramp","description":"Off-ramp"}],"servers":[{"url":"https://sandbox-api.fonbnk.com","description":"Development server"},{"url":"https://aten.fonbnk-services.com","description":"Production server"}],"security":[{"ClientIdHeader":[]},{"TimestampHeader":[]},{"SignatureHeader":[]}],"components":{"securitySchemes":{"ClientIdHeader":{"type":"apiKey","in":"header","name":"x-client-id"},"TimestampHeader":{"type":"apiKey","in":"header","name":"x-timestamp"},"SignatureHeader":{"type":"apiKey","in":"header","name":"x-signature"}},"schemas":{"OfframpPaymentType":{"type":"string","enum":["CRYPTO_WALLET","VIRTUAL_WALLET"],"description":"- CRYPTO_WALLET: User will pay with a crypto wallet\n- VIRTUAL_WALLET: Order will be paid from a merchant's virtual wallet"},"OfframpNetwork":{"type":"string","enum":["AVALANCHE","POLYGON","CELO","ETHEREUM"]},"OfframpAsset":{"type":"string","enum":["USDC","USDT","CUSD","CKES"]},"OfframpType":{"type":"string","enum":["bank","airtime","mobile_money","paybill"]},"OfframpOrderStatus":{"type":"string","enum":["initiated","awaiting_transaction_confirmation","transaction_confirmed","transaction_failed","offramp_success","offramp_pending","offramp_failed","offramp_retry","refunding","refunded","refund_failed","expired","cancelled","validating_transaction","transaction_invalid"],"description":"- initiated: The offramp order has been initiated\n- awaiting_transaction_confirmation: User sent the transaction hash and system is awaiting confirmation\n- transaction_confirmed: User transaction has been confirmed\n- transaction_failed: User transaction has failed\n- offramp_success: The offramp transaction has been successful\n- offramp_pending: The offramp transaction is pending\n- offramp_failed: The offramp transaction has failed\n- offramp_retry: The offramp transaction is being retried\n- refunding: The offramp transaction is being refunded\n- refunded: The offramp transaction has been refunded\n- refund_failed: The offramp transaction refund has failed\n- expired: The offramp order has expired\n- cancelled: The offramp order has been cancelled by the user\n- validating_transaction: The offramp transaction is being validated\n- transaction_invalid: The offramp transaction is invalid"},"Paginated":{"type":"object","properties":{"nextCursor":{"type":"string"}}},"OfframpOrder":{"type":"object","properties":{"_id":{"type":"string"},"offerId":{"type":"string"},"paymentType":{"$ref":"#/components/schemas/OfframpPaymentType"},"network":{"$ref":"#/components/schemas/OfframpNetwork"},"asset":{"$ref":"#/components/schemas/OfframpAsset"},"exchangeRate":{"type":"number"},"cashout":{"type":"object","properties":{"localCurrencyAmount":{"type":"number"},"usdAmount":{"type":"number"},"feeAmountUsd":{"type":"number"},"feeAmountUsdFonbnk":{"type":"number"},"feeAmountUsdPartner":{"type":"number"},"feeAmountLocalCurrency":{"type":"number"},"feeAmountLocalCurrencyFonbnk":{"type":"number"},"feeAmountLocalCurrencyPartner":{"type":"number"},"cryptoAmount":{"type":"number"},"feeAmountCrypto":{"type":"number"},"feeAmountCryptoFonbnk":{"type":"number"},"feeAmountCryptoPartner":{"type":"number"}}},"fromAddress":{"type":"string"},"toAddress":{"type":"string"},"status":{"$ref":"#/components/schemas/OfframpOrderStatus"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"hash":{"type":"string"},"statusHistory":{"type":"array","items":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/OfframpOrderStatus"},"changedAt":{"type":"string","format":"date-time"}}}},"requiredFields":{"type":"object","description":"Fields that was required to be filled by the user"},"countryIsoCode":{"type":"string"},"userPhoneNumber":{"type":"string"},"userEmail":{"type":"string"},"currencyIsoCode":{"type":"string"},"offerRequiredFields":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}}}},"orderParams":{"type":"string"}}}}},"paths":{"/api/offramp/orders":{"get":{"tags":["off-ramp"],"summary":"Get off-ramp orders","description":"Returns a paginated list of orders. Filters can be applied to the list by providing query parameters.","operationId":"getOfframpOrders","parameters":[{"name":"cursor","in":"query","description":"this parameter should be provided in order to get a next page from the pagination, it should be taken from \"nextCursor\" response value","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"number from 1 to 100, describes how many records should be in each pagination page","required":true,"schema":{"type":"integer"}},{"name":"paymentType","in":"query","description":"payment type of orders","required":false,"schema":{"$ref":"#/components/schemas/OfframpPaymentType"}},{"name":"network","in":"query","required":false,"schema":{"$ref":"#/components/schemas/OfframpNetwork"}},{"name":"asset","in":"query","required":false,"schema":{"$ref":"#/components/schemas/OfframpAsset"}},{"name":"fromAddress","in":"query","description":"address of a user wallet","required":false,"schema":{"type":"string"}},{"name":"userPhoneNumber","in":"query","description":"phone number of the client, should include country code","required":false,"schema":{"type":"string"}},{"name":"userEmail","in":"query","description":"email of the client","required":false,"schema":{"type":"string"}},{"name":"hash","in":"query","description":"hash of the user transaction","required":false,"schema":{"type":"string"}},{"name":"countryIsoCode","in":"query","description":"country ISO code, e.g. NG","required":false,"schema":{"type":"string"}},{"name":"offrampType","in":"query","description":"type of the offramp","required":false,"schema":{"$ref":"#/components/schemas/OfframpType"}},{"name":"orderParams","in":"query","description":"value of the orderParams query param during order creation","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"status of the order","required":false,"schema":{"$ref":"#/components/schemas/OfframpOrderStatus"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Paginated"},{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/OfframpOrder"}}}}]}}}}}}}}}
```

## Get best offer

> Returns the best offer for the provided country, network, asset, amount and off-ramp type.

```json
{"openapi":"3.1.0","info":{"title":"Fonbnk On-ramp API","version":"1.0.0"},"tags":[{"name":"off-ramp","description":"Off-ramp"}],"servers":[{"url":"https://sandbox-api.fonbnk.com","description":"Development server"},{"url":"https://aten.fonbnk-services.com","description":"Production server"}],"security":[{"ClientIdHeader":[]},{"TimestampHeader":[]},{"SignatureHeader":[]}],"components":{"securitySchemes":{"ClientIdHeader":{"type":"apiKey","in":"header","name":"x-client-id"},"TimestampHeader":{"type":"apiKey","in":"header","name":"x-timestamp"},"SignatureHeader":{"type":"apiKey","in":"header","name":"x-signature"}},"schemas":{"OfframpAmountCurrency":{"type":"string","enum":["local","usd"]},"OfframpType":{"type":"string","enum":["bank","airtime","mobile_money","paybill"]},"OfframpNetwork":{"type":"string","enum":["AVALANCHE","POLYGON","CELO","ETHEREUM"]},"OfframpAsset":{"type":"string","enum":["USDC","USDT","CUSD","CKES"]},"BestOfframpOfferResponse":{"type":"object","properties":{"offer":{"type":"object","properties":{"_id":{"type":"string"},"countryIsoCode":{"type":"string"},"currencyIsoCode":{"type":"string"},"exchangeRate":{"type":"number"},"cryptoExchangeRate":{"type":"number"},"requiredFields":{"type":"object","properties":{"fieldName":{"type":"object","properties":{"type":{"ref":"#/components/schemas/RequiredFieldType"},"label":{"type":"string"},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}}}}}}}},"type":{"$ref":"#/components/schemas/OfframpType"}}},"cashout":{"type":"object","properties":{"localCurrencyAmount":{"type":"number"},"usdAmount":{"type":"number"},"feeAmountUsd":{"type":"number"},"feeAmountUsdFonbnk":{"type":"number"},"feeAmountUsdPartner":{"type":"number"},"feeAmountLocalCurrency":{"type":"number"},"feeAmountLocalCurrencyFonbnk":{"type":"number"},"feeAmountLocalCurrencyPartner":{"type":"number"},"cryptoAmount":{"type":"number"},"feeAmountCrypto":{"type":"number"},"feeAmountCryptoFonbnk":{"type":"number"},"feeAmountCryptoPartner":{"type":"number"}}}}}}},"paths":{"/api/offramp/best-offer":{"get":{"tags":["off-ramp"],"summary":"Get best offer","description":"Returns the best offer for the provided country, network, asset, amount and off-ramp type.","operationId":"getBestOffer","parameters":[{"name":"amount","in":"query","description":"Amount of usd user wants to pay or amount of local currency user wants to receive depending on the currency param value","required":true,"schema":{"type":"number"}},{"name":"currency","in":"query","description":"Currency of the amount param","required":true,"schema":{"$ref":"#/components/schemas/OfframpAmountCurrency"}},{"name":"country","in":"query","description":"country ISO code, for example KE for Kenya, NG for Nigeria","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":true,"schema":{"$ref":"#/components/schemas/OfframpType"}},{"name":"network","in":"query","required":true,"schema":{"$ref":"#/components/schemas/OfframpNetwork"}},{"name":"asset","in":"query","required":true,"schema":{"$ref":"#/components/schemas/OfframpAsset"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BestOfframpOfferResponse"}}}}}}}}}
```

## Get off-ramp limits

> Returns minimum and maximum amount of order in USD and local currency with applied fees.

```json
{"openapi":"3.1.0","info":{"title":"Fonbnk On-ramp API","version":"1.0.0"},"tags":[{"name":"off-ramp","description":"Off-ramp"}],"servers":[{"url":"https://sandbox-api.fonbnk.com","description":"Development server"},{"url":"https://aten.fonbnk-services.com","description":"Production server"}],"security":[{"ClientIdHeader":[]},{"TimestampHeader":[]},{"SignatureHeader":[]}],"components":{"securitySchemes":{"ClientIdHeader":{"type":"apiKey","in":"header","name":"x-client-id"},"TimestampHeader":{"type":"apiKey","in":"header","name":"x-timestamp"},"SignatureHeader":{"type":"apiKey","in":"header","name":"x-signature"}},"schemas":{"OfframpType":{"type":"string","enum":["bank","airtime","mobile_money","paybill"]},"OfframpNetwork":{"type":"string","enum":["AVALANCHE","POLYGON","CELO","ETHEREUM"]},"OfframpAsset":{"type":"string","enum":["USDC","USDT","CUSD","CKES"]},"OfframpLimitsResponse":{"type":"object","properties":{"minUsd":{"type":"number"},"maxUsd":{"type":"number"},"minLocalCurrency":{"type":"number"},"maxLocalCurrency":{"type":"number"}}}}},"paths":{"/api/offramp/limits":{"get":{"tags":["off-ramp"],"summary":"Get off-ramp limits","description":"Returns minimum and maximum amount of order in USD and local currency with applied fees.","operationId":"getOfframpLimits","parameters":[{"name":"type","in":"query","description":"offramp type","required":true,"schema":{"$ref":"#/components/schemas/OfframpType"}},{"name":"country","in":"query","description":"country ISO code","required":true,"schema":{"type":"string"}},{"name":"network","in":"query","required":true,"schema":{"$ref":"#/components/schemas/OfframpNetwork"}},{"name":"asset","in":"query","required":true,"schema":{"$ref":"#/components/schemas/OfframpAsset"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfframpLimitsResponse"}}}}}}}}}
```

## Get supported countries

> Returns a list of supported countries and their offramp types

```json
{"openapi":"3.1.0","info":{"title":"Fonbnk On-ramp API","version":"1.0.0"},"tags":[{"name":"off-ramp","description":"Off-ramp"}],"servers":[{"url":"https://sandbox-api.fonbnk.com","description":"Development server"},{"url":"https://aten.fonbnk-services.com","description":"Production server"}],"security":[{"ClientIdHeader":[]},{"TimestampHeader":[]},{"SignatureHeader":[]}],"components":{"securitySchemes":{"ClientIdHeader":{"type":"apiKey","in":"header","name":"x-client-id"},"TimestampHeader":{"type":"apiKey","in":"header","name":"x-timestamp"},"SignatureHeader":{"type":"apiKey","in":"header","name":"x-signature"}},"schemas":{"OfframpSupportedCountry":{"type":"object","properties":{"countryIsoCode":{"type":"string"},"currencyIsoCode":{"type":"string"},"name":{"type":"string"},"offrampTypes":{"type":"array","items":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/OfframpType"},"name":{"type":"string"},"carriers":{"type":"array","items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}}}}}}},"OfframpType":{"type":"string","enum":["bank","airtime","mobile_money","paybill"]}}},"paths":{"/api/offramp/countries":{"get":{"tags":["off-ramp"],"summary":"Get supported countries","description":"Returns a list of supported countries and their offramp types","operationId":"getSupportedCountries","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OfframpSupportedCountry"}}}}}}}}}}
```

## Get supported blockchain assets

> Returns a list of supported wallet networks and their assets for crypto wallet orders

```json
{"openapi":"3.1.0","info":{"title":"Fonbnk On-ramp API","version":"1.0.0"},"tags":[{"name":"off-ramp","description":"Off-ramp"}],"servers":[{"url":"https://sandbox-api.fonbnk.com","description":"Development server"},{"url":"https://aten.fonbnk-services.com","description":"Production server"}],"security":[{"ClientIdHeader":[]},{"TimestampHeader":[]},{"SignatureHeader":[]}],"components":{"securitySchemes":{"ClientIdHeader":{"type":"apiKey","in":"header","name":"x-client-id"},"TimestampHeader":{"type":"apiKey","in":"header","name":"x-timestamp"},"SignatureHeader":{"type":"apiKey","in":"header","name":"x-signature"}},"schemas":{"OfframpWallet":{"type":"object","properties":{"network":{"$ref":"#/components/schemas/OfframpNetwork"},"asset":{"$ref":"#/components/schemas/OfframpAsset"}}},"OfframpNetwork":{"type":"string","enum":["AVALANCHE","POLYGON","CELO","ETHEREUM"]},"OfframpAsset":{"type":"string","enum":["USDC","USDT","CUSD","CKES"]}}},"paths":{"/api/offramp/wallets":{"get":{"tags":["off-ramp"],"summary":"Get supported blockchain assets","description":"Returns a list of supported wallet networks and their assets for crypto wallet orders","responses":{"200":{"description":"A list of supported wallet networks and their assets","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OfframpWallet"}}}}}}}}}}
```

## Validate user required fields

> The get best offer endpoint returns the required fields that need to be provided by a user. This endpoint allows you to validate the fields provided by a user. Endpoint might return a list of user information that can help a user to verify the correctness of the provided information.

```json
{"openapi":"3.1.0","info":{"title":"Fonbnk On-ramp API","version":"1.0.0"},"tags":[{"name":"off-ramp","description":"Off-ramp"}],"servers":[{"url":"https://sandbox-api.fonbnk.com","description":"Development server"},{"url":"https://aten.fonbnk-services.com","description":"Production server"}],"security":[{"ClientIdHeader":[]},{"TimestampHeader":[]},{"SignatureHeader":[]}],"components":{"securitySchemes":{"ClientIdHeader":{"type":"apiKey","in":"header","name":"x-client-id"},"TimestampHeader":{"type":"apiKey","in":"header","name":"x-timestamp"},"SignatureHeader":{"type":"apiKey","in":"header","name":"x-signature"}},"schemas":{"OfframpValidateFieldsRequest":{"type":"object","properties":{"offerId":{"type":"string","description":"ID of the offer returned from get best offer endpoint"},"requiredFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Object with user required fields"}},"required":["offerId","requiredFields"]},"OfframpValidateFieldsResponse":{"type":"object","properties":{"details":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}}}}}}},"paths":{"/api/offramp/validate-fields":{"post":{"tags":["off-ramp"],"summary":"Validate user required fields","description":"The get best offer endpoint returns the required fields that need to be provided by a user. This endpoint allows you to validate the fields provided by a user. Endpoint might return a list of user information that can help a user to verify the correctness of the provided information.","operationId":"validateUserRequiredFields","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfframpValidateFieldsRequest"}}}},"responses":{"200":{"description":"Validation successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfframpValidateFieldsResponse"}}}}}}}}}
```

## Create order

> Creates an order for a provided user details.

```json
{"openapi":"3.1.0","info":{"title":"Fonbnk On-ramp API","version":"1.0.0"},"tags":[{"name":"off-ramp","description":"Off-ramp"}],"servers":[{"url":"https://sandbox-api.fonbnk.com","description":"Development server"},{"url":"https://aten.fonbnk-services.com","description":"Production server"}],"security":[{"ClientIdHeader":[]},{"TimestampHeader":[]},{"SignatureHeader":[]}],"components":{"securitySchemes":{"ClientIdHeader":{"type":"apiKey","in":"header","name":"x-client-id"},"TimestampHeader":{"type":"apiKey","in":"header","name":"x-timestamp"},"SignatureHeader":{"type":"apiKey","in":"header","name":"x-signature"}},"schemas":{"CreateOrderRequest":{"type":"object","properties":{"offerId":{"type":"string","description":"ID of the offer returned from get best offer endpoint"},"requiredFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Object with user required fields"},"paymentType":{"$ref":"#/components/schemas/OfframpPaymentType"},"network":{"$ref":"#/components/schemas/OfframpNetwork"},"asset":{"$ref":"#/components/schemas/OfframpAsset"},"address":{"type":"string","description":"Address of the wallet from which funds will be sent"},"currency":{"$ref":"#/components/schemas/OfframpAmountCurrency"},"amount":{"type":"number","description":"Amount of usd user wants to pay or amount of local currency user wants to receive depending on the currency param value"},"ip":{"type":"string","description":"IP address of a user"},"orderParams":{"type":"string","description":"OrderParams that need to be associated with an order"}},"required":["offerId","requiredFields","paymentType","network","asset","address","currency","amount"]},"OfframpPaymentType":{"type":"string","enum":["CRYPTO_WALLET","VIRTUAL_WALLET"],"description":"- CRYPTO_WALLET: User will pay with a crypto wallet\n- VIRTUAL_WALLET: Order will be paid from a merchant's virtual wallet"},"OfframpNetwork":{"type":"string","enum":["AVALANCHE","POLYGON","CELO","ETHEREUM"]},"OfframpAsset":{"type":"string","enum":["USDC","USDT","CUSD","CKES"]},"OfframpAmountCurrency":{"type":"string","enum":["local","usd"]},"OfframpOrder":{"type":"object","properties":{"_id":{"type":"string"},"offerId":{"type":"string"},"paymentType":{"$ref":"#/components/schemas/OfframpPaymentType"},"network":{"$ref":"#/components/schemas/OfframpNetwork"},"asset":{"$ref":"#/components/schemas/OfframpAsset"},"exchangeRate":{"type":"number"},"cashout":{"type":"object","properties":{"localCurrencyAmount":{"type":"number"},"usdAmount":{"type":"number"},"feeAmountUsd":{"type":"number"},"feeAmountUsdFonbnk":{"type":"number"},"feeAmountUsdPartner":{"type":"number"},"feeAmountLocalCurrency":{"type":"number"},"feeAmountLocalCurrencyFonbnk":{"type":"number"},"feeAmountLocalCurrencyPartner":{"type":"number"},"cryptoAmount":{"type":"number"},"feeAmountCrypto":{"type":"number"},"feeAmountCryptoFonbnk":{"type":"number"},"feeAmountCryptoPartner":{"type":"number"}}},"fromAddress":{"type":"string"},"toAddress":{"type":"string"},"status":{"$ref":"#/components/schemas/OfframpOrderStatus"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"hash":{"type":"string"},"statusHistory":{"type":"array","items":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/OfframpOrderStatus"},"changedAt":{"type":"string","format":"date-time"}}}},"requiredFields":{"type":"object","description":"Fields that was required to be filled by the user"},"countryIsoCode":{"type":"string"},"userPhoneNumber":{"type":"string"},"userEmail":{"type":"string"},"currencyIsoCode":{"type":"string"},"offerRequiredFields":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}}}},"orderParams":{"type":"string"}}},"OfframpOrderStatus":{"type":"string","enum":["initiated","awaiting_transaction_confirmation","transaction_confirmed","transaction_failed","offramp_success","offramp_pending","offramp_failed","offramp_retry","refunding","refunded","refund_failed","expired","cancelled","validating_transaction","transaction_invalid"],"description":"- initiated: The offramp order has been initiated\n- awaiting_transaction_confirmation: User sent the transaction hash and system is awaiting confirmation\n- transaction_confirmed: User transaction has been confirmed\n- transaction_failed: User transaction has failed\n- offramp_success: The offramp transaction has been successful\n- offramp_pending: The offramp transaction is pending\n- offramp_failed: The offramp transaction has failed\n- offramp_retry: The offramp transaction is being retried\n- refunding: The offramp transaction is being refunded\n- refunded: The offramp transaction has been refunded\n- refund_failed: The offramp transaction refund has failed\n- expired: The offramp order has expired\n- cancelled: The offramp order has been cancelled by the user\n- validating_transaction: The offramp transaction is being validated\n- transaction_invalid: The offramp transaction is invalid"}}},"paths":{"/api/offramp/create-order":{"post":{"tags":["off-ramp"],"summary":"Create order","description":"Creates an order for a provided user details.","operationId":"createOfframpOrder","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"200":{"description":"Order created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfframpOrder"}}}}}}}}}
```

## Confirm order

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

```json
{"openapi":"3.1.0","info":{"title":"Fonbnk On-ramp API","version":"1.0.0"},"tags":[{"name":"off-ramp","description":"Off-ramp"}],"servers":[{"url":"https://sandbox-api.fonbnk.com","description":"Development server"},{"url":"https://aten.fonbnk-services.com","description":"Production server"}],"security":[{"ClientIdHeader":[]},{"TimestampHeader":[]},{"SignatureHeader":[]}],"components":{"securitySchemes":{"ClientIdHeader":{"type":"apiKey","in":"header","name":"x-client-id"},"TimestampHeader":{"type":"apiKey","in":"header","name":"x-timestamp"},"SignatureHeader":{"type":"apiKey","in":"header","name":"x-signature"}},"schemas":{"ConfirmOrderRequest":{"type":"object","properties":{"orderId":{"type":"string","description":"ID of the order returned from create order endpoint"},"hash":{"type":"string","description":"Transaction hash for crypto orders"}},"required":["orderId","hash"]},"OfframpOrder":{"type":"object","properties":{"_id":{"type":"string"},"offerId":{"type":"string"},"paymentType":{"$ref":"#/components/schemas/OfframpPaymentType"},"network":{"$ref":"#/components/schemas/OfframpNetwork"},"asset":{"$ref":"#/components/schemas/OfframpAsset"},"exchangeRate":{"type":"number"},"cashout":{"type":"object","properties":{"localCurrencyAmount":{"type":"number"},"usdAmount":{"type":"number"},"feeAmountUsd":{"type":"number"},"feeAmountUsdFonbnk":{"type":"number"},"feeAmountUsdPartner":{"type":"number"},"feeAmountLocalCurrency":{"type":"number"},"feeAmountLocalCurrencyFonbnk":{"type":"number"},"feeAmountLocalCurrencyPartner":{"type":"number"},"cryptoAmount":{"type":"number"},"feeAmountCrypto":{"type":"number"},"feeAmountCryptoFonbnk":{"type":"number"},"feeAmountCryptoPartner":{"type":"number"}}},"fromAddress":{"type":"string"},"toAddress":{"type":"string"},"status":{"$ref":"#/components/schemas/OfframpOrderStatus"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"hash":{"type":"string"},"statusHistory":{"type":"array","items":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/OfframpOrderStatus"},"changedAt":{"type":"string","format":"date-time"}}}},"requiredFields":{"type":"object","description":"Fields that was required to be filled by the user"},"countryIsoCode":{"type":"string"},"userPhoneNumber":{"type":"string"},"userEmail":{"type":"string"},"currencyIsoCode":{"type":"string"},"offerRequiredFields":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}}}},"orderParams":{"type":"string"}}},"OfframpPaymentType":{"type":"string","enum":["CRYPTO_WALLET","VIRTUAL_WALLET"],"description":"- CRYPTO_WALLET: User will pay with a crypto wallet\n- VIRTUAL_WALLET: Order will be paid from a merchant's virtual wallet"},"OfframpNetwork":{"type":"string","enum":["AVALANCHE","POLYGON","CELO","ETHEREUM"]},"OfframpAsset":{"type":"string","enum":["USDC","USDT","CUSD","CKES"]},"OfframpOrderStatus":{"type":"string","enum":["initiated","awaiting_transaction_confirmation","transaction_confirmed","transaction_failed","offramp_success","offramp_pending","offramp_failed","offramp_retry","refunding","refunded","refund_failed","expired","cancelled","validating_transaction","transaction_invalid"],"description":"- initiated: The offramp order has been initiated\n- awaiting_transaction_confirmation: User sent the transaction hash and system is awaiting confirmation\n- transaction_confirmed: User transaction has been confirmed\n- transaction_failed: User transaction has failed\n- offramp_success: The offramp transaction has been successful\n- offramp_pending: The offramp transaction is pending\n- offramp_failed: The offramp transaction has failed\n- offramp_retry: The offramp transaction is being retried\n- refunding: The offramp transaction is being refunded\n- refunded: The offramp transaction has been refunded\n- refund_failed: The offramp transaction refund has failed\n- expired: The offramp order has expired\n- cancelled: The offramp order has been cancelled by the user\n- validating_transaction: The offramp transaction is being validated\n- transaction_invalid: The offramp transaction is invalid"}}},"paths":{"/api/offramp/confirm-order":{"post":{"tags":["off-ramp"],"summary":"Confirm order","description":"Confirms an order by providing a transaction hash for crypto orders and order ID returned from the create order endpoint.","operationId":"confirmOfframpOrder","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmOrderRequest"}}}},"responses":{"200":{"description":"Order confirmed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfframpOrder"}}}}}}}}}
```
