Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Your First Payment

Create your first TEST payment with the Ivorypay Business API, simulate payment and verify the result.

This guide uses Ivorypay Business (IVB), also called the Merchant API, to collect an order payment into your business balance. If you are adding Buy crypto or Sell crypto for your customers, start with the separate On/Off Ramp documentation. Compare the products before copying this example.

1. Prepare your backend

New to IVB? Create an IVB account and verify your email before setting up your API key.

  • Use your IVB TEST secret key from the IVB dashboard. Store it in an environment variable named IVORYPAY_SECRET_KEY on your server. On/Off Ramp keys cannot be used here.

  • Choose an enabled currency and token for that TEST business. A value appearing in an example does not enable it on your account.

  • Save a unique UUID reference against your order before making the request. Reuse it when checking that order; do not create another payment just because a request times out.

All paths below use https://api.ivorypay.io/api/v1. Secret keys stay on your backend.

2. Create a test collection

This example creates an NGN collection using your own payment interface. Replace the email and reference with your test customer's email and a new UUID. Use an amount above your account's configured minimum.

curl --request POST "https://api.ivorypay.io/api/v1/transactions" \
  --header "Authorization: $IVORYPAY_SECRET_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "mode": "API",
    "type": "FIAT",
    "amount": 50000,
    "baseFiat": "NGN",
    "crypto": "USDT",
    "email": "developer@example.com",
    "reference": "8fe17652-89a8-47f8-8ef4-50ea16908c21"
  }'

Check the HTTP response and success. Save data.reference and show the instructions in data.collectionDetails plus the exact returned data.amountInFiat. TEST account identifiers cannot receive money; do not make a real transfer.

For a real customer journey, choose the interface that fits your product:

Experience
Next step

Ivorypay hosted checkout

Set mode: "CHECKOUT"; open data.collectionDetails.checkoutUrl

Your own bank-transfer interface

Show the returned account details, amount and expiry

Your own ZAR interface

Choose Capitec Pay or EFT and open data.collectionDetails.nextAction.url for bank authorization

Mobile money

Follow the returned link or ask the customer to approve on their phone; see mobile money

Crypto

Show the returned token, network, address, amount and expiry; see crypto testing

3. Simulate a successful fiat payment

Call this only with the same TEST key and reference:

Also test FAILED and EXPIRED using separate new collections. The first terminal simulation outcome wins. See fiat testing.

4. Confirm the result on your server

Fulfil the order once, only when data.status is SUCCESS and the reference, currency and amounts match your saved order. success: true says the API request worked; data.status says what happened to the payment. A browser redirect is not payment confirmation.

5. Receive updates automatically

Configure a TEST webhook, verify its signature, save the event durably, and return HTTP 200. Handle duplicates safely. Use status checks to reconcile missing or delayed notifications.

Before going live

  • Complete business activation and confirm your intended payment methods are enabled.

  • Switch your backend to the matching LIVE secret key and configure LIVE webhooks.

  • Test invalid input, timeouts, duplicate notifications, expiry and reconciliation.

  • For payouts, configure your server IP allow-list, preview the rates, and check the final payout result.

Keep responses and safe retries beside the endpoint reference while integrating.

Last updated