Skip to Content
OpenRoam Docs
Order items

Get an amendment

Gets one amendment of an order item.

GET
/v1/order-items/{id}/amendments/{amendmentId}

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.

Authorization

PartnerApiKey
headerX-Partner-Key<token>

Partner API Key (X-Partner-Key)

Path Parameters

id*string

Order item id (items[].id from the order response).

Formatuuid
amendmentId*string

Amendment id (amendmentId from the confirm response, or id from the amendment list).

Formatuuid

Response Body

OK

  1. response

An amendment of an order item.

id*string

Amendment id.

Formatuuid
orderItemId*string

The amended order item.

Formatuuid
status*string

Amendment status.

Value in"pending""completed""cancelled""failed""inProgress""quoted""partnerApproved""approvalInProgress"
productType*string

The item's product type.

Value in"esim""hotel""flight""carRental""train""lounge""ticket""tour""activity""cruise""remittance""vpn""transportation""insurance""billPayment""giftCard""loyaltyProgram""voip""airtime""utility"
createdAt*string

When the amendment was created (UTC).

Formatdate-time
amountToPay*

The surcharge for the change.

amountToRefund*

The credit for the change.

Example Request
curl -X GET 'https://api.sandbox.openroam.com/v1/order-items/01a1432e-7121-7b0e-a0a0-c35454d3b883/amendments/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "orderItemId": "33207bce-c741-4896-a76b-8afcf6e4179a",  "status": "pending",  "productType": "esim",  "createdAt": "2019-08-24T14:15:22Z",  "amountToPay": {    "amount": 0,    "currency": "string"  },  "amountToRefund": {    "amount": 0,    "currency": "string"  }}

Confirm an amendment POST

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.

List item amendments GET

Lists every amendment of an order item. Returns the whole list as an array, without paging. Each amendment has `id`, `orderItemId`, `status`, `productType`, `createdAt`, `amountToPay` and `amountToRefund`. An item of another partner, or an unknown id, returns `404` with code `10004`.