ドキュメントを参照

API

バウチャー

Issue, verify, and atomically redeem approved vouchers independently of Wallet.

認証: Authorization: Bearer sbot_…

POST/api/v1/bots/vouchers/issue
Bot Token

issueIssue a voucher

Issue one voucher from an active template to a user in an accessible private chat.

  • Headers: Authorization: Bearer sbot_... and unique Idempotency-Key; requires vouchers:issue
  • Required: template_id, external_issue_id, and chat_id; optional notify_user
  • Retries with the same external issue ID or idempotency key return the original result
POST/api/v1/bots/vouchers/verify
Bot Token

verifyVerify a voucher

Verify a QR token or six-character code within the current bot scope.

  • Requires vouchers:verify; body: credential: { type: "qr_token" | "redeem_code", value }
  • Voucher codes ignore case, spaces, and hyphens; no user private data is returned
POST/api/v1/bots/vouchers/redeem
Bot Token

redeemRedeem a voucher

Atomically redeem a voucher with a conditional update to prevent double spending.

  • A unique Idempotency-Key header is required; requires vouchers:redeem
  • Required: credential and external_order_id; optional store_id, operator_id, and occurred_at
  • Retries return the original result; reusing a key for a different request returns 409