Quickstart

This walkthrough takes you from a fresh test key to a confirmed advance. Everything here runs in test mode — the full flow works end to end, but no real money moves.

Before You Start

You need the credentials from Getting Access: your test API key (rk_test_...), your webhook signing secret, and the API base URL. Export the key and base URL as environment variables on your server — the samples below read SSC_API_KEY and SSC_API_BASE_URL.

Create an Offer

An offer is a short-lived quote. Send the merchant's pending disbursals — one or more lines, each with its own partner_ref, integer-centavo amount, and original_disbursal_date — and the API replies with the fee, the net proceeds, and an offer_id.

Offers expire after ten minutes, so create them when the merchant is actually looking, not in advance. The Idempotency-Key header makes the request safe to retry if your connection drops.

curl -X POST "https://api-795734133708.asia-east1.run.app/v1/offers" \
  -H "Authorization: Bearer $SSC_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: offer-2026-07-17-001' \
  --data '{
    "disbursals": [
      {
        "partner_ref": "DISB-EXAMPLE-001",
        "amount": 250000,
        "original_disbursal_date": "2026-07-15"
      },
      {
        "partner_ref": "DISB-EXAMPLE-002",
        "amount": 100000,
        "original_disbursal_date": "2026-07-18"
      }
    ]
  }'

Create an Advance

Turn the quote into an advance with the returned offer_id, the merchant's details, and their bank account for the payout. Choose disbursal_mode here: ops (the default) if Shopsuey Ops prepares the transfer, or partner if your own payout system does — see Disbursal responsibility for how to pick.

Keep the advance partner_ref stable: repeating the same create request returns the existing advance instead of making a duplicate.

curl -X POST "https://api-795734133708.asia-east1.run.app/v1/advances" \
  -H "Authorization: Bearer $SSC_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: advance-2026-07-17-001' \
  --data '{
    "offer_id": "00000000-0000-4000-8000-000000000001",
    "partner_merchant_id": "merchant_example_001",
    "display_name": "Merchant Example",
    "bank": {
      "bank_code": "BANK_EXAMPLE",
      "account_number": "acct_example_1234",
      "account_name": "Merchant Example"
    },
    "partner_ref": "ADV-EXAMPLE-001",
    "return_url": "https://partner.example/advances/return",
    "disbursal_mode": "partner"
  }'

Redirect the Merchant

The create response includes confirmation_url — a hosted page where the merchant reviews the quoted terms and confirms. Redirect their browser there. If you passed a return_url, they come back to you afterwards, but treat that return purely as a UI signal; the confirmed status arrives through webhooks.

Handle the Outcome

After confirmation you receive a signed advance.confirmed webhook. What happens next depends on the mode you chose: in ops mode Shopsuey Ops prepares the disbursal and you just consume webhooks; in partner mode your backend calls POST /v1/advances/:id/disbursal to prepare it. Either way, GET /v1/advances/:id is always the source of truth if you need to reconcile.

Go Live

Once the test-mode flow works — including webhook verification — swap rk_test_ for your rk_live_ key. Nothing else changes: same endpoints, same payloads, same webhooks, real money.