Skip to content
PaySwitch

Integration guide

For institutions that have been admitted and invited to the Portal. Everything here maps to the partner API reference (65 operations), generated from the contract itself.

Set up

  1. Sign in to the Portal

    Owner: Your institution’s owner

    Use the invitation PaySwitch staff sent. Portal sign-in.
  2. Create credentials

    Owner: Your institution’s owner

    Developer → API keys issues a labelled key and secret, shown once. Requests send X-API-Key and X-API-Secret; a native machine credential is sent as Authorization: Bearer instead.
  3. Register your webhook endpoint

    Owner: Your institution’s owner

    A public HTTPS URL. Issue a signing secret and send a signed test delivery from the Portal before going further.
  4. Enabled products

    Owner: PaySwitch network staff

    Transaction types, payment methods, FX and recurring products are enabled per your agreement. A call to a product you do not hold is refused, not silently routed.

Send an instruction

Every mutation carries an idempotencyKey (and the X-Idempotency-Key header where the reference says so). Retrying with the same key and body returns the original result; the same key with a different body is refused. Amounts are decimal values in the request currency — XOF has no minor units.

curl -X POST "$PAYSWITCH_API/api/v1/transactions" \
  -H "X-API-Key: $PAYSWITCH_KEY" \
  -H "X-API-Secret: $PAYSWITCH_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
      "type": "OCT",
      "amount": 25000,
      "currency": "XOF",
      "destinationCode": "JNP",
      "senderReference": "KRD-24-0412",
      "idempotencyKey": "KRD-24-0412"
    }'

The answer carries id, rrn, status and the nextAction you owe — for a payment that needs the customer, confirm it with the evidence reference once they have completed it. An outcome the executor has not reported stays unresolved and is recovered by status lookup; it is never shown as success.

Verify webhooks

X-PaySwitch-Delivery-Id
Stable across retries; deduplicate on it.
X-PaySwitch-Event
The event type, e.g. a transaction status change.
X-PaySwitch-Timestamp
Seconds since epoch; reject stale deliveries.
X-PaySwitch-Signature
HMAC-SHA256 of `${timestamp}.${body}` with your signing secret.
X-PaySwitch-Attempt
This attempt’s number, with X-PaySwitch-Max-Attempts.

Answer 2xx only after you have stored the event. Failed deliveries are retried with the same delivery id and can be re-queued through the webhooks operations.

Settlement and external obligations

Clearing turns your processed transactions into positions — what you owe and are owed, per currency. Read them through settlement reads. Debts that arose outside PaySwitch can join the same netting: declare one with external obligations, and it is netted only after the counterparty acknowledges it. Treasury records each out-of-system transfer against the cycle once its disbursement is approved; the cycle completes when every position is confirmed and reconciled.

SDKs

NestJS (@joonapay/payswitch-sdk) and Laravel (joonapay/payswitch-laravel) clients wrap transactions, payment intents and links, recurring agreements, external obligations and webhook verification. They are transport helpers: what you may call is still decided by your role and enabled products.

Open the API reference