Payclave developers
Invoices and refunds
Create and issue invoices, manage collection, and record merchant-sent refunds.
Create and read invoices
Itemized form: lines plus optional customer and invoice fields listed below. issue defaults to false; issue:true issues immediately. send:true requires issue:true and a customer email. Optional Idempotency-Key. The legacy amount-only form creates a payable invoice directly, not an itemized draft.
Query: limit (default 25, use 1-100), startingAfter, collectionState.
Path: invoice id or issued invoice number.
No body. Keep the secret key on your server and stream the download to an authorized user.
Invoice drafts and duplication
Collection
JSON: { version, send? }. Optional Idempotency-Key. Supply a customer email when send is true.
No body required. Requires a deliverable invoice and customer email. Optional Idempotency-Key.
No body required. Requires a collectible issued invoice and customer email. Optional Idempotency-Key.
No body required; the server determines the collectible remainder. Optional Idempotency-Key.
JSON: { reason }. Optional Idempotency-Key.
JSON: { reason }. Optional Idempotency-Key.
JSON: { reason }. Optional Idempotency-Key.
Refunds
JSON: paymentId, amount (positive decimal string), destinationAddress. Check before sending a refund; nothing is recorded.
JSON: paymentId, amount (positive decimal string), reason, externalTransactionHash (omit in test mode; Payclave simulates one), destinationAddress, destinationReason (required when the destination is not the verified paying wallet), chainId, tokenContract. Optional Idempotency-Key.