SplitPay

Quickstart

Token, card binding and the first charge

1. Get a key

In the admin panel open My business β†’ Merchants β†’ Issue key. Store clientId and clientSecret: the secret is shown only once.

2. Get a token

TOKEN=$(curl -s -X POST https://splitpay-api.buzzi.uz/v1/auth/token \
  -H 'content-type: application/json' \
  -d '{"clientId":"sp_…","clientSecret":"sk_…"}' | jq -r .data.accessToken)

The token lives for an hour. Fetch a new one when the API answers 401, and never ship clientSecret in client-side code.

3. Bind a card

curl -X POST https://splitpay-api.buzzi.uz/v1/cards \
  -H "authorization: Bearer $TOKEN" \
  -H 'content-type: application/json' \
  -d '{
    "externalUserId": "user-42",
    "cardNumber": "8600123456789012",
    "expiryMonth": 9,
    "expiryYear": 29
  }'

# the cardholder received an SMS code, confirm the binding
curl -X POST https://splitpay-api.buzzi.uz/v1/cards/{cardId}/confirm \
  -H "authorization: Bearer $TOKEN" \
  -H 'content-type: application/json' \
  -d '{"code":"123456"}'

Never store the card number or log it: use the card id from here on.

4. Charge

curl -X POST https://splitpay-api.buzzi.uz/v1/charges \
  -H "authorization: Bearer $TOKEN" \
  -H 'idempotency-key: order-777-charge' \
  -H 'content-type: application/json' \
  -d '{
    "externalId": "order-777",
    "cardId": "…",
    "amount": 25000000,
    "recipients": [
      { "recipientId": "01a0…b24b", "share": 7000 },
      { "recipientId": "01a0…7b8d", "share": 3000 }
    ]
  }'

amount is in tiyin, so 25,000,000 means 250,000 UZS. Shares are basis points and must add up to 10000: 70% and 30% here.

With a 5% fee the recipients get 166,250 and 71,250 UZS. The split and the receipt run in the background, check them with GET /v1/charges/{chargeId}.

The idempotency-key header is required on every POST that creates money or cards: a repeat with the same key returns the first result instead of creating a second charge.

On this page