Cancel a confirmed promise on request (CancelPromise)
POST/promises/:promiseId/cancellations
Called by customer-ordering to compensate a checkout whose later group failed to confirm: the promises already CONFIRMED are cancelled so their capacity is given back. No request body. A CONFIRMED or AT_RISK promise becomes CANCELLED (cancelReason CANCELLED_ON_REQUEST), the confirmed hold goes back to its PromiseBook and PromiseCancelled goes to the analytics topic, in one transaction. Idempotent: cancelling an already CANCELLED promise is a no-op returning 200 with the same view. A PROVISIONAL, KEPT, BROKEN or RELEASED promise is refused with illegal-transition (409); a provisional hold is never cancelled, it lapses by itself (ReleaseExpiredHolds).
Request
Responses
- 200
- 400
- 404
- 409
- 500
The CANCELLED promise (also the replay and the repeat on an already cancelled promise).
Response Headers
Present, with the value "true", only when the response is the stored answer replayed for the same Idempotency-Key, method, path and body. The first execution never carries it.
The Idempotency-Key header is missing (idempotency-key-required) or malformed (idempotency-key-invalid), the request body is malformed (malformed-request, for bad JSON, an unknown field, trailing data, an empty body, a body over 64 KiB or a NUL character in the query or body), or a collection GET sent an undeclared query parameter (unknown-query-parameter), a bad limit (invalid-limit) or an undecodable cursor (invalid-cursor).
Not found (not-found): the offer or promise does not exist; an identifier carrying a NUL character is resource-not-found.
State, capacity, closed or concurrency conflict (illegal-transition, concurrent-update, offer-not-quotable, promise-capacity-exhausted, book-closed, promise-hold-expired, promise-closed, revision-moves-earlier), or idempotency-key-reused when the Idempotency-Key was already used with a different method, path or body.
Unexpected failure (internal-error); the detail never leaks the internal message. A 5xx is never stored for an Idempotency-Key, so the same key can retry.