ROBRION

API Documentation

Modular monolith Rust (Axum). Single binary serves API + SSR frontend. License API ported from robrion.net (Ed25519 + legacy JWT).

v0.1.0 Base URL: https://robrion.ai.id Raw OpenAPI JSON →

Autentikasi

Tiga skema, tergantung endpoint:

  • Session cookie — login via POST /api/v1/auth/login lalu kirim cookie session untuk endpoint commerce/admin.
  • X-Api-Key — RECEH: header X-Api-Key: robpay_… (fallback query ?api_key=).
  • Bearer — RECEH notify: Authorization: Bearer <notify_token> dari aplikasi HP merchant.
  • HMAC — RECEH webhook: header X-Signature / X-Timestamp / X-Nonce (HMAC-SHA256 atas timestamp.nonce.body).
  • License key — endpoint lisensi memakai key plaintext (SHA-256 di server) + device fingerprint.

Semua respons sukses berbentuk { "success": true, ... }; error berbentuk { "success": false, "error": "…" } dengan HTTP status yang sesuai.

health

GET/api/v1/openapi.json
Responses
KodeKeterangan
200this document
Contoh
curl -s https://robrion.ai.id/api/v1/openapi.json
GET/health/live
Responses
KodeKeterangan
200liveness
Contoh
curl -s https://robrion.ai.id/health/live
GET/health/ready
Responses
KodeKeterangan
200readiness + store counts
Contoh
curl -s https://robrion.ai.id/health/ready

catalog

GET/api/v1/catalog/plans
Parameters
NamaLokasiWajibTipe
productquerytidakstring
Responses
KodeKeterangan
200plans
Contoh
curl -s https://robrion.ai.id/api/v1/catalog/plans
GET/api/v1/catalog/products
Responses
KodeKeterangan
200product registry (KEISEI, RECEH, AKINAI, KHANSI)
Contoh
curl -s https://robrion.ai.id/api/v1/catalog/products
GET/api/v1/catalog/products/{key}
Parameters
NamaLokasiWajibTipe
keypathyastring: keisei | receh | akinai | khansi
Responses
KodeKeterangan
200product + plans
404not found
Contoh
curl -s https://robrion.ai.id/api/v1/catalog/products/receh
POST/api/v1/leads
Contoh
curl -s -X post https://robrion.ai.id/api/v1/leads \
  -H 'Content-Type: application/json' \
  -d '{}'

auth

POST/api/v1/auth/login
Contoh
curl -s -X post https://robrion.ai.id/api/v1/auth/login \
  -H 'Content-Type: application/json' \
  -d '{}'
POST/api/v1/auth/logout
Responses
KodeKeterangan
200ok
Contoh
curl -s -X post https://robrion.ai.id/api/v1/auth/logout \
  -H 'Content-Type: application/json' \
  -d '{}'
POST/api/v1/auth/register
Contoh
curl -s -X post https://robrion.ai.id/api/v1/auth/register \
  -H 'Content-Type: application/json' \
  -d '{}'
GET/api/v1/me
Responses
KodeKeterangan
200current user + organizations
401unauthorized
Contoh
curl -s https://robrion.ai.id/api/v1/me
GET/api/v1/organizations
Responses
KodeKeterangan
200my organizations
Contoh
curl -s https://robrion.ai.id/api/v1/organizations

commerce

GET/api/v1/invoices
Parameters
NamaLokasiWajibTipe
X-Org-Idheaderyastring
Responses
KodeKeterangan
200invoices
Contoh
curl -s https://robrion.ai.id/api/v1/invoices
GET/api/v1/licenses
Parameters
NamaLokasiWajibTipe
X-Org-Idheaderyastring
Responses
KodeKeterangan
200licenses
Contoh
curl -s https://robrion.ai.id/api/v1/licenses
POST/api/v1/licenses/{id}/activate
Parameters
NamaLokasiWajibTipe
X-Org-Idheaderyastring
Responses
KodeKeterangan
200activation counted against seats
422seat limit or license not active
Contoh
curl -s -X post https://robrion.ai.id/api/v1/licenses/00000000-0000-0000-0000-000000000000/activate \
  -H 'Content-Type: application/json' \
  -d '{}'
