XendBridge
  • Get Started
  • 🛠️API Method Calls
    • Third Party Order Operations
      • Rate
      • Buy Order
      • Sell Order
      • Swap Order
      • Pending Order
      • Pay For Order
      • Cancel Order
    • LP Simulation
      • Pay For Order (Buy Order)
      • Pay For Order (Sell Order)
    • Dispute
      • Raise Third Party Dispute
      • Get All Disputes
      • XendBridge Chat SDK
    • Payment Inquiry
    • WebHooks
      • Order Payment Confirmation
      • Order Matched Notification
      • Order Canceled Notification
      • Checksum Verification
  • 📄XENDBRIDGE PORTAL
    • Checkout URL
      • Buy Order
      • Sell Order
      • Swap Order
      • Rate
      • Rate Bounds
      • Initiate Order Created With Deferred Payment Method
      • Supported Currencies
      • Payment Methods
    • Inline Html Snippet
    • DeFi Checkout
  • 📦XENDBRIDGE SDKS
    • XendBridge NodeJs SDK
    • XendBridge .NET SDK
      • Rate
      • Buy Order
      • Sell Order
      • Swap Order
      • Pending Order
      • Pay For Order Confirmation
      • Cancel Order
      • Raise A Dispute
  • Errors
  • 🔖REFERENCE
    • API Reference
Powered by GitBook
On this page

Was this helpful?

  1. API Method Calls
  2. Third Party Order Operations

Sell Order

Initiate Sell Order

The sell order POSTapi takes your secretKey as a required parameter which should be in your environment variables as it verifies the integrity of your third-party application.

You will send a POST request containing properties like the customer's email, phone number, customer deposit and receipt methods etc. See example below;

Initiates a sell order

POST https://canary.xendbridge.com/api/peertopeerorder/sell/initiate

Headers

Name
Type
Description

secretKey*

string

{your_secretKey}

Request Body

Name
Type
Description

email*

string

annadoe@gmail.com

phoneNumber

string

07012345678

userName

string

annadoe

payInCurrencyCode*

string

BUSD

payInCurrencyNetwork*

string

BEP-20

receieveInCurrencyCode*

string

NGN

receieveInCurrencyNetwork*

string

LOCAL

orderAmount*

decimal

50

consumerDepositMethod

object

paymentMethod*

string

Bank

paymentData

object

accountName*

string

John Doe

accountNumber*

string

0000187454

bankName*

string

Access Bank

consumerReceiptMethod

object

paymentMethod*

string

Crypto

paymentData

object

walletAddress*

String

0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd

network*

string

BEP-20

{
  "data": {
    "orderReference": "XS_37b9648ea5eb4e28a02858e4753b057d",
    "receiveInCurrencyCode": "NGN",
    "payInCurrencyCode": "BUSD",
    "receivableAmount": 20895,
    "payableAmount": 50,
    "receivableAmountWithoutMarkup": 0,
    "providerName": "John",
    "providerFirstName": "John",
    "providerLastName": "Doe",
    "providerEmail": "owolabidamilola98@gmail.com",
    "initiatedAt": "2022-05-06T11:08:13.1402548Z",
    "orderExpiryDate": "2022-05-06T11:23:11.3265504Z",
    "initiatedAtTimestamp": 1651835291326,
    "orderExpiryTimestamp": 1651836191326,
    "fundedProviderAtTimeStamp": null,
    "fundedCustomerAtTimeStamp": null,
    "orderCompletedAtTimeStamp": null,
    "p2POrderStatus": "Acknowledged",
    "disputeStatus": "NoDispute",
    "disputeReference": null,
    "orderType": "Sell",
    "providerContact": {
      "phoneNumber": "2348181186644",
      "whatsappNumber": ""
    },
    "customerContact": {
      "email": "annadoe@gmail.com",
      "name": "annadoe",
      "phoneNumber": "07064366723"
    },
    "providerPaymentMethods": {
      "paymentMethod": "Crypto",
      "paymentType": "Crypto",
      "paymentData": [
        {
          "walletAddress": "0xB13A251A67E7f7e7466758EF55A3aDD69A7C15A3",
          "network": "BEP20",
          "currency": "BUSD"
        }
      ],
      "orderPaymentMethod": {
        "walletAddress": "0xB13A251A67E7f7e7466758EF55A3aDD69A7C15A3",
        "network": "BEP20",
        "currency": "BUSD"
      }
    },
    "consumerDepositMethod": {
      "paymentMethod": "Crypto",
      "paymentType": 0,
      "paymentData": {
        "walletAddress": "QWEVDTWDGVT462E6EFYE9202Y239",
        "network": "BEP20",
        "currency": "BUSD"
      }
    },
    "consumerReceiptMethod": {
      "paymentMethod": "Bank",
      "paymentType": 0,
      "paymentData": {
        "bankName": "Access Bank",
        "accountNumber": "0000187849",
        "accountName": "Emmanuel Diala",
        "currency": "NGN",
        "network": "LOCAL"
      }
    },
    "providerTransactionMetadata": null
  },
  "status": "OK",
  "message": ""
}
{
    "Status": 2,
    "Message": "You Have A Pending Sell Order",
    "Data": null
}
JSON Request Format
{
  "emailAddress": "annadoe@gmail.com",
  "phoneNumber": "07064366723",
  "userName": "annadoe",
  "payInCurrencyCode": "BUSD",
  "payInCurrencyNetwork": "BEP20",
  "receiveInCurrencyCode": "NGN",
  "receiveInCurrencyNetwork": "LOCAL",
  "orderAmount": 50,
  "consumerDepositMethod": {
    "paymentMethod": "Crypto",
    "paymentData": {
      "walletAddress": "0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd",
      "network": "BEP20"
    }
  },
  "consumerReceiptMethod": {
    "paymentMethod": "Bank",
    "paymentData": {
      "accountName": "Anna Doe",
      "accountNumber": "0000187849",
      "bankName": "Access Bank"
    }
  }
}
Parameter
Type
Definitions

