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

Simulate Fiat Payment

The simulate endpoint lets you trigger a test fiat payment confirmation in the test environment without going through a real bank transfer. This is useful for end-to-end testing of your integration — confirming webhooks fire, order statuses update correctly, and your app handles payment success as expected.

This endpoint only works with test API keys (sk_test_...). Calling it with a live key will have no effect on live transactions.


How It Works

  1. You create a payment request using POST /v1/transactions (with your test secret key)

  2. Ivorypay generates non-payable test instructions locally; no provider is contacted

  3. Instead of waiting for a real bank transfer, you call POST /v1/fiat-transfer/simulate with the transaction reference

  4. Ivorypay processes the selected outcome through its normal transaction and webhook flow. Omitting outcome selects SUCCESS.


Endpoint

POST /v1/fiat-transfer/simulate

Authentication: Secret key (Authorization: sk_test_...)

Request Body

Field
Type
Required
Description

reference

string

Yes

The reference of your TEST transaction

outcome

string

No

SUCCESS (default), FAILED, or EXPIRED

Request Example

Response Example


Outcomes and expiry

For example, send {"reference":"your-reference","outcome":"FAILED"} to test a failure. Only the owning merchant's test secret key can simulate the payment. Amounts come from the saved instruction; the simulation request cannot choose an amount or another account.

New bank-transfer, mobile-money and EFT TEST collections use local instructions. Account identifiers beginning with TEST- cannot receive money. Do not transfer funds or approve a phone prompt. Unpaid instructions expire at their saved deadline; expiry is picked up by the minute-based worker. Success requested after that deadline becomes expiry. The first terminal result wins, and replaying it cannot credit twice.

These outcomes apply to locally generated instructions. Older provider-backed TEST records retain their existing success simulation; create a new request to test failure or expiry. Existing ambiguous attempts are not retried or rewritten automatically.

TEST payouts already complete locally without provider dispatch. Merchant simulation and internal provider-sandbox integration testing are separate.

Full Test Flow

Step 1 — Create a payment request

Response — payment details:

Step 2 — Simulate the payment

Step 3 — Verify the transaction status


Code Samples

Node.js

Python

PHP


Webhook Testing

When a simulated success is processed, Ivorypay fires a fiatCollection.success webhook event to your configured webhook URL (if set). This is the same payload you will receive in production.

Example webhook payload:

See Webhooks for how to verify the signature and handle events.


Important Notes

Rule
Detail

Test only

Only works with sk_test_... keys — no effect on live transactions

One-time

Simulating the same reference twice has no effect after the first success

Reference must exist

The transaction must have been created first via POST /v1/transactions

Webhook fires

Your webhook URL will receive the fiatCollection.success event

Failure and expiry use the existing failure webhook subscription (fiatCollection.failed, onramp.failed, or buy.failed); the payload retains its exact FAILED or EXPIRED status.

Last updated