GET/api/v1/orders
Parameters
NamaLokasiWajibTipe
X-Org-Idheaderyastring
Responses
KodeKeterangan
200my tenant orders
Contoh
curl -s https://robrion.ai.id/api/v1/orders
POST/api/v1/orders
Parameters
NamaLokasiWajibTipe
Idempotency-Keyheaderyastring
X-Org-Idheadertidakstring
Contoh
curl -s -X post https://robrion.ai.id/api/v1/orders \
  -H 'Content-Type: application/json' \
  -d '{}'
POST/api/v1/orders/{id}/pay
Parameters
NamaLokasiWajibTipe
X-Org-Idheaderyastring
Responses
KodeKeterangan
200paid: order + invoice + licenses + subscriptions
Contoh
curl -s -X post https://robrion.ai.id/api/v1/orders/00000000-0000-0000-0000-000000000000/pay \
  -H 'Content-Type: application/json' \
  -d '{}'
GET/api/v1/products/{key}/adapter
Parameters
NamaLokasiWajibTipe
X-Org-Idheaderyastring
Responses
KodeKeterangan
200capabilities + entitlement for this tenant
Contoh
curl -s https://robrion.ai.id/api/v1/products/receh/adapter
GET/api/v1/subscriptions
Parameters
NamaLokasiWajibTipe
X-Org-Idheaderyastring
Responses
KodeKeterangan
200subscriptions
Contoh
curl -s https://robrion.ai.id/api/v1/subscriptions
GET/api/v1/support/tickets
Parameters
NamaLokasiWajibTipe
X-Org-Idheaderyastring
Responses
KodeKeterangan
200tickets
Contoh
curl -s https://robrion.ai.id/api/v1/support/tickets
POST/api/v1/support/tickets
Contoh
curl -s -X post https://robrion.ai.id/api/v1/support/tickets \
  -H 'Content-Type: application/json' \
  -d '{}'

admin

GET/api/v1/admin/audit
Responses
KodeKeterangan
200last 100 audit events
Contoh
curl -s https://robrion.ai.id/api/v1/admin/audit
GET/api/v1/admin/customers
Responses
KodeKeterangan
200organizations
Contoh
curl -s https://robrion.ai.id/api/v1/admin/customers
GET/api/v1/admin/overview
Responses
KodeKeterangan
200real counts from store
403admin only
Contoh
curl -s https://robrion.ai.id/api/v1/admin/overview
POST/api/v1/admin/products/{key}/status
Contoh
curl -s -X post https://robrion.ai.id/api/v1/admin/products/receh/status \
  -H 'Content-Type: application/json' \
  -d '{}'

webhooks

POST/api/v1/webhooks/{provider}
Parameters
NamaLokasiWajibTipe
X-Signatureheadertidakstring
Contoh
curl -s -X post https://robrion.ai.id/api/v1/webhooks/dana \
  -H 'Content-Type: application/json' \
  -d '{}'

licenses

GET/api/admin/licenses
Parameters
NamaLokasiWajibTipe
statusquerytidakstring
productquerytidakstring
Responses
KodeKeterangan
200all licenses (admin)
Contoh
curl -s https://robrion.ai.id/api/admin/licenses
DELETE/api/license/activations
Responses
KodeKeterangan
200ok
Contoh
curl -s https://robrion.ai.id/api/license/activations
GET/api/license/activations
Parameters
NamaLokasiWajibTipe
licenseIdqueryyastring
Responses
KodeKeterangan
200activations of my license
403not yours
Contoh
curl -s https://robrion.ai.id/api/license/activations
POST/api/license/heartbeat
Responses
KodeKeterangan
200ok + status + expires
403not activated / suspended
410expired
Contoh
curl -s -X post https://robrion.ai.id/api/license/heartbeat \
  -H 'Content-Type: application/json' \
  -d '{}'
POST/api/license/validate
Responses
KodeKeterangan
200Ed25519 token 2-part, 24 jam
403invalid/revoked/expired
409device bound to another license / activation limit
503signing not configured
Contoh
curl -s -X post https://robrion.ai.id/api/license/validate \
  -H 'Content-Type: application/json' \
  -d '{}'
