Cancel an unpaid replacement order
Closes an order that still awaits payment. The checkout link stops working and the customer can order again. After payment an installer holds the job, and only Joulo support cancels then: the answer is 409 not_cancellable with the current status.
Partner API key, sent as Authorization: Bearer <key>. Production keys start with jpk_live_ and work only on https://api.joulo.nl. Sandbox keys start with jpk_test_ and work only on https://api-staging.joulo.nl. Sandbox keys minted before September 2026 also start with jpk_live_. A key used on the wrong host returns 401 with a detail. A key is bound to one partner and reaches only the Partner API routes. Any other route returns 404 when it does not exist. A route that needs a scope the key lacks, such as GET /sessions, returns 403 with error: Insufficient scope and a required_scope. Every other route returns 403 with error: partner_api_key_scope. Mint and revoke keys in the partner portal. A partner has one active key at a time.
In: header
uuidResponse Body
curl -X POST "https://api.joulo.nl/functions/v1/api/partner/replacement-orders/cancel" \
-H "Content-Type: application/json" \
-d '{
"order_id": "a1b2c3d4-0000-4000-8000-000000000001"
}'{
"ok": true,
"order_id": "a1b2c3d4-0000-4000-8000-000000000001",
"status": "cancelled"
}{
"error": "order_id must be a UUID"
}{
"error": "Missing or invalid API token"
}{
"error": "Cannot cancel orders for a partner you do not own"
}{
"error": "order_not_found"
}{
"error": "not_cancellable",
"status": "scheduled"
}{
"error": "Too many requests",
"retry_after_seconds": 3
}