UdhaarBill 数据 API:GST 发票与赊欠余额
Khatabook Credit Account Book 是 Collibet India 面向印度杂货店、服装商和其他仍用纸质赊账本记顾客 udhaar 的中小商户推出的电子 khata 与 GST 开票应用。Play 上的包名为 com.udhaarbill,客户端内部品牌为 Billy,用客户与供应商台账、GST/非 GST 发票、带 HSN 编码与计量单位的商品目录、WhatsApp 催款模板、账单上的 UPI 收款码以及蓝牙热敏小票,取代传统 bahi-khata。账本首先落在加密的本机数据库,断网也能建往来户和开发票;Google 登录后解锁云备份、多设备同步、分析(头名欠款户、回款效率、GST 汇总、收款方式结构)以及催款模板,作为经 Razorpay 付费的 Premium 方案。店铺资料页保存 logo、签名、GSTIN 与发票前缀,生成的 PDF 可直接分享;界面提供英语及印地语、孟加拉语、古吉拉特语、卡纳达语、马拉雅拉姆语、马拉地语、奥里亚语、旁遮普语、泰米尔语、泰卢固语等十种印度语言。它与 Khatabook、OkCredit、Vyapar、myBillBook 同处中小商户开票赛道,面向想用手机赊账本、而不是桌面版 Tally 的店主。
Khata 上的往来欠款把 balance_due 与 outstanding_amount 记在 customer_gstin 名下,GST 账单则带 invoice_number、gst_total 以及行级 hsn_code。云同步在设备之间复制这些台账行;Razorpay Checkout 随后翻转 is_premium 与 premium_expiry,备份、分析与催款模板才保持开通。催收看板、GSTR-1 工作簿和第二台开票柜台读的都是同一套往来与发票字段。openData Studio 把这套接口变成可调用的开放数据。
应用截图
API 端点一览
以下端点与请求/响应示例均依据应用界面推导重构,为示意说明,并非实际抓包。
用 Google id_token 登录
POST
/v1/sessions/exchangeosint用 Google Sign-In 的 id_token 换取商户会话,供资料、设备、同步与 Razorpay 调用使用。返回的 auth_token 就是之后每个请求携带的 Bearer 值。
认证方式: 无需预登录。请求体携带 Google Sign-In 的 id_token;响应中的 auth_token 在后续调用中作为 Authorization: Bearer 发送,并附带 X-App-Version。
- id_token
- device_id
- auth_token
- refreshToken
- uid
- displayName
- is_premium
- premium_expiry
POST /v1/sessions/exchange HTTP/1.1 Content-Type: application/json X-App-Version: 1.1.2 { "id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Imdvb2dsZS1leCJ9.example", "device_id": "a1b2c3d4e5f6" }{ "auth_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example", "refreshToken": "rt_7c11ab", "uid": "usr_9f2a", "email": "[email protected]", "displayName": "Ramesh Kirana", "is_premium": false, "premium_expiry": null }读取已登录商户资料
GET
/v1/merchant/shop-profileosint返回设置页展示的已登录商户卡片:店铺身份、GSTIN、UPI id、会员标志与最近一次成功的云同步时间。
认证方式: Authorization: Bearer <auth_token>,来自 POST /v1/sessions/exchange,并附带 X-App-Version。
- uid
- displayName
- shop_name
- shop_phone
- shop_address
- gstin
- upi_id
- is_premium
- premium_expiry
- last_sync_at
GET /v1/merchant/shop-profile HTTP/1.1 Authorization: Bearer <auth_token> X-App-Version: 1.1.2{ "uid": "usr_9f2a", "email": "[email protected]", "displayName": "Ramesh Kirana", "shop_name": "Ramesh Kirana Store", "shop_phone": "9876543210", "shop_address": "12 MG Road, Pune", "gstin": "27AABCU9603R1ZX", "upi_id": "ramesh@okaxis", "is_premium": true, "premium_expiry": "2027-03-14T00:00:00Z", "last_sync_at": "2026-10-17T08:12:00Z" }登记设备、FCM 令牌与 Play Integrity
POST
/v1/account/devicesosint绑定存放本机账本的手机:FCM 用于催款与同步提醒推送,Play Integrity 用于设备证明,device_id 供后续同步调用使用。
认证方式: Authorization: Bearer <auth_token>。请求体携带 Play Integrity 设备证明令牌,以及设备的 FCM 推送令牌。
- device_id
- device_name
- device_model
- fcm_token
- integrityToken
- status
- syncDeviceTelemetry
POST /v1/account/devices HTTP/1.1 Authorization: Bearer <auth_token> Content-Type: application/json X-App-Version: 1.1.2 { "device_id": "a1b2c3d4e5f6", "device_name": "Pixel 7", "device_model": "GP4BC", "fcm_token": "fcm-ex-44120", "integrityToken": "PI_TOKEN_EXAMPLE" }{ "device_id": "a1b2c3d4e5f6", "status": "REGISTERED", "syncDeviceTelemetry": true }退出商户会话
POST
/v1/sessions/revokeosint从设置页的退出登录项结束 Google 会话,并解除设备绑定,停止 FCM 催款推送。
认证方式: Authorization: Bearer <auth_token>,来自 POST /v1/sessions/exchange。
- device_id
- status
- uid
POST /v1/sessions/revoke HTTP/1.1 Authorization: Bearer <auth_token> X-App-Version: 1.1.2 Content-Type: application/json { "device_id": "a1b2c3d4e5f6" }{ "status": "SIGNED_OUT", "uid": "usr_9f2a" }推送本机 khata、发票与商品目录
POST
/v1/ledger/changesopenfinance把本机账本中未同步的行(客户、发票、明细、商品与收款)上传,供 Premium 云备份在另一台设备上恢复。
认证方式: Authorization: Bearer <auth_token>。需要 Premium 云同步权益(is_premium);免费模式只把行留在本机。
- device_id
- customer_id
- customer_name
- customer_phone
- customer_gstin
- is_supplier
- outstanding_amount
- invoice_number
- due_date
- subtotal
- gst_percent
- gst_amount
- gst_total
- total_amount
- paid_amount
- balance_due
- hsn_code
- qty
- rate
- is_synced
- last_sync_at
- hasUnsyncedChanges
POST /v1/ledger/changes HTTP/1.1 Authorization: Bearer <auth_token> Content-Type: application/json X-App-Version: 1.1.2 { "device_id": "a1b2c3d4e5f6", "customers": [ { "customer_id": "c-88a1", "customer_name": "Mona Traders", "customer_phone": "9876501234", "customer_gstin": "27AAPCM1234F1Z5", "customer_address": "Lane 4, Camp, Pune", "is_supplier": false, "outstanding_amount": 12500.0, "is_synced": false, "updated_at": "2026-10-17T07:40:00Z" } ], "invoices": [ { "invoice_id": "inv-441", "invoice_number": "KB-2026-0441", "invoice_date": "2026-10-16", "due_date": "2026-10-30", "customer_id": "c-88a1", "subtotal": 11800.0, "discount_percent": 0, "discount_amount": 0, "gst_percent": 18, "gst_amount": 2124.0, "gst_total": 2124.0, "total_amount": 13924.0, "paid_amount": 1424.0, "balance_due": 12500.0, "is_gst": true, "status": "pending", "payment_method": "upi", "is_synced": false } ], "invoice_items": [ { "invoice_id": "inv-441", "product_id": "p-ata-1", "product_name": "Ashirvaad Atta 10kg", "hsn_code": "1101", "qty": 4, "rate": 2950.0, "gst_percent": 18, "gst_amount": 2124.0 } ], "products": [], "payments": [] }{ "status": "ACCEPTED", "hasUnsyncedChanges": false, "last_sync_at": "2026-10-17T08:12:00Z", "synced": { "customers": 1, "invoices": 1, "invoice_items": 1, "products": 0, "payments": 0 } }拉取云端 khata 快照
GET
/v1/ledger/snapshotopenfinance在 Google 登录或“从云端恢复”之后下载云端账本,包括店铺 GST 设置,以及填充首页、客户与发票页的客户 / 发票 / 商品行。
认证方式: Authorization: Bearer <auth_token>。与 /v1/ledger/changes 相同的 Premium 云同步门槛。
- last_sync_at
- shop_name
- gstin
- invoice_prefix
- invoice_counter
- default_gst_rate
- customers
- outstanding_amount
- invoices
- invoice_number
- balance_due
- gst_total
- products
- hsn_code
- rate
- payments
GET /v1/ledger/snapshot?device_id=a1b2c3d4e5f6&last_sync_at=2026-10-16T18:00:00Z HTTP/1.1 Authorization: Bearer <auth_token> X-App-Version: 1.1.2{ "last_sync_at": "2026-10-17T08:12:00Z", "shop_name": "Ramesh Kirana Store", "gstin": "27AABCU9603R1ZX", "invoice_prefix": "KB", "invoice_counter": 441, "default_gst_rate": 18, "customers": [ { "customer_id": "c-88a1", "customer_name": "Mona Traders", "customer_phone": "9876501234", "customer_gstin": "27AAPCM1234F1Z5", "is_supplier": false, "outstanding_amount": 12500.0, "is_synced": true } ], "invoices": [ { "invoice_id": "inv-441", "invoice_number": "KB-2026-0441", "balance_due": 12500.0, "gst_total": 2124.0, "status": "pending", "is_gst": true } ], "products": [ { "product_id": "p-ata-1", "product_name": "Ashirvaad Atta 10kg", "hsn_code": "1101", "rate": 2950.0, "gst_percent": 18 } ], "payments": [] }读取 Razorpay 结账配置
GET
/v1/premium/checkout-configopenbanking返回升级页在创建订单前喂给 Checkout 的 Razorpay key 与 Premium 套餐金额。
认证方式: Authorization: Bearer <auth_token>。在 Premium 升级页打开 Razorpay Checkout 之前调用。
- key_id
- currency
- name
- description
- theme_color
- plan_id
- amount
- period
GET /v1/premium/checkout-config HTTP/1.1 Authorization: Bearer <auth_token> X-App-Version: 1.1.2{ "key_id": "rzp_test_<key_id>", "currency": "INR", "name": "UdhaarBill Premium", "description": "Cloud backup, analytics, reminder templates", "theme_color": "#0783B4", "plans": [ { "plan_id": "premium_annual", "amount": 99900, "currency": "INR", "period": "yearly" } ] }创建 Razorpay Premium 订单
POST
/v1/premium/ordersopenbanking创建 Checkout 弹层要扣款的 Razorpay 订单;付款后把 order_id 回传到校验调用。
认证方式: Authorization: Bearer <auth_token>,来自 POST /v1/sessions/exchange。
- plan_id
- order_id
- amount
- currency
- receipt
- status
POST /v1/premium/orders HTTP/1.1 Authorization: Bearer <auth_token> Content-Type: application/json X-App-Version: 1.1.2 { "plan_id": "premium_annual", "amount": 99900, "currency": "INR" }{ "order_id": "order_N7example", "amount": 99900, "currency": "INR", "receipt": "ub-prem-usr_9f2a", "status": "created" }校验 Razorpay 支付并解锁 Premium
POST
/v1/premium/confirmationsopenbanking在服务端确认 Checkout 签名,并将 is_premium 置为真,从而解锁云同步、分析与催款模板。校验失败时升级页会显示支付错误。
认证方式: Authorization: Bearer <auth_token>。请求体为 Checkout 成功回调载荷(razorpay_order_id、razorpay_payment_id、razorpay_signature)。
- razorpay_order_id
- razorpay_payment_id
- razorpay_signature
- status
- is_premium
- premium_expiry
- subscriptionActiveUntil
POST /v1/premium/confirmations HTTP/1.1 Authorization: Bearer <auth_token> Content-Type: application/json X-App-Version: 1.1.2 { "razorpay_order_id": "order_N7example", "razorpay_payment_id": "pay_N8example", "razorpay_signature": "a1b2c3d4e5f6signature" }{ "status": "VERIFIED", "is_premium": true, "premium_expiry": "2027-10-17T00:00:00Z", "subscriptionActiveUntil": "2027-10-17T00:00:00Z" }
数据类别
- 往来户
- 发票
- GST
- 库存目录
- 收款
- 同步
数据使用场景与案例
从 khata 排出应收账款催收队列
催收机器人读取已同步往来行上的 outstanding_amount、balance_due、due_date 与 customer_phone,然后发出店主在客户详情页同一套 WhatsApp 催款,无需重录账本。
按发票明细准备 GST 申报
会计师工作簿按 is_gst 发票拼接 invoice_number、customer_gstin、hsn_code、gst_percent、gst_amount 与 gst_total,使 GSTR-1 明细与店里已分享的 PDF 一致。
多柜台共用目录价目表
第二台开票柜台在云同步拉取之后读取目录中的 product_name、hsn_code、rate 与 gst_percent,HSN 与 GST% 与店主手机保持一致。
Razorpay 之后核对 Premium 权益
计费运营用 razorpay_payment_id、razorpay_order_id 对照 is_premium 与 premium_expiry,确认云同步席位而无需打开升级页。
常见问题
应用如何鉴权商户?
Google 登录签发 id_token,由 POST /v1/sessions/exchange 换成 auth_token 与 refreshToken。之后的调用携带 Authorization: Bearer 和 X-App-Version。POST /v1/account/devices 再绑定 device_id、fcm_token 与 Play Integrity 令牌。
哪些字段描述客户的赊欠余额?
已同步的往来行提供 customer_name、customer_phone、customer_gstin、is_supplier、outstanding_amount;每张发票上还有 balance_due、paid_amount、due_date 与 status(pending、paid、overdue)。
GST 发票如何表示?
每张发票含 invoice_number、is_gst、gst_percent、gst_amount、gst_total、subtotal 与 total_amount。明细行补充 hsn_code、qty、rate 与 product_name。店铺缺省为 gstin、default_gst_rate、invoice_prefix 与 invoice_counter。
Razorpay 解锁了什么?
GET /v1/premium/checkout-config 与 POST /v1/premium/orders 启动 Checkout;POST /v1/premium/confirmations 返回 is_premium 与 premium_expiry,用于把守 POST /v1/ledger/changes 与 GET /v1/ledger/snapshot 云备份。
与 Khatabook Credit Account Book 相似的应用
- Khatabook — Khatabook 是面向印度小微商户的电子账本,用来记借贷、收 UPI 与二维码付款,并自动发出带收款链接的催款提醒。
- OkCredit — OkCredit 是给印度店主用的无纸化赊账本(udhar bahi-khata),在手机上记录顾客赊欠与还款,并通过 WhatsApp 和短信发送催款提醒。
- Vyapar Invoice GST Billing App — Vyapar 是面向印度中小商户的 GST 开票、记账与库存应用,可开具税务发票、跟踪存货与回款,并在手机与桌面端之间同步账本。
- myBillBook Invoice Billing App — myBillBook 是面向印度小企业的 GST 开票软件,可开具带 HSN/SAC 编码的 GST 与非 GST 发票、管理库存,并通过 WhatsApp 或短信发送带 UPI 链接的催款。
- TallyPrime — TallyPrime 是 Tally Solutions 面向印度企业的经营管理软件,以桌面端为主,覆盖账簿、GST 发票与申报、库存以及联网银行业务。
- Zoho Books — Zoho Books 是 Zoho 面向印度企业的 GST 合规云会计产品,通过网页与移动应用覆盖开票、电子发票、库存、银行对账和 GST 申报。
- Swipe — Swipe 是面向印度中小企业的 GST 开票、收银与库存软件,可开具发票和报价单、通过 WhatsApp 分享账单,并记录入库与出库。
- BUSY — BUSY 是面向印度中小微企业的会计与 GST 开票软件,覆盖发票、库存、电子发票和电子运单,并提供可开报价、订单与发票的手机应用。
相关主题
- udhaarbill api
- billy khata
- GST 发票字段
- balance_due
- customer_gstin
- hsn_code
- razorpay 会员
- 印度中小商户开票
需要集成这个 App 的数据 API?
我们可为任意指定 App 交付定制集成——源码交付 USD 500 起,或托管 API 按调用计费。告诉我们您需要的数据即可。
- 每个项目均签 NDA 与 SOW
- 3–7 天交付
- 验收通过后才付款
- 仅在授权范围内作业