SumoRouter
SumoRouter Customer API

Billing

Server

Credit top-ups (QRIS via Sumopod), coupon redemption and history.


Get top-up configuration

GET
https://ai.brandkamu.id
/api/billing/config

Public. Whether top-ups are available, the IDR→USD rate and the allowed amount range.

Get top-up configuration › Responses

200

Configuration.

enabled
​boolean · required

Top-ups can be created.

idr_per_usd
​integer · int64 · required

Rupiah per 1 USD of credit.

min_topup_idr
​integer · int64 · required
max_topup_idr
​integer · int64 · required
payment_method
​string · required

List top-ups

GET
https://ai.brandkamu.id
/api/billing/topups

The user's top-ups, newest first. pending is the latest unpaid top-up regardless of page (poll it while the user pays); completed counts paid top-ups — when it grows, refresh the balance.

List top-ups › query Parameters

limit
​integer · min: 1 · max: 100
Default: 20
offset
​integer · min: 0
Default: 0

List top-ups › Responses

A page of top-ups.

​Topup[] · required
total
​integer · int64 · required
​Topup | null · required

Latest pending top-up, whatever page is shown.

completed
​integer · int64 · required

Paid top-ups in total.


Create a top-up

POST
https://ai.brandkamu.id
/api/billing/topups

Starts a QRIS payment for amount_idr (within min_topup_idr–max_topup_idr from the config). Credit is amount_idr × 1e9 / idr_per_usd nano-USD, fixed at creation. Show payment_link_url or payment_code (the QRIS payload) to the user, then poll GET /api/billing/topups/{order_id} until status is completed, failed or expired. Credit is added when the payment provider confirms the payment.

Create a top-up › Request Body

amount_idr
​integer · int64 · required

Amount in whole Indonesian Rupiah.

Create a top-up › Responses

The pending top-up with payment details.

order_id
​string · required
amount_idr
​integer · int64 · required

Amount paid, whole Rupiah.

credit_nano
​integer · int64 · required

Credit added when paid, nano-USD.

status
​string · enum · required
Enum values:
pending
completed
failed
expired
payment_link_url
​string | null · uri · required

Hosted payment page.

payment_code
​string | null · required

QRIS payload to render as a QR code.

paid_at
​string | null · date-time · required
created_at
​string · date-time · required

Get a top-up

GET
https://ai.brandkamu.id
/api/billing/topups/{order_id}

One of the user's top-ups by order id; poll this to follow a payment.

Get a top-up › path Parameters

order_id
​string · required

Get a top-up › Responses

The top-up.

order_id
​string · required
amount_idr
​integer · int64 · required

Amount paid, whole Rupiah.

credit_nano
​integer · int64 · required

Credit added when paid, nano-USD.

status
​string · enum · required
Enum values:
pending
completed
failed
expired
payment_link_url
​string | null · uri · required

Hosted payment page.

payment_code
​string | null · required

QRIS payload to render as a QR code.

paid_at
​string | null · date-time · required
created_at
​string · date-time · required

Redeem a coupon code

POST
https://ai.brandkamu.id
/api/billing/redeem

Adds the coupon's credit to the balance. Codes are case-insensitive (4–32 characters of A–Z 0–9 - _). Each code can be redeemed once per user. Unknown, inactive and expired codes all return the same 400. Limited to 5 attempts per user (20 per IP) per minute.

Redeem a coupon code › Request Body

code
​string · required

Redeem a coupon code › Responses

Redeemed.

credit_nano
​integer · int64 · required

Credit added, nano-USD.

balance_nano
​integer · int64 · required

New balance, nano-USD.


List redeemed coupons

GET
https://ai.brandkamu.id
/api/billing/redemptions

The user's redeemed coupons, newest first (up to 100).

List redeemed coupons › Responses

Redemptions.

code
​string · required
credit_nano
​integer · int64 · required

nano-USD.

created_at
​string · date-time · required