POST/api/license/verify
Responses
KodeKeterangan
200valid + licenseId + expires
403invalid/revoked/expired (generic)
Contoh
curl -s -X post https://robrion.ai.id/api/license/verify \
  -H 'Content-Type: application/json' \
  -d '{}'
GET/api/licenses
Responses
KodeKeterangan
200my licenses (key_hint only, never plaintext)
Contoh
curl -s https://robrion.ai.id/api/licenses
POST/api/licenses
Responses
KodeKeterangan
201created - plaintext key returned ONCE
403admin only
Contoh
curl -s -X post https://robrion.ai.id/api/licenses \
  -H 'Content-Type: application/json' \
  -d '{}'
POST/api/licenses/activate
Responses
KodeKeterangan
200legacy JWT 3-part + features + plan
401{detail: invalid_key}
403{detail: revoked|license_expired|max_installs_reached}
429rate limited
Contoh
curl -s -X post https://robrion.ai.id/api/licenses/activate \
  -H 'Content-Type: application/json' \
  -d '{}'
POST/api/licenses/check
Responses
KodeKeterangan
200{status: active|expired|revoked|license_expired}
401{detail: invalid_token}
Contoh
curl -s -X post https://robrion.ai.id/api/licenses/check \
  -H 'Content-Type: application/json' \
  -d '{}'
POST/api/licenses/deactivate
Responses
KodeKeterangan
200{ok: true, install_id}
401{detail: invalid_key}
Contoh
curl -s -X post https://robrion.ai.id/api/licenses/deactivate \
  -H 'Content-Type: application/json' \
  -d '{}'
GET/api/licenses/public-key
Responses
KodeKeterangan
200{kty, crv, x, pem} legacy Ed25519 public key
503legacy signing not configured
Contoh
curl -s https://robrion.ai.id/api/licenses/public-key
PATCH/api/licenses/{id}
Responses
KodeKeterangan
200status updated
Contoh
curl -s -X patch https://robrion.ai.id/api/licenses/00000000-0000-0000-0000-000000000000 \
  -H 'Content-Type: application/json' \
  -d '{}'

RECEH — QRIS Gateway

Ringkasan endpoint RECEH (di luar OpenAPI di atas)

Gateway QRIS port Robpay. Semua rute di bawah dilayani di https://pay.robrion.ai.id (dan apex). Nominal dalam rupiah (integer minor), fee dihitung server.

Buat order QRIS
curl -s -X POST https://pay.robrion.ai.id/create-qris?account=dana-1 \
  -H 'X-Api-Key: robpay_...' -H 'Content-Type: application/json' \
  -d '{"amount": 10000}'

Respons: qris_id, trx_id, amount (nominal + fee unik), qris_code (payload EMVCo), qris_url (halaman checkout), expires_in: "5 menit".

Cek status order
curl -s 'https://pay.robrion.ai.id/api/qr-status?qris_id=<id>&account=dana-1'
Notifikasi HP (dari APK RECEH Notify)
curl -s -X POST https://pay.robrion.ai.id/notify/dana-1 \
  -H 'Authorization: Bearer <notify_token>' \
  -d '{"amount": 10100, "text": "DANA ...", "notified_at": 1794735900}'

Matching FIFO berdasarkan jumlah persis + order PENDING terlama. Replay aman: tidak ada double-settle.

Webhook settlement (HMAC)
curl -s -X POST https://pay.robrion.ai.id/webhook/dana-1 \
  -H 'X-Signature: <hmac>' -H 'X-Timestamp: <unix>' -H 'X-Nonce: <unik>' \
  -d '{"qris_id": "...", "amount": 10100}'

Signature = HMAC-SHA256(webhook_secret, timestamp.nonce.raw_body), nonce sekali pakai, toleransi ±300 detik.

Halaman checkout

GET /qr/{account}/{qris_id} — halaman bayar dengan QR, countdown 5 menit, polling status tiap 250ms, auto-redirect ke /done saat lunas.

ROBRION API v0.1.0 — spesifikasi: openapi.json