Overview
Cancel a delivery that is stillPENDING. If the delivery (or any of its bulk siblings) was already paid for, the amount is automatically refunded to the wallet the charge came from — either the user’s wallet balance, or the usage-limit allowance for accounts on post-pay billing.
Required permission:
delivery:createEndpoint
Request
Headers
string
required
Your Chidori API key
string
required
Must be
application/jsonBody parameters
string
required
The unique delivery ID (UUID). For bulk deliveries, pass any one delivery’s
id — every sibling sharing the same bulk group will be cancelled together and the refund covers the whole group.string
Optional cancellation note (up to 500 characters). When provided, it replaces the
additionalNotes field on every cancelled delivery so your team can audit why the cancellation happened.Response
Success response
boolean
Always
true for successful requests.object
Cancellation summary.
Examples
Behavior
Refund routing
The refund returns funds to wherever the original charge debited:
If a refund is owed but the account has no active usage-limit row (an edge case during account migration), the refund falls back to the wallet so the customer is never left short.
Bulk deliveries
When you cancel a delivery that belongs to abulk group, every sibling in the same group is cancelled atomically and the refund covers the full bulk amount that was originally charged. This mirrors Charge Wallet, which charges the bulk group as a single unit.
If any sibling has already advanced past PENDING (e.g. one driver has accepted) the entire cancel call fails with 409 Conflict and no changes are made.
Idempotency
Calling cancel on a delivery that is alreadyCANCELLED is a no-op and returns 200 OK with refundAmount: 0. This makes it safe to retry the request after a network blip.
Audit trail
Refunds appear in your transaction history as aCREDIT with a refund_<deliveryId>_<timestamp> reference. You can list them by filtering on type=credit via List Transactions.
Next steps
Get Delivery
Confirm the new
CANCELLED statusList Transactions
Audit the refund credit entry