emailAddress

string

Required This is the consumer's email address.

phoneNumber

string

Required This is the consumer's phone number.

userName

string

Required This is the consumer's username

payInCurrencyCode

enum

Required This is the currency code to pay with. Must be BUSD for sell order.

receiveInCurrencyCode

enum

Required This is the currency code to receive the currency in. Must be NGN for buy order.

orderAmount

decimal

Required The order amount by the consumer.

consumerDepositMethod

object

Required This holds the properties of the deposit method of the consumer.

paymentMethod

enum

Required The payment method by which transactions are made. It should be CRYPTOfor sell order.

paymentData

object

Required This holds the properties of the wallet details of the consumer.

walletAddress

string

Required The crypto wallet address of the consumer.

network

enum

Required This is the network on which the address is on. It could be BEP20, ERC20 or POLYGON.

consumerReceiptMethod

object

Required This holds the properties of the consumer receiving method. The paymentMethod prop must be Bank .

paymentData

object

Required This holds the properties of the consumer receiving bank account details.

accountName

string

Required This is the account name of the consumer.

accountNumber

string

Required The local bank account number of the consumer

bankName

string

Required This is the bank name of the consumer.

Parameter
Type
Definitions

orderReference

string

This the reference to a particular order.

receiveInCurrencyCode

enum

This is the currency code to receive the currency in.

payInCurrencyCode

enum

This is the currency code to pay with.

receivableAmount

decimal

This the receivable amount of the currency.

payableAmount

decimal

This is the payable amount of the currency.

providerName

string

This the provider's name.

providerFirstName

string

This is the provider's first name.

providerLastName

string

This is the provider's last name.

providerEmail

string

This is the provider's email address.

initiatedAt

DateTime

The date time the order was made.

orderExpiryDate

DateTime

The expiry date time of the order.

initiatedAtTimestamp

long

The time in milliseconds an order was made

orderExpiryTimestamp

long

The time in milliseconds of when thee order will expire.

fundedProviderAtTimeStamp

long

The time of when a customer indicates payment for an order in milliseconds.

fundedCustomerAtTimeStamp

long

The time of when a provider indicates payment of order to the customer in milliseconds

orderCompletedAtTimeStamp

long

The time in milliseconds an order was completed.

p2POrderStatus

enum

The status of the order at the curent time. It could be Submitted, Cancelled, Acknowledged, FundedProvider, FundReceivedFromUser, FundedUser, Completed, OrderTimedOut

disputeStatus

enum

The status of the dispute on an order. It could either be NoDispute, DisputeRaisedByCustomer, DisputeRaisedByProvider, DisputeRaisedByBothParties, DisputeResolvedor CouldNotBeResolved.

orderType

enum

This is the status of the order, whether it's a Buy or Sell.

providerContact

object

This is holds props of a provider's contact information.

phoneNumber

string

The phone number of either the provider or customer.

whatsappNumber

string

The whatsapp number of either the provider or customer.

customerContact

object

This holds the props of the contact information.

email

string

This is an email address of the customer.

name

string

This is the name of the customer.

phoneNumber

string

The phone number of the customer

providerPaymentMethods

object

This holds the props of the payment methods of the provider.

paymentMethod

enum

This is the method of payment. It could be Bank or Crypto

paymentType

enum

This is the type of payment. It could be Bank, Crypto, UserNameor MobileMoney.

paymentData

object

This holds the props of the payment method.

bankName

string

The bank name of the the provider or customer.

accountNumber

string

The bank account number of the provider or customer.

accountName

string

The bank account name of the provider or customer.

currency

enum

The currency in which the order was made. It could be BUSD or NGN.

orderPaymentMethod

object

This holds props of the payment method in which the order is to be made to.

consumerDepositMethod

object

This holds the props of the consumer deposit details.

consumerrReceiptMethod

object

This holds the props of the consumer receiving method details.

walletAddress

string

This is the crypto wallet address of the consumer.

network

enum

This is the network currently supported in the system which the wallet address is based on.

providerTransactionMetadata

obj

This holds the props of the transaction metadata of an order.

PreviousBuy OrderNextSwap Order

Last updated 2 years ago

Was this helpful?

🛠️