Payclave developers
API basics
Request formats, response envelopes, timestamps, pagination, and versioning.
Send requests
Send JSON bodies with Content-Type: application/json and authenticate with your API key. Replace path placeholders such as :id with an identifier from a previous response; do not send the colon or invent an ID from the customer's order number. Optional query parameters go in the URL, not in a GET request body.
Send monetary values as decimal strings with at most six fractional digits. For example, use "25.00" rather than calculating a value with floating-point arithmetic in the browser. Use RFC 3339 timestamps for dates and retain the timezone offset or use UTC. Each route documents its own allowed fields and limits.
Responses and errors
The API base URL is https://api.payclave.com. Success responses contain success, data, and meta.requestId. Errors contain success: false, error.code, error.message, optional details, and the request ID. File download routes return bytes.
Check the HTTP status before reading data. A successful creation response means Payclave created a record; it does not mean the customer has paid. HTTP 202 means the operation was accepted for processing. Follow the returned record or status URL until the operation reaches the state your application needs.
Use error.code for application decisions and show the customer a useful recovery action. A message may change as validation improves. Keep meta.requestId or the X-Request-Id header in your server logs alongside your order ID, without recording keys or webhook secrets.
Retries and pagination
An idempotency key identifies one intended operation. Derive it from a stable order or action ID and save it before sending the request. For example, checkout creation and invoice issuance are different operations and should have different keys. Double-clicks and network retries for the same operation should reuse its original key.
Pass an Idempotency-Key for supported mutations. Retry the same operation with the same key and unchanged payload. Treat conflicts as a request to inspect the existing record, rather than repeating irreversible work.
On HTTP 429, wait at least Retry-After seconds. Respect the advertised RateLimit and RateLimit-Policy headers; no advertised quota does not mean unlimited capacity. Retry transient server failures with backoff and the same idempotency key.
Pagination is route-specific. Follow hasMore and nextCursor where offered, and keep cursors in their original merchant and mode. See each endpoint in the complete HTTP reference.
When hasMore is true, send the returned nextCursor as startingAfter to fetch the next page. Keep the same filters and key mode. Stop when hasMore is false. Do not assume that every list accepts the same cursor fields; diagnostic session lists use a different, bounded response.
Additional API errors
| Code | Meaning |
|---|---|
ACCOUNT_SUSPENDED | The merchant account cannot perform this operation. Resolve the account status before retrying. |
ACTIVE_MERCHANT_REQUIRED | Complete merchant activation before using this live capability. |
CURRENCY_MISMATCH | Use the active mode's configured settlement token. |
CUSTOMER_EMAIL_REQUIRED | Add a valid customer email before sending the invoice or reminder. |
INVOICE_ALREADY_ISSUED | The draft is already issued. Retrieve the existing invoice. |
INVOICE_NOT_EDITABLE | The invoice's commercial fields are locked. Create or duplicate a draft instead. |
INVOICE_NOT_PAYABLE | The invoice has no eligible collectible remainder or is closed. |
INVOICE_PDF_UNAVAILABLE | The invoice PDF cannot currently be generated. Retain the request ID and retry only if transient. |
INVOICE_VERSION_CONFLICT | Read the latest invoice version and reconcile your edits before retrying. |
INVALID_TOTAL | Correct the invoice line, discount or tax values so the commercial total is valid. |
FEATURE_UNAVAILABLE | This capability is not enabled for this merchant or is temporarily unavailable. |
PERMISSION_DENIED | The authenticated caller lacks permission for the requested operation. |
REQUEST_TOO_LARGE | Reduce the request body to the endpoint's supported size; the HTTP status is 413. |
EXPORT_CANCELLED | The export was cancelled and cannot be downloaded. Create a new export if needed. |
EXPORT_EXPIRED | The export file is no longer available. Create a new export. |
EXPORT_NOT_READY | Poll the export status until ready before downloading. |
EXPORT_RANGE_TOO_LARGE | Split the time range into intervals of at most 366 days. |
EXPORT_SCHEMA_UNSUPPORTED | Use the supported reconciliation schema version returned by the schema endpoint. |
EXPORT_TOO_LARGE_FOR_SYNC | Use an asynchronous export or narrow the summary query. |
SECRET_OVERLAP_ACTIVE | Resolve the current signing-secret overlap before rotating again. |
SECRET_OVERLAP_EXPIRED | The previous signing-secret overlap has already ended or expired. |
WEBHOOK_ENDPOINT_DISABLED | Enable the endpoint before attempting delivery or replay. |
WEBHOOK_INCIDENT_NOT_FOUND | The incident does not exist in the merchant and mode scope. |