Partner API

Simulate a payment into a collection (sandbox only)

Sandbox only. Behaves as if a payer paid this collection, so you can test your integration end to end without sending real money. The collection must be open. Answers 200 once the collection has been marked as received, or 202 when the payment was accepted and the collection has not caught up yet: read it with GET /v1/collections/{id} a little later. No real money moves. While sandbox crediting is enabled, a collection created in sandbox is then credited at the bank simulator: read it until its status is credited. Otherwise it stays received. Not available in production: the route answers 404 there.

post/v1/simulations/collections/{id}/deposits

Request

  • Base URL
    https://sandbox.onlink.africa
  • Auth
    API key in header X-OnLink-Key

Path parameters

idstring required

Request body

amountstring required

How much the simulated payer pays, in USD, as a decimal string with at most two decimal places. Greater than 0 and at most 10000.00.

senderNamestring

The name the simulated payer appears under on the deposit. Letters, spaces, apostrophes, full stops and hyphens; it must start with a letter. Defaults to a placeholder name.

Example request

{
  "amount": "25.00",
  "senderName": "Amina Wanjiru"
}

Response

The collection was marked as received.

collectionIdstring required
referencestring required
route'memo' | 'virtual_account' required

How this collection takes payment: memo (a shared account with a reference the payer quotes) or virtual_account (a dedicated account).

collectionStatus'open' | 'received' | 'credited' | 'refunded' | 'expired' required

The collection status read back after the payment was processed.

crediting'pending' required

Always pending: it is the state when the payment was accepted, not the end state. A simulated payment marks the collection as received. While sandbox crediting is enabled, a collection created in sandbox is then credited at the bank simulator (no real money moves); otherwise it stays received. Read the collection to see which.

messagestring required

A sentence saying what happened.

Example response

{
  "collectionId": "a1b2c3d4-0000-4000-8000-000000000001",
  "reference": "DEMO-7K3Q2M",
  "route": "memo",
  "deposit": {
    "id": "SIM-DEP-6f1c2d9e-3b7a-4c51-9d0e-2a8b7c6d5e4f",
    "amount": "25.00",
    "currency": "USD",
    "status": "received"
  },
  "collectionStatus": "received",
  "crediting": "pending",
  "message": "Deposit received. The collection is credited to your account shortly; poll GET /v1/collections/{id} until it reads credited."
}

Changes

No recorded changes to this operation across all 1 revision of this API.