AI PadelAPI documentation Back to site

1C integration

Club payments pushed from 1C (Russian accounting system) to player wallets. Access: the 1C token in the X-1C-Token header.

Base URL: https://your-server/api · Guide for this section: 1C payment import

Ping and token check #

GET/v1/integrations/1c/ping

Access: 1C token Header X-1C-Token: <1C token>.

Checks the token and returns counters of received payments: total and unmatched. Call it when setting up the exchange and before each upload.

Headers

NameTypeRequiredDescription
X-1C-Tokenstringyes1C integration token

Example request

curl -X GET "https://your-server/api/v1/integrations/1c/ping" \
  -H "X-1C-Token: <1C token>"

Responses

CodedetailMeaning
200—Success; example below
401bad_1c_tokenInvalid 1C token or the integration is disabled
422[…]Parameter or body validation error: detail is a list of errors

Example response

{"ok": true, "payments": 128, "unmatched": 3}

Import payments #

POST/v1/integrations/1c/payments

Access: 1C token Header X-1C-Token: <1C token>.

Accepts a batch of 1 to 500 payments. A payment is identified by ext_id (the 1C payment document number): resending the same ext_id credits nothing and comes back with result=duplicate, so a batch can be resent safely. The player is looked up by phone: found — the amount is credited to the wallet (applied); no player with this phone — the payment is stored as unmatched and credited later by re-matching; phone not recognized — rejected with error=bad_phone.

Headers

NameTypeRequiredDescription
X-1C-Tokenstringyes1C integration token

Request body application/json

FieldTypeRequiredDescription
paymentsarray [object]yesPayments, 1 to 500
items from 1; items up to 500
payments[].ext_idstringyes1C payment document number — the idempotency key
length from 1; length up to 64
payments[].phonestringyesPlayer phone: +7XXXXXXXXXX, 8XXXXXXXXXX or 10 digits
length from 10; length up to 20
payments[].amountintegeryesAmount in whole roubles, above 0 and up to 1,000,000
greater than 0; max 1000000
payments[].paid_atstring (date-time)yesPayment date and time (ISO 8601)
payments[].purposestringnoPurpose — shown in the player's wallet history
length up to 200
payments[].kindstringnoKind: topup, membership, booking, other (anything else becomes other)
length up to 12; default "topup"

Example request

curl -X POST "https://your-server/api/v1/integrations/1c/payments" \
  -H "X-1C-Token: <1C token>" \
  -H "Content-Type: application/json" \
  -d '{
  "payments": [
    {
      "ext_id": "00-000123",
      "phone": "+79000000001",
      "amount": 3500,
      "paid_at": "2026-10-02T10:15:00+03:00",
      "purpose": "Court booking",
      "kind": "booking"
    }
  ]
}'

Responses

CodedetailMeaning
200—Success; example below
401bad_1c_tokenInvalid 1C token or the integration is disabled
422[…]Parameter or body validation error: detail is a list of errors

Example response

{
  "ok": true,
  "applied": 1,
  "unmatched": 1,
  "duplicate": 0,
  "rejected": 0,
  "items": [
    {
      "ext_id": "00-000123",
      "phone": "+79000000001",
      "amount": 3500,
      "kind": "booking",
      "purpose": "Court booking",
      "paid_at": "2026-10-02T10:15:00+03:00",
      "status": "applied",
      "error": "",
      "user_id": "3d6e9a10-5b2c-4f8e-a1d7-6c4b2e0f9a83",
      "applied_at": "2026-10-02T07:15:04+00:00",
      "result": "applied"
    },
    {
      "ext_id": "00-000124",
      "phone": "+79000000002",
      "amount": 2000,
      "kind": "topup",
      "purpose": "",
      "paid_at": "2026-10-02T10:20:00+03:00",
      "status": "unmatched",
      "error": "no_user_with_phone",
      "user_id": null,
      "applied_at": null,
      "result": "unmatched"
    }
  ]
}

List payments (reconciliation) #

GET/v1/integrations/1c/payments

Access: 1C token Header X-1C-Token: <1C token>.

Payments received by the cloud, newest first, for reconciliation with 1C. Filters: status (applied, unmatched, rejected), since — received at or after this time, limit — 1 to 1000 (200 by default).

Query parameters

NameTypeRequiredDescription
statusstringnoStatus filter: applied, unmatched, rejected
sincestring (date-time)noReceived at or after (ISO 8601)
limitintegernoHow many rows to return
min 1; max 1000; default 200

Headers

NameTypeRequiredDescription
X-1C-Tokenstringyes1C integration token

Example request

curl -X GET "https://your-server/api/v1/integrations/1c/payments?status=unmatched&since=2026-10-01T00:00:00%2B03:00&limit=200" \
  -H "X-1C-Token: <1C token>"

Responses

CodedetailMeaning
200—Success; example below
401bad_1c_tokenInvalid 1C token or the integration is disabled
422[…]Parameter or body validation error: detail is a list of errors

Example response

{
  "items": [
    {
      "ext_id": "00-000124",
      "phone": "+79000000002",
      "amount": 2000,
      "kind": "topup",
      "purpose": "",
      "paid_at": "2026-10-02T10:20:00+03:00",
      "status": "unmatched",
      "error": "no_user_with_phone",
      "user_id": null,
      "applied_at": null
    }
  ]
}

Re-match unmatched payments #

POST/v1/integrations/1c/payments/retry

Access: 1C token Header X-1C-Token: <1C token>.

Looks up players again for all unmatched payments and credits those found. Use it after players have signed up in the app. No body.

Headers

NameTypeRequiredDescription
X-1C-Tokenstringyes1C integration token

Example request

curl -X POST "https://your-server/api/v1/integrations/1c/payments/retry" \
  -H "X-1C-Token: <1C token>"

Responses

CodedetailMeaning
200—Success; example below
401bad_1c_tokenInvalid 1C token or the integration is disabled
422[…]Parameter or body validation error: detail is a list of errors

Example response

{"ok": true, "checked": 3, "applied": 1}