Skip to main content

References & Duplicate Protection

Payscribe uses the request body ref to prevent duplicate financial operations. A ref is not an HTTP idempotency key that replays the original response.

How it works

Pass a unique ref value on supported write endpoints. Once the reference is already associated with a processed transaction, a repeat request is rejected and no second transaction is created.

This protects payment operations from duplicate client submissions. It does not remove the need to reconcile an operation after a network timeout.

Operations that use ref

OperationDuplicate-protection fieldEndpoint
TransferrefPOST /api/v1/payouts/transfer
Virtual account (dynamic)refPOST /api/v1/collections/virtual-accounts/create
Card creationrefPOST /api/v1/cards/create
Bills paymentrefPOST /api/v1/bills/*
FX quote creationrefPOST /api/v1/currency-pair, POST /api/v1/execute-quote
Simulate transferrefPOST /api/v1/collections/virtual-accounts/simulate-transfer

Best practices

  1. Always send a ref — Every supported write operation should include a unique reference.
  2. Use a UUID or order ID — Your internal order or transaction ID works well, for example ord_abc123.
  3. Reconcile after an uncertain result — If a client times out, keep the same ref, then look up the original operation before deciding whether to retry.
  4. Use a stable format — Use lowercase letters, digits, underscores, or hyphens; keep it below 100 characters and unique to one business operation.

Example

curl -X POST https://sandbox.payscribe.ng/api/v1/payouts/transfer \
-H "Authorization: Bearer $PAYSCRIBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"ref": "ord_001", "bank_code": "058", "account_number": "0123456789", "amount": 5000}'

Repeat the same request with the same ref. The API rejects the duplicate and does not create a second transfer.

Response on an existing reference:

{
"status": false,
"description": "Duplicate transaction found, please check",
"status_code": 406
}

Recovery after a timeout

If you do not receive a response, do not create a new reference immediately. Keep the original ref, wait briefly, then reconcile through the relevant transaction, transfer, wallet, or dashboard record. Create a new reference only after you have established that the original request did not create an operation.

ref uniqueness is retained for processed transaction records. Do not rely on a fixed expiry window for duplicate protection.

Was this page helpful?

Report a docs issue →