Dashboard

API Keys

API Keys

Gunakan key ini untuk akses API dokumen. Jangan bagikan ke publik.

Company: -

Tidak ada key

Dokumentasi API

Gunakan key di header x-company-key untuk memanggil endpoint public.

Authorization

x-company-key: <company_key>

POST /documents/generate

Request body:

{
  "fullname": "Jane Doe",
  "borrowDate": "2024-12-01",
  "borrowAmount": 2500000,
  "borrowOutstanding": 900000,
  "paymentVa": 123123123
}

Response:

{
  "message": "Processing",
  "result": {
    "generationId": "abc123"
  }
}

GET /documents/:uniqueId

Response (completed):

{
  "message": "Completed",
  "result": {
    "id": "abc123",
    "url": "https://cdn.example.com/documents/abc123.pdf"
  }
}

Callback (jika callback_url di perusahaan terisi)

POST ke callback_url dengan payload:

{
  "id": "<unique_id>",
  "document_id": 123,
  "no_reff": "HPL/ABC-SOMASI/12/2024",
  "document_url": "https://cdn.example.com/documents/abc123.pdf",
  "status": "completed"
}

Interface ringkas

type GenerateRequest = {
  fullname: string
  borrowDate: string // YYYY-MM-DD
  borrowAmount: number
  borrowOutstanding: number
  paymentVa: number
}

type GenerateResponse = {
  message: string
  result: { generationId: string }
}

type CallbackPayload = {
  id: string
  document_id: number
  no_reff: string
  document_url: string
  status: 'completed' | 'failed'
}