Overview
Process payment for a delivery (or all deliveries in a bulk) from your wallet balance. This endpoint supports idempotency through thereference parameter.
Required permission:
payment:createEndpoint
Request
Headers
Your Chidori API key
Must be
application/jsonBody parameters
The delivery ID to pay for. If this delivery belongs to a bulk, all deliveries in the bulk will be paid.
Client-generated idempotency key. Re-using the same reference will not double-charge.
Optional amount verification. If provided, must match the computed delivery amount.
Response
Success response
Always
true for successful requestsExamples
Single delivery payment
Bulk payment behavior
When you pay for a delivery that belongs to a bulk:- The system identifies the bulk ID from the delivery
- Calculates the total amount for all unpaid deliveries in that bulk
- Charges the full bulk total from your wallet
- Marks all deliveries in the bulk as paid
You can pass any
deliveryId from the bulk—the system will find and charge the entire bulk.Idempotency
Thereference parameter ensures safe retries:
- If a request fails due to network issues, you can safely retry with the same reference
- If the original request succeeded, the retry will return the same response without double-charging
- Use unique references for each distinct payment (e.g., include your order ID)
Error handling
| Status | Message | Action |
|---|---|---|
400 | Validation error | Check request parameters |
401 | Unauthorized | Verify API key |
402 | Insufficient wallet balance | Add funds to wallet |
403 | Forbidden | Check API key permissions |
404 | Delivery not found | Verify delivery ID |
