1rupiahDocs
ID

Build on the 1ERP API

Connect online stores, warehouses, BI tools, and your own apps to 1ERP with the same rules, approvals, and audit trail as the app.

1Getting access

An admin creates an API client in Settings, API and picks its scopes. A client can never hold more than its creator, and never user, company, or billing settings permissions.

The secret is shown once. Rotate or revoke it at any time; tokens issued with an old secret stop working immediately.

2Authentication

Send the key directly as a bearer token for simple scripts, or use OAuth2 client credentials for applications. Access tokens last one hour and can be narrowed to fewer scopes.

bash
curl https://api.1rupiah.biz.id/v1/api/whoami \
  -H "Authorization: Bearer 1rk_..."
bash
curl -X POST https://api.1rupiah.biz.id/v1/oauth/token \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "client_credentials",
    "client_id": "1rc_...",
    "client_secret": "1rk_...",
    "scope": "sales.view"
  }'

3Reading data

GET /v1/api/objects lists the objects you can sync: parties, items, sales-orders, customer-invoices, purchase-orders, supplier-invoices, journals, and employees. Each list is paged by cursor (limit 1 to 500, default 100) and can be filtered with updated_since for incremental syncs. Pass next_cursor back as cursor until it is null.

bash
curl "https://api.1rupiah.biz.id/v1/api/objects/sales-orders?limit=100&updated_since=2026-11-01T00:00:00Z" \
  -H "Authorization: Bearer 1rk_..."
json
{
  "object": "sales-orders",
  "items": [ { "id": "...", "doc_no": "SO/2026/11/0001", "status": "confirmed" } ],
  "next_cursor": "WyIyMDI2LTExLTAxVDAzOjAwOjAwWiIsIi4uLiJd"
}

4Writing data

Writes go through the same endpoints and rules as the app, including approvals. Send an Idempotency-Key (8 to 128 characters) on POST, PUT, PATCH, and DELETE: a successful answer is replayed for 24 hours, and the same key with a different body is refused. Updates use If-Match with the row version.

bash
curl -X POST https://api.1rupiah.biz.id/v1/sales-orders \
  -H "Authorization: Bearer 1rk_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-web-10293" \
  -d @order.json

5Errors

Every error has the same shape, with a stable code, a message in the language of the request, optional details, and a request_id to quote when you contact support.

json
{
  "error": {
    "code": "rate_limited",
    "message": "Terlalu banyak permintaan. Tunggu sebentar lalu coba lagi.",
    "details": { "retry_after_seconds": 12 },
    "request_id": "8e0e136b-d333-49e4-907d-34f94f3d9e00"
  }
}

6Webhooks

Subscribe to business events in Settings, Integrations, for example sales_order.confirmed, journal_entry.posted, all events of one object with sales_order.*, or everything with *. Every delivery is signed in the X-1rupiah-Signature header as t=<unix seconds>,v1=<HMAC SHA256 of "t.body">. Failed deliveries retry after 1, 5, and 30 minutes, then 2, 6, and 24 hours. An endpoint that keeps failing is switched off and a webhook_endpoint.disabled event is published; turn it back on in Settings, Integrations.

javascript
import { createHmac, timingSafeEqual } from 'node:crypto';

// header: X-1rupiah-Signature, rawBody: isi permintaan apa adanya (sebelum JSON.parse)
function verify(header, rawBody, secret) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  const expected = createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex');
  return parts.v1?.length === expected.length && timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected));
}

7Limits

600 requests per minute per client, shown in the X-RateLimit-Limit and X-RateLimit-Remaining headers. Exceeding it returns 429 with retry_after_seconds. Users limited to certain branches or projects stay limited through the API too.

8Reference

The OpenAPI 3.1 specification is generated from the live routes: https://api.1rupiah.biz.id/v1/openapi.json.