Confirm an amendment
Confirms a quoted amendment, paying any surcharge or receiving any refund.
Confirms a quoted amendment, paying any surcharge or receiving any refund.
Send the amendmentRequestId from the quote and, optionally, the selectedOptionId of one of
its options (the first option is used when it is omitted). The quote is checked again before anything is
charged: an expired or unknown quote, or one made before another amendment changed the item, returns
400 with code 11004 (OFFER_EXPIRED_OR_INVALID) at amendmentRequestId, and an
option that is no longer offered returns 400 with code 10001; request a new quote then. Where
the change is priced again before the charge (hotels), a price that changed since the quote returns
409 with code 11002 (OFFER_PRICE_CHANGED) at amendmentRequestId without
maxPrice, and is charged when it is within maxPrice. A price above maxPrice returns
409 with code 11002 at
maxPrice, with nothing charged; a maxPrice in another currency than the quoted amounts returns
400 with code 10001 at maxPrice.currency. A change refused when it is sent (for example,
a flight whose price changed since the quote) gets its surcharge back and returns 400 with code
10001.
Confirming the same quote again with a new Idempotency-Key returns 200 with the amendment that
quote created, and nothing is charged twice. A confirm that was interrupted after its payment is finished
first: its change is sent, or its surcharge is returned. Two confirms of one quote sent at the same time make
one amendment: the other returns 200 with it, or 409 with code 18003 and
IN_PROGRESS while the first is still running; send it again shortly. A kind of item that can never be
amended returns 422 with code 18002 (AMENDMENT_NOT_SUPPORTED), and an amendment that is
not allowed now returns 409 with code 18003 (AMENDMENT_NOT_AVAILABLE), with
details[0].reason IN_PROGRESS while another amendment or a change to the order is running,
otherwise MANUAL_REVIEW or NOT_AVAILABLE. An item of another partner, or an unknown id,
returns 404 with code 10004.
A surcharge is charged with paymentMethod balance, its only value: the wallet linked to the API
key. Any other value returns 400 with code 10001 at paymentMethod. A refund goes to that
wallet. Returns the
amendmentRequestId, the new amendmentId, its status, and the payment or
refund that was made (null when none). A wallet charge that fails returns 402 with code
16000 (PAYMENT_FAILED) and, when the reason is known, details[0] naming wallet
with INSUFFICIENT_BALANCE or WALLET_BLOCKED; no amendment is kept, so the same quote can be
confirmed again after a top-up. Amendments do not change
fulfillmentVersion; read the order again for the changed item.
Requires an Idempotency-Key header (a UUID). Repeating a completed request with the same key and body
returns 200 with the amendment that request created, as it reads now, and charges nothing again. One
still running returns 409 with code 12002 (IDEMPOTENCY_KEY_IN_PROGRESS) and a
Retry-After header, and a different body with the same key 409 with code 12001. A
request that ended in an error can be sent again with the same key and body.
PartnerApiKeyX-Partner-Key<token>Partner API Key (X-Partner-Key)
id*stringOrder item id (items[].id from the order response).
uuidIdempotency-Key*stringUUID idempotency key for safe retries of this operation.
uuidThe quote and option to confirm, and an optional price limit.
- body
The quote and option to confirm.
amendmentRequestId*stringRequired. The amendmentRequestId returned by the amendment quote.
uuidpaymentMethod*"balance"How a surcharge is paid. Its only value is balance: the wallet linked to the API key.
Any other value answers 400 with code 10001 at paymentMethod.
"balance"selectedOptionId?|The id of the quote option to confirm. When omitted, the first option is used.
maxPrice?|Optional. The most you accept to pay for this amendment, in the currency of the quoted amounts.
Above it the confirm answers 409 with code 11002 at maxPrice and nothing is charged. Without it the confirm
charges exactly the quoted amounts, and a price that changed since the quote needs a new quote.
OK
- response
The confirmed amendment.
amendmentRequestId*stringThe confirmed quote.
uuidamendmentId*stringThe new amendment's id.
uuidstatus*stringAmendment status.
"pending""completed""cancelled""failed""inProgress""quoted""partnerApproved""approvalInProgress"payment?|The surcharge payment; null when nothing was charged.
refund?|The credit returned; null when nothing was refunded.
curl -X POST 'https://api.sandbox.openroam.com/v1/order-items/01a1432e-7121-7b0e-a0a0-c35454d3b883/amendments/confirm' \ -H 'Idempotency-Key: 0b8f7f3e-6b7a-4a52-9a5e-3d2f1a9c7e10' \ -H 'Content-Type: application/json' \ -d '{ "amendmentRequestId": "f62d9c3e-1bd6-4c13-9f52-d1b5092380b3", "paymentMethod": "balance"}'{ "amendmentRequestId": "f62d9c3e-1bd6-4c13-9f52-d1b5092380b3", "amendmentId": "f50ac643-fd02-46d5-9e8a-eb5968ac5fa0", "status": "pending", "payment": { "status": "pending", "method": "balance", "amount": { "amount": 0, "currency": "string" }, "failure": { "code": 0, "name": "string", "message": "string" } }, "refund": { "status": "pending", "method": "balance", "amount": { "amount": 0, "currency": "string" } }}Cancel an item POST
Cancels an order item and refunds what was paid for it, less any cancellation penalty. Available when the item's `actions.cancellation` is `available`; while a refund is running it shows `inProgress`, and `manualReview` means support must handle it. A rejected item is refunded in full automatically and reported by `order-item.refunded`; the `fulfillmentFailed` reason then returns that refund. The `fulfillmentFailed` reason is accepted only for a rejected item; a cancellation that is not valid for the item returns `400` with code `10001`. A delivered item of a kind that cannot take back a delivery (airtime, utility, gift cards, eSIMs) can never be cancelled and returns `422` with code `18000` (`CANCELLATION_NOT_SUPPORTED`). Otherwise a cancellation that is not allowed now, for example while the item is still being delivered, returns `409` with code `18001` (`CANCELLATION_NOT_AVAILABLE`), and `details[0].reason` repeats `actions.cancellation.availability` (`IN_PROGRESS`, `MANUAL_REVIEW` or `NOT_AVAILABLE`). The same `409` with `IN_PROGRESS` answers a cancel that meets a refund, a delivery or a change of the same order still running; send it again shortly. The amount is recalculated at this point, so it can differ from an earlier cancellation preview. A refund started by OpenRoam support returns the same `409` with `MANUAL_REVIEW`. An item of another partner, or an unknown id, returns `404` with code `10004`. Returns the `orderItemId`, the refund `amount`, the `method` it is returned to and its `status`. A balance payment is refunded to the wallet that paid it. Refund progress is also reported by the `order-item.refunded` webhook. Requires an `Idempotency-Key` header (a UUID). Repeating a completed request with the same key and body returns `200` with the refund that request started, as it reads now, and refunds nothing again. One still running returns `409` with code `12002` (`IDEMPOTENCY_KEY_IN_PROGRESS`) and a `Retry-After` header, and a different body with the same key `409` with code `12001`. A request that ended in an error can be sent again with the same key and body.
Get an amendment GET
Gets one amendment of an order item. Returns the same fields as the amendment list. An unknown amendment, or one that belongs to another item or partner, returns `404` with code `10004`.