OkCredit 商户账本与 UPI 收款数据 API
OkCredit: Ledger, UPI, Billing 是总部位于班加罗尔的 OkCredit Technologies Pvt. Ltd. 推出的安卓数字账本(khata),面向仍用纸质 bahi 记录客户赊账(udhaar)与供应商应付款的印度小杂货店(kirana)、批发商及其他中小微企业。商户用手机号 OTP 登录,之后即可使用:客户到期总览首页、按往来方划分的信用账本(含收/付记录与收据照片)、WhatsApp 或短信催收提醒、UPI 收款链接与二维码、供应商赊账标签页、账户对账单 PDF、带 UPI VPA 的店铺资料,以及可选的应用锁。账本采用离线优先、保存在本地,因此添加往来方或交易无需网络,手机重新联网后再同步到云端。界面除英语外还提供印地语、马拉地语、古吉拉特语、旁遮普语、泰米尔语、泰卢固语、卡纳达语、马拉雅拉姆语和孟加拉语等印度语言。它与 Khatabook、Vyapar、myBillBook 同属中小微企业信用账本赛道,面向想要一本装在手机里的账本、而不是桌面端 Tally 方案的店主。
客户账本行在每个往来方上带有 balanceV2 与 lastPayment,收/付记录则携带 amountV2、billDate,当记录来自收款时还带有可选的 collectionId。收款对象再补充 payment_link、amount_requested 与 amount_collected 的对比、UPI UTR,以及用于结算的商户 payment_address;供应商赊账沿用同样的结构,带 balance、payment 与 bill_date。
营运资金授信方据这些余额计算赊账账龄,支付运营把收款 UTR 同当前 VPA 对账,分销商把供应商应付款同店铺自身记录比对结清,会计师则归档对账单 reportUrl。openData Studio 将这一数据面变成可调用的开放数据。
应用截图
API 端点一览
以下端点与请求/响应示例均依据应用界面推导重构,为示意说明,并非实际抓包。
请求商户登录 OTP
POST
/v1/khata-login/otp-sendosint启动输入 OTP 界面所用的商户 OTP 登录。返回 otp_id(以及可选的 otp_key),供后续验证验证码时附带。
认证方式: 未认证的引导调用。请求体携带 mode 与商户手机号;响应中的 otp_id 用于验证,随后用于 POST /v1/khata-login/token-exchange。
- mode
- mobile
- otp_id
- otp
- otp_key
POST /v1/khata-login/otp-send HTTP/1.1 Content-Type: application/json { "mode": "SMS", "mobile": "9876543210" }{ "otp_id": "otp_7c11ab", "otp": null, "otp_key": "ok_9f2a" }认证并签发访问令牌
POST
/v1/khata-login/token-exchangeosint开启已登录的商户会话。access_token 是附加在之后每个账本、收款、应付款与奖励请求上的 Bearer 值。
认证方式: 未认证的引导调用。请求体为 grant_type 加 username/password、refresh_token 或 assertion;响应中的 access_token 在之后的账本、收款、应付款与奖励调用中以 Authorization: Bearer 发送。
- grant_type
- username
- password
- refresh_token
- assertion
- access_token
- expires_in
- new_user
- mobile
POST /v1/khata-login/token-exchange HTTP/1.1 Content-Type: application/json { "grant_type": "password", "username": "9876543210", "password": "••••••••", "refresh_token": null, "assertion": null }{ "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.example", "refresh_token": "rt_7c11ab", "expires_in": 3600, "new_user": false, "mobile": "9876543210" }读取已登录商户的资料
GET
/v1/shop/profileosint返回资料页显示的店铺名片:商户 id、联系人姓名、手机号、带经纬度的地址、简介文字与头像。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。
- id
- name
- conatctName
- mobile
- address
- addressLatitude
- addressLongitude
- about
- profileImage
- createdAt
GET /v1/shop/profile HTTP/1.1 Authorization: Bearer <access_token>{ "id": "mrc_9f2a", "name": "Ramesh Kirana", "conatctName": "Ramesh Patel", "mobile": "9876543210", "email": "[email protected]", "address": "12 MG Road, Pune", "addressLatitude": 18.5204, "addressLongitude": 73.8567, "about": "Daily grocery and provisions", "profileImage": "https://files.example.com/receipts/mrc_9f2a.jpg", "createdAt": "2024-03-12T08:10:00.000Z" }列出客户账本往来方
GET
/v1/ledger/partiesopenfinance分页提供首页客户列表:每个往来方的 description、以派萨计的 balanceV2、lastPayment、reminderMode,以及交易提醒是否开启。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。查询参数 mobile 按手机号过滤;deleted 包含已停用的往来方。
- id
- userId
- mobile
- description
- balance
- balanceV2
- transactionCount
- lastActivity
- lastPayment
- accountUrl
- reminderMode
- txnAlertEnabled
- lang
- registered
- status
GET /v1/ledger/parties?mobile=&deleted=false HTTP/1.1 Authorization: Bearer <access_token>[ { "id": "cust_11ab", "userId": "usr_7c11", "mobile": "9123456780", "description": "Suresh Provision", "balance": -2450.0, "balanceV2": -245000, "transactionCount": 18, "lastActivity": "2026-10-18T11:04:00.000Z", "lastPayment": "2026-10-12T09:22:00.000Z", "accountUrl": "https://khata.example.com/p/cust_11ab", "profileImage": null, "address": "Lane 4, Camp, Pune", "email": null, "registered": true, "txnAlertEnabled": true, "lang": "hi", "reminderMode": "whatsapp", "status": 1, "txnStartTime": 1710230400000, "createdAt": "2024-03-12T08:20:00.000Z", "updatedAt": "2026-10-18T11:04:00.000Z" } ]读取单个客户账本
GET
/v1/ledger/parties/{party_id}openfinance加载客户资料与对账单表头:未结 balanceV2、lastPayment、reminderMode 以及可分享的 accountUrl。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。路径中的 party_id 是在客户界面打开的客户。
- id
- mobile
- description
- balanceV2
- transactionCount
- lastPayment
- accountUrl
- address
- reminderMode
- txnAlertEnabled
GET /v1/ledger/parties/cust_11ab HTTP/1.1 Authorization: Bearer <access_token>{ "id": "cust_11ab", "userId": "usr_7c11", "mobile": "9123456780", "description": "Suresh Provision", "balance": -2450.0, "balanceV2": -245000, "transactionCount": 18, "lastActivity": "2026-10-18T11:04:00.000Z", "lastPayment": "2026-10-12T09:22:00.000Z", "accountUrl": "https://khata.example.com/p/cust_11ab", "profileImage": null, "address": "Lane 4, Camp, Pune", "email": null, "registered": true, "txnAlertEnabled": true, "lang": "hi", "reminderMode": "whatsapp", "status": 1, "createdAt": "2024-03-12T08:20:00.000Z", "updatedAt": "2026-10-18T11:04:00.000Z" }添加客户往来方
POST
/v1/ledger/partiesopendata在添加客户界面根据手机号、显示名称与可选头像创建(或重新激活)一位客户。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。
- mobile
- desc
- reactivate
- profileImage
- id
- description
- balanceV2
- registered
POST /v1/ledger/parties HTTP/1.1 Authorization: Bearer <access_token> Content-Type: application/json { "mobile": "9988776655", "desc": "Meena Fancy Store", "reactivate": false, "profileImage": null }{ "id": "cust_22cd", "mobile": "9988776655", "description": "Meena Fancy Store", "balanceV2": 0, "transactionCount": 0, "registered": false, "status": 1, "createdAt": "2026-10-20T06:40:00.000Z" }列出客户账本交易
GET
/v1/ledger/entriesopenfinance返回客户对账单的收/付记录行:以派萨计的 amountV2、type、note、receiptUrl,以及该记录来自 UPI 收款时可选的 collectionId。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。查询参数 customer_id 加上对账单同步所用的 after/before 纪元时间窗口。
- id
- customerId
- amount
- amountV2
- type
- note
- receiptUrl
- collectionId
- billDate
- createdByCustomer
- isDeleted
GET /v1/ledger/entries?customer_id=cust_11ab&after=1727740800000&before=1761004799000 HTTP/1.1 Authorization: Bearer <access_token>[ { "id": "txn_88ef", "customerId": "cust_11ab", "amount": 500.0, "amountV2": 50000, "type": 1, "note": "Rice 10kg", "receiptUrl": "https://files.example.com/receipts/txn_88ef.jpg", "collectionId": null, "billDate": "2026-10-18T00:00:00.000Z", "createdAt": "2026-10-18T11:04:00.000Z", "updatedAt": "2026-10-18T11:04:00.000Z", "createdByCustomer": false, "isDeleted": false, "deletedByCustomer": false, "isOnboarding": false } ]提交一笔收/付记录
POST
/v1/ledger/entriesopenfinance从添加交易界面写入一笔赊账或收款。requestId 是幂等键;smsSent 记录是否已发出提醒短信。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。
- customerId
- requestId
- type
- amountV2
- receiptUrl
- note
- timestamp
- isOnboarding
- billDate
- smsSent
POST /v1/ledger/entries HTTP/1.1 Authorization: Bearer <access_token> Content-Type: application/json { "customerId": "cust_11ab", "requestId": "req_3a91", "type": 1, "amountV2": 50000, "receiptUrl": "https://files.example.com/receipts/txn_new.jpg", "note": "Rice 10kg", "timestamp": "2026-10-18T11:04:00.000Z", "isOnboarding": false, "billDate": "2026-10-18T00:00:00.000Z", "smsSent": true }生成账户对账单 PDF
GET
/v1/ledger/statements/pdfopendata生成商户全局的账户对账单 PDF(从账户对账单界面分享),并返回带签名的 reportUrl。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。查询参数 after/before 限定对账单的时间窗口。
- after
- before
- reportUrl
GET /v1/ledger/statements/pdf?after=1727740800000&before=1761004799000 HTTP/1.1 Authorization: Bearer <access_token>{ "reportUrl": "https://files.example.com/receipts/AccountStatement_mrc_9f2a_2026-10.pdf" }列出 UPI 收款请求
GET
/v1/payments/requestsopenbanking列出收款历史行:请求金额与已收金额(派萨)、payment_link、UPI UTR 以及商户出款目的地。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。查询参数 customer_id 将范围限定到一个往来方;after 为游标。
- id
- status
- payment_link
- amount_requested
- amount_collected
- fee
- customer_id
- UTR
- payment_address
- settlement_category
GET /v1/payments/requests?customer_id=cust_11ab&after=1727740800000 HTTP/1.1 Authorization: Bearer <access_token>[ { "id": "col_55aa", "create_time": "2026-10-12T09:20:00.000Z", "update_time": "2026-10-12T09:22:10.000Z", "status": 2, "payment_link": "https://pay.example.com/c/col_55aa", "amount_requested": 245000, "amount_collected": 245000, "fee": 0, "expire_time": "2026-10-19T09:20:00.000Z", "customer_id": "cust_11ab", "discount": 0, "fee_category": 0, "settlement_category": 1, "merchantName": "Ramesh Kirana", "payment": { "provider": "upi", "id": "pay_91bb", "UTR": "AXSK261012091234", "reference": "col_55aa", "status": 2, "amount": 245000, "payment_link": "https://pay.example.com/c/col_55aa" }, "payout": { "provider": "upi", "id": "po_12cc", "UTR": "HDFC261012091300", "status": 2, "amount": 245000, "destination": { "mobile": "9876543210", "name": "Ramesh Patel", "payment_address": "ramesh@okaxis", "type": "UPI" } } } ]创建收款付款链接
POST
/v1/payments/requests/batchopenbanking在收款界面为一位或多位到期客户生成 UPI 收款链接,商户可分享 payment_link 或二维码。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。
- merchant_id
- customer_id
- id
- status
- payment_link
- amount_requested
- merchantName
POST /v1/payments/requests/batch HTTP/1.1 Authorization: Bearer <access_token> Content-Type: application/json { "merchant_id": "mrc_9f2a", "requests": [ {"customer_id": "cust_11ab"}, {"customer_id": "cust_22cd"} ] }[ { "id": "col_55aa", "status": 1, "payment_link": "https://pay.example.com/c/col_55aa", "amount_requested": 245000, "amount_collected": null, "customer_id": "cust_11ab", "merchantName": "Ramesh Kirana" } ]读取商户 UPI 收款资料
POST
/v1/payments/profileopenbanking返回当前生效的 UPI 目的地(payment_address、type),以及收款 UPI 界面所用的每位客户的 WhatsApp message_link、支付 link_intent 与 qr_intent。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。
- merchant_id
- payment_address
- type
- customer_id
- message_link
- message
- link_intent
- qr_intent
- show_image
POST /v1/payments/profile HTTP/1.1 Authorization: Bearer <access_token> Content-Type: application/json { "merchant_id": "mrc_9f2a" }{ "merchant_id": "mrc_9f2a", "destination": { "mobile": "9876543210", "name": "Ramesh Patel", "payment_address": "ramesh@okaxis", "type": "UPI" }, "customers": [ { "customer_id": "cust_11ab", "profile": { "customer_id": "cust_11ab", "message_link": "https://chat.example.com/send?to=919123456780", "message": "Namaste, aapka 2450 pending hai", "link_intent": "https://pay.example.com/c/col_55aa", "qr_intent": "upi://pay?pa=ramesh@okaxis&am=2450", "show_image": true } } ] }校验 UPI 收款地址
POST
/v1/payments/address/checkopenbanking在将添加/编辑 UPI 界面输入的 VPA 保存为出款目的地之前先行校验。valid 与注册姓名会显示在确认面板上。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。
- payment_address_type
- payment_address
- valid
- name
POST /v1/payments/address/check HTTP/1.1 Authorization: Bearer <access_token> Content-Type: application/json { "payment_address_type": "UPI", "payment_address": "ramesh@okaxis" }{ "valid": true, "name": "RAMESH PATEL" }列出供应商赊账往来方
GET
/v1/payables/vendorsopenfinance返回应付供应商标签页所用的供应商赊账往来方:名称、手机号、以派萨计的所欠余额以及 txn_alert_enabled。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。
- id
- name
- mobile
- address
- balance
- registered
- deleted
- txn_alert_enabled
- lang
- create_time
GET /v1/payables/vendors HTTP/1.1 Authorization: Bearer <access_token>{ "suppliers": [ { "id": "sup_44ee", "registered": true, "deleted": false, "name": "Patel Distributors", "create_time": "2024-06-01T10:00:00.000Z", "txn_start_time": 1717200000000, "mobile": "9811122233", "address": "Market Yard, Pune", "profile_image": null, "balance": 1800000, "txn_alert_enabled": true, "lang": "en" } ] }列出供应商赊账交易
GET
/v1/payables/entriesopenfinance分页返回供应商收/付记录:payment 标志、以派萨计的 amount、bill_date、receipt_url,以及该记录是否由供应商创建。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。查询参数 start_time/end_time 限定供应商对账单的时间窗口。
- id
- supplier_id
- collection_id
- payment
- amount
- note
- receipt_url
- bill_date
- created_by_supplier
- deleted
GET /v1/payables/entries?start_time=2026-09-01T00:00:00.000Z&end_time=2026-10-20T23:59:59.000Z HTTP/1.1 Authorization: Bearer <access_token>{ "transactions": [ { "id": "stxn_77aa", "supplier_id": "sup_44ee", "collection_id": null, "payment": true, "amount": 500000, "note": "Week 41 stock", "receipt_url": "https://files.example.com/receipts/stxn_77aa.jpg", "bill_date": "2026-10-10T00:00:00.000Z", "create_time": "2026-10-10T16:02:00.000Z", "created_by_supplier": false, "deleted": false, "deleted_by_supplier": false, "update_time": "2026-10-10T16:02:00.000Z" } ] }列出商户收款奖励
POST
/v1/incentives/searchopendata列出奖励界面显示的收款活动奖励:以派萨计的 amount、reward_type、status,以及领取时使用的 UPI 出款目的地。
认证方式: Authorization: Bearer <access_token>,来自 POST /v1/khata-login/token-exchange。
- merchant_id
- id
- status
- amount
- reward_type
- create_time
- payment_address
POST /v1/incentives/search HTTP/1.1 Authorization: Bearer <access_token> Content-Type: application/json { "merchant_id": "mrc_9f2a" }{ "rewards": [ { "id": "rwd_01", "create_time": "2026-10-01T08:00:00.000Z", "update_time": "2026-10-15T08:00:00.000Z", "status": 1, "amount": 10000, "reward_type": "collection", "payout": { "destination": { "payment_address": "ramesh@okaxis", "type": "UPI" } }, "events": [] } ] }
数据类别
- 商户资料
- 客户账本
- 交易
- UPI 收款
- 供应商赊账
- 账户对账单
- 奖励
数据使用场景与案例
面向营运资金授信的中小微企业赊账账龄
放款方或 B2B 先买后付(BNPL)系统拉取每个往来方的 balanceV2、lastPayment 与 transactionCount,再按 billDate 分页读取 amountV2 行,生成逾期天数分档,无需店主导出表格。
UPI 收款对账
支付运营机器人列出收款请求,把 payment.UTR 与 amount_collected 同商户 payment_address 的出款对上,并标出在 amount_collected 到账前就已过期的链接。
分销商的供应商应付款结账
ERP 将 sc/suppliers 的余额与 sc/transactions 的 payment/amount/bill_date 同步,让分销商看清小杂货店仍欠多少,以及店里已记为付款的金额。
会计师对账单归档
会计师事务所按 after/before 时间窗口取回 reportUrl,把账户对账单 PDF 与实时的客户、供应商账本一并归档。
常见问题
OkCredit 如何验证商户身份?
商户输入手机号,应用请求 OTP(mode 加 mobile),例如调用 POST /v1/khata-login/otp-send,再把验证通过的验证码在 POST /v1/khata-login/token-exchange 换成 access_token。之后的账本、收款、应付款与奖励调用都以 Authorization: Bearer 携带该令牌。
哪些字段记录客户的未结余额?
客户列表与单个客户读取都会返回 balance(旧版浮点数)和 balanceV2(以派萨为单位的长整型),首页到期总览还带有 lastPayment、transactionCount 与 reminderMode;例如 GET /v1/ledger/parties 与 GET /v1/ledger/parties/{party_id}。
UPI 收款是如何表示的?
每笔收款带有 payment_link、amount_requested、amount_collected、fee 以及嵌套的 payment.UTR,可单个列出,也可为多位到期客户批量生成。另有一个商户资料读取接口,返回当前的 destination.payment_address(UPI VPA)以及每位客户的 qr_intent / link_intent,例如位于 /v1/payments 之下。
供应商赊账与客户账本是如何并列建模的?
供应商往来方及其收/付记录与客户账本并列存在,例如 GET /v1/payables/vendors 与 GET /v1/payables/entries,带有 balance、payment、amount 与 bill_date,并与客户账本和收款调用使用同一个 Bearer 令牌。
与 OkCredit: Ledger, UPI, Billing 相似的应用
- Khatabook — Khatabook 是班加罗尔的金融科技数字账本,面向印度杂货店和其他中小微商户,用来记录顾客欠款以替代纸质账簿;Inc42 将其列为 OkCredit 的直接竞品。
- 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 开票、收银与库存应用,可开具 GST 与非 GST 发票、通过 WhatsApp 分享账单、用 UPI 或付款链接收款,并向 GST 门户提交电子发票和电子运单。
- BUSY — BUSY 是面向印度中小微企业的 GST 开票与会计软件,手机端可新建往来户、报价、订单和发票,并与桌面账套同步。
相关主题
- OkCredit API
- 数字账本
- 客户账本
- UPI 收款
- 供应商赊账
- balanceV2
- payment_address
- 中小微企业赊账
需要集成这个 App 的数据 API?
我们可为任意指定 App 交付定制集成——源码交付 USD 500 起,或托管 API 按调用计费。告诉我们您需要的数据即可。
- 每个项目均签 NDA 与 SOW
- 3–7 天交付
- 验收通过后才付款
- 仅在授权范围内作业