Errors use the HTTP status and a JSON body. Show message to developers, branch on code, and quote request_id to Paper.id support.
| HTTP | Code | What happened | What to do |
|---|---|---|---|
| 400 | VALIDATION_FAILED | A field is missing or invalid; see details. | Fix the listed fields. |
| 401 | INVALID_CREDENTIALS | Client ID or secret is missing or wrong. | Check both headers and the environment. |
| 403 | IP_NOT_ALLOWED | The request came from an IP outside your allowlist. | Add the IP in Settings › API Integration. |
| 404 | NOT_FOUND | No object with that ID in your company. | Check the ID and environment. |
| 409 | PARTNER_NAME_MISMATCH | The partner_number exists with a different name. | Send the stored name, or update the partner first. |
| 409 | INVOICE_NOT_DELETABLE | The invoice is paid or partially paid. | Cancel or credit it in the dashboard. |
| 409 | IDEMPOTENCY_KEY_REUSED | Same key, different body. | Use a new key for a new action. |
| 422 | E_STAMP_QUOTA_EMPTY | No e-Meterai stamps left. | Top up your quota. |
| 405 | METHOD_NOT_ALLOWED | The HTTP method isn't supported on this path. | Check the method in the reference. |
| 429 | RATE_LIMITED | Too many requests. | Wait for Retry-After seconds. |
| 500 | INTERNAL_ERROR | Something failed at Paper.id. | Retry with the same idempotency key; contact support with request_id. |
Example error response:
{
"error": {
"code": "VALIDATION_FAILED",
"message": "due_date must be on or after invoice_date.",
"details": [
{
"field": "due_date",
"issue": "before_invoice_date"
}
]
},
"request_id": "req_01JD3K6Q9W2M"
}