Initiate a transaction

Initiate a transaction.

To initiate a transaction, a email address must be specified in the body of the request. This email address will be used to create an entry in the Business Customer list of your business if it does not already exist. So, typically, the email of the person making the payment is to be provided. Every newly initiated transaction is only valid for 5 mins unless payment is received and a verification request is made to the IvoryPay API

POST https://api.ivorypay.io/v1/transactions

Request Body

NameTypeDescription

crypto*

String

The cryptocurrency in which the amount is to be charged. Supported currencies are USDT, USDC and SOL

baseFiat*

String

The fiat currency of the amount to be charged. Supported fiats are NGN, GHS, ZAR and KES

amount

Number

The amount in the fiat currency which is to be charged in the specified.

email*

String

A valid email address.

reference

String

An optional reference of 32 characters. We recommend that you generate unique references for each of your transactions.

metadata

String

Any piece of data in JSON format that you wish to store along with the transaction.

{
    "success": true,
    "message": "Transaction was initiated successfully",
    "data": {
        "id": "086e3492-679c-4867-aa0a-b755d07ac940",
        "email": "nwakasistephen@gmail.com",
        "address": "C26ThRAFrGzkzRTsDoYSNA6CVLPxA37xwsfFwbf3gMVS",
        "reference": "O9qfaNsnm094Gkfqv2wpbou4w8vy1u0r",
        "expectedAmountInUSD": 0.25,
        "expectedAmountInCrypto": 0.25,
        "feeInCrypto": 0.0025,
        "expectedAmountWithFeeInCrypto": 0.2525,
        "crypto": "USDC",
        "baseFiat": "NGN",
        "baseFiatToUSDRate": 0.002,
        "usdToCryptoRate": 0.9999
    }
}

In the above response, the client is expected to pay the cryptocurrency (USDC in our example response) of an amount equal to expectedAmountWithFeeInCrypto field. The expectedAmountWithFeeInCrypto is the sum of expectedAmountInCrypto and feeInCrypto. Initiating a transaction is only the first step. After payment is made, the client is expected to verify payment.

Ensure to verify the status of transaction using the Transaction Verification endpoint before you give value to your customers.

Last updated