DocsAPI ReferencePayments
Payments & Credits API
Purchase verification credit packages through Xendit payment gateways.
GET /api/v1/payments/packages
Fetches all available deep analysis credit top-up packages.
GET/api/v1/payments/packages
Public package catalog.
Headers
| Parameter | Type | Requirement | Description |
|---|---|---|---|
| Authorization | string | Required | Bearer <access_token> |
Response Example (200 OK)
json/response.json
{"data": [{ "id": "pkg_starter", "name": "Starter", "credits": 20, "price_idr": 29000 },{ "id": "pkg_pro", "name": "Pro", "credits": 100, "price_idr": 99000 },{ "id": "pkg_ultra", "name": "Ultra", "credits": 500, "price_idr": 399000 }]}
POST /api/v1/payments/checkout
Creates a checkout invoice session and returns the Xendit payment URL.
POST/api/v1/payments/checkout
Initiates purchase invoice. User should be redirected to invoice_url.
Headers
| Parameter | Type | Requirement | Description |
|---|---|---|---|
| Authorization | string | Required | Bearer <access_token> |
| Content-Type | string | Required | application/json |
Body Parameters
| Parameter | Type | Requirement | Description |
|---|---|---|---|
| package_id | string | Required | Package identifier (e.g. 'pkg_starter', 'pkg_pro', 'pkg_ultra'). |
Response Example (200 OK)
json/response.json
{"session_id": "sess_880e8400-e29b-41d4-a716-446655440000","invoice_url": "https://checkout.xendit.co/web/66d0c1...","status": "PENDING"}
GET /api/v1/payments/credits
Retrieves the current available deep analysis credit balance for the account.
GET/api/v1/payments/credits
Requires JWT session auth.
Headers
| Parameter | Type | Requirement | Description |
|---|---|---|---|
| Authorization | string | Required | Bearer <access_token> |
Response Example (200 OK)
json/response.json
{"credit_balance": 120}
