{"openapi":"3.0.4","info":{"title":"American Airline ONE Order Management API","version":"1.1.9"},"paths":{"/api/v1/orders/create":{"post":{"summary":"Create a new ONE Order (Book)","description":"Initializes an order with core metadata and the dynamic dynamic flight/ancillary JSON payload.","operationId":"createOrder","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderCreateRequest"}}}},"responses":{"200":{"description":"Order created successfully.","headers":{"Location":{"description":"Relative URL path to the newly created order.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/order"}}}},"400":{"description":"Invalid request validation or business rule violation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderCreateErrorResponse"}}}}}}},"/api/v1/orders/retrieve":{"post":{"summary":"Retrieve orders with Post operation especially when complex objects such as flight details are used to match","description":"Filters the order collection using optional data match","operationId":"retrieveOrder","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderRetrieveRequest"}}}},"responses":{"200":{"description":"Filtered orders array.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/order"}}}}},"400":{"description":"No Order was found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderRetrieveErrorResponse"}}}}}}},"/api/v1/orders/searchByParams":{"get":{"summary":"Retrieve orders with embedded query parameters","description":"Filters the order collection using optional query inputs.","operationId":"getOrdersByQuery","parameters":[{"name":"X-Client-ID","in":"header","required":true,"description":"Unique identifier of the calling system used for metrics and tracking purposes.","schema":{"type":"string","example":"AACOM"}},{"name":"orderId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"orderReference","in":"query","required":false,"schema":{"type":"string"}},{"name":"recordLocator","in":"query","required":false,"schema":{"type":"string"}},{"name":"currentStatus","in":"query","required":false,"description":"Embedded query targeting nested jsonb email strings.","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of specific fields to return in the response for partial payloads.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["all","orderItems","flightSegments","paymentDetails","customers"]}}},{"name":"maxResults","in":"query","description":"The maximum number of orders to return in the response array","required":true,"schema":{"type":"integer","minimum":1,"maximum":250,"default":1}}],"responses":{"200":{"description":"Filtered orders array.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/order"}}}}},"400":{"description":"No Order was found."}}}},"/orders/{orderReference}/change":{"post":{"summary":"Request modifications to an existing Order (OrderChange)","description":"Process mutations such as adding new items, cancelling specific items, or updating flight/passenger elements.","parameters":[{"name":"orderReference","in":"path","required":true,"schema":{"type":"string"},"example":"A1B2C3"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderChangeRequest"}}}},"responses":{"200":{"description":"Order successfully modified and re-priced. Returns the updated Order view.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderChangeResponse"}}}},"400":{"description":"Invalid mutation request (e.g., trying to cancel an already fulfilled flight segment)."}}}}},"components":{"schemas":{"order":{"type":"object","properties":{"orderId":{"type":"string","format":"uuid"},"orderReference":{"type":"string"},"recordLocator":{"type":"string"},"currentStatus":{"$ref":"#/components/schemas/orderStatus"},"totalAmount":{"type":"number","format":"double"},"currency":{"type":"string"},"versionNumber":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"flightSegments":{"type":"array","items":{"$ref":"#/components/schemas/flightSegment"}},"customers":{"type":"array","items":{"$ref":"#/components/schemas/customer"}},"paymentDetails":{"type":"array","items":{"$ref":"#/components/schemas/payment"}},"refundDetails":{"type":"array","items":{"$ref":"#/components/schemas/refundInfo"}},"discountRedemptions":{"type":"array","items":{"$ref":"#/components/schemas/discountRedemption"}},"reportingData":{"type":"object","description":"Any data need for the analytical purposes"},"orderItemsJsonb":{"type":"object","description":"The schematic wrapper mapping directly to PostgreSQL's nested dynamic document representation.","properties":{"orderItems":{"type":"array","items":{"$ref":"#/components/schemas/orderItem"}}}}}},"metadata":{"type":"object","required":["clientId","transactionId"],"properties":{"clientId":{"type":"string","description":"Client system identifier who is calling Order Management System"},"transactionId":{"type":"string","format":"uuid"},"pointOfSale":{"type":"string","description":"Three letter IATA code where the sale is being processed"}}},"orderRetrieveRequest":{"type":"object","required":["metadata"],"properties":{"metadata":{"$ref":"#/components/schemas/metadata"},"orderId":{"type":"string","format":"uuid"},"orderReference":{"type":"string"},"recordLocator":{"type":"string"},"currentStatus":{"$ref":"#/components/schemas/orderStatus"},"filteredItemType":{"$ref":"#/components/schemas/itemType","description":"It will send only order items of the specific type from the order "},"maxResults":{"type":"integer","minimum":1,"maximum":250,"default":1},"fields":{"type":"array","items":{"type":"string","enum":["all","orderItems","flightSegments","paymentDetails","customers"]}},"flightDetail":{"type":"object","required":["flightNumber","departureDate","departureAirport"],"properties":{"flightNumber":{"type":"string"},"departureAirport":{"type":"string","pattern":"^[A-Z]{3}$","example":"JFK"},"arrivalAirport":{"type":"string","pattern":"^[A-Z]{3}$","example":"LHR"},"departureDate":{"type":"string","format":"date","example":"2026-11-15"}}}}},"orderStatus":{"type":"string","enum":["ORDER_CREATED","PAYMENT_VERIFIED","FULFILLED","DELIVERED","REFUNDED","CANCELED","OTHER"]},"orderItem":{"type":"object","required":["orderItemId","passengerRefs"],"properties":{"orderItemId":{"type":"string","format":"uuid"},"customerRefs":{"type":"array","description":"Links this financial charge directly to specific Passenger IDs.","items":{"type":"string"},"example":["PAX-1","PAX-2"]},"paymentRefs":{"type":"array","description":"Links this financial charge directly to payment IDs.","items":{"type":"string"},"example":["PAY-1","PAY-2"]},"flightSegmentRefs":{"type":"array","description":"Links this order uuiditem to the segments associated for any service","items":{"type":"string"}},"refundRefs":{"type":"array","description":"Links this refund details of the order item.","items":{"type":"string"},"example":["REF-1","REF-2"]},"discountRedemptionRefs":{"type":"array","description":"links this order items to the discounts that are being consumed","items":{"type":"string"}},"pssDocument":{"type":"object","$ref":"#/components/schemas/pssDocument"},"itemType":{"$ref":"#/components/schemas/itemType"},"status":{"$ref":"#/components/schemas/orderItemStatus"},"price":{"$ref":"#/components/schemas/amount"},"extension":{"type":"object"}}},"orderItemStatus":{"type":"string","enum":["BOOKED","CONFIRMED","IN_VOLUNTARY_CHANGE","FULFILLED","CANCELLED","REFUNDED","DELIVERED","REFUND_FAILED","PARTIAL_REFUNDED","FULFILLMENT_FAILED"]},"pssDocument":{"type":"object","required":["documentNumber","documentType"],"properties":{"documentNumber":{"type":"string"},"documentType":{"type":"string","enum":["VCR","EMDA","EMDS"]},"documentIssueAt":{"type":"string","format":"date-time","example":"2026-11-15T18:30:00Z"}}},"itemType":{"type":"string","enum":["MEALS","SEAT","OTHER"]},"customer":{"type":"object","required":["customerId","firstName","lastName"],"properties":{"customerId":{"type":"string","description":"Unique string id referenced inside OrderItems.","example":"PAX-1"},"passengerType":{"type":"string","enum":["ADT","CHD","INF"],"example":"ADT"},"firstName":{"type":"string","example":"Jane"},"lastName":{"type":"string","example":"Doe"},"loyaltyProgramInfo":{"$ref":"#/components/schemas/loyaltyProgramInfo"},"contactInfo":{"$ref":"#/components/schemas/contactInfo"}}},"contactInfo":{"type":"object","properties":{"email":{"type":"string","format":"email","example":"jane.doe@example.com"},"phoneNumber":{"type":"string"},"address":{"required":["addressLine1","city","country"],"type":"object","properties":{"city":{"type":"string","example":"Richardson"},"country":{"type":"string","example":"US"},"postalCode":{"type":"string","example":"75802"},"stateOrProvince":{"type":"string","example":"TX"},"addressLine1":{"type":"string","example":"350 vistacourt dr"},"addressLine2":{"type":"string","example":"apartment no 7214"}}}}},"loyaltyProgramInfo":{"required":["carrier","id"],"type":"object","properties":{"id":{"type":"string","description":"Frequent flyer program number like AAdvantage number"},"carrier":{"type":"string","description":"carrier code to which loyalty program subscribed to."},"tierLevel":{"type":"string","enum":["CONCIERGEKEY","EXECUTIVEPLATINUM","PLATINUMPRO","PLATINUM","GOLD","LIMITEDGOLD","REGULAR","OTHER"]}}},"payment":{"type":"object","required":["paymentId","totalAmount","paymentType"],"properties":{"paymentId":{"type":"string","description":"Unique accounting or ledger reference ID.","example":"PAY-2026-00984"},"paymentType":{"type":"string","enum":["SCHEME","INSTALLMENT_SCHEME","OTHER"]},"totalAmount":{"$ref":"#/components/schemas/amount"},"paymentStatus":{"type":"string","enum":["AUTHORIZED","CAPTURED","PENDING-AUTH","AUTH-DECLINED"]}},"discriminator":{"propertyName":"paymentType","mapping":{"SCHEME":"#/components/schemas/cardPayment"}}},"refundInfo":{"type":"object","required":["refundInfoID","refundType","refundAmount"],"properties":{"refundInfoID":{"type":"string","format":"uuid"},"refundType":{"type":"string","enum":["EMDS","VOUCHER","OFOP","GIFTCARD"]},"refundAmount":{"$ref":"#/components/schemas/amount"},"refundReason":{"type":"string"}}},"discountRedemption":{"type":"object","description":"Reusable discount structure for applying coupons, vouchers, or certificates to an order item or service.","required":["discountRedemptionID","discountAmount","appliesTo","loyaltyProgramInfo"],"properties":{"discountRedemptionID":{"type":"string","description":"unique ID asscoiated to refer the asset"},"discountAmount":{"$ref":"#/components/schemas/amount"},"appliesTo":{"type":"string","enum":["Order","OrderItem","Service","Passenger"],"description":"The scope of the discount applicability within the order"},"loyaltyProgramInfo":{"$ref":"#/components/schemas/loyaltyProgramInfo"},"discountCertificate":{"type":"object","required":["certificateNumber","certificateTypeCode"],"properties":{"certificateNumber":{"type":"string","description":"The unique serial identifier of the individual physical or digital coupon artifact."},"certificateTypeCode":{"type":"string","enum":["Coupon","Voucher","CompensationCertificate"]},"certificateStatus":{"type":"string","enum":["OK","AUTHORIZED","USED","REINSTATED"]}}}}},"cardPayment":{"allOf":[{"$ref":"#/components/schemas/payment"},{"required":["paymentToken"],"type":"object","properties":{"paymentToken":{"type":"string","description":"tokenization of the payment details, rather than actual PAN number"},"approvalCode":{"type":"string","description":"Approval code from the payment provider for the authorization processed"},"pspReference":{"type":"string","description":"unique ID from the payment provider for this transaction"},"cardType":{"type":"string"},"cardNumberLastFour":{"type":"string","pattern":"^\\d{4}$","example":"1234"},"encryptedCardNumber":{"type":"string","description":"Encrypted Credit card number, encyption using PTOL public key"}}}]},"amount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"number","example":492.5},"currency":{"type":"string","example":"USD"},"breakdown":{"type":"array","items":{"$ref":"#/components/schemas/amountBreakdown"}}}},"amountBreakdown":{"type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["BASE_FARE","TAX","SURCHARGE","FEE"],"example":"TAX"},"value":{"type":"number","example":42.5},"taxCode":{"type":"string","description":"Standard country or airport tax code code if type is TAX.","example":"US"}}},"flightSegment":{"type":"object","required":["segmentId","departureAirport","arrivalAirport","departureDateTime"],"properties":{"segmentId":{"type":"string","description":"Unique string id referenced inside Service blocks.","example":"SEG-JFK-LHR"},"operatingCarrierCode":{"type":"string","example":"AA"},"marketingCarrierCode":{"type":"string","example":"AA"},"flightNumber":{"type":"string","example":"100"},"departureAirport":{"type":"string","pattern":"^[A-Z]{3}$","example":"JFK"},"arrivalAirport":{"type":"string","pattern":"^[A-Z]{3}$","example":"LHR"},"departureDateTime":{"type":"string","format":"date-time","example":"2026-11-15T18:30:00Z"},"flightStatus":{"type":"string"}}},"orderCreateRequest":{"type":"object","required":["metadata","totalAmount","currency","orderItemsJsonb"],"properties":{"metadata":{"$ref":"#/components/schemas/metadata"},"totalAmount":{"type":"number","format":"double"},"currency":{"type":"string"},"flightSegments":{"type":"array","items":{"$ref":"#/components/schemas/flightSegment"}},"paymentDetails":{"type":"array","items":{"$ref":"#/components/schemas/payment"}},"recordLocator":{"type":"string"},"customers":{"type":"array","items":{"$ref":"#/components/schemas/customer"}},"orderItemsJsonb":{"type":"array","items":{"$ref":"#/components/schemas/orderItem"}},"reportingData":{"type":"object","description":"Any data need for the analytical purposes"}}},"orderChangeRequest":{"type":"object","required":["changeInstructions","metadata"],"properties":{"metadata":{"$ref":"#/components/schemas/metadata"},"changeInstructions":{"type":"array","description":"Chronological sequence of modifications to apply to the target Order.","items":{"$ref":"#/components/schemas/changeInstruction"}},"paymentDetails":{"type":"array","items":{"$ref":"#/components/schemas/payment"}},"discountRedemptions":{"type":"array","items":{"$ref":"#/components/schemas/discountRedemption"}},"refundDetails":{"type":"array","items":{"$ref":"#/components/schemas/refundInfo"}}}},"changeInstruction":{"type":"object","required":["actionType"],"properties":{"changeInstructionID":{"type":"string"},"actionType":{"type":"string","enum":["ADD","CANCEL","UPDATE"],"description":"The mutation operator acting on the data element.","example":"ADD"},"addition":{"type":"object","properties":{"newOrderItems":{"type":"array","items":{"$ref":"#/components/schemas/newOrderItem"}},"newFlightSegments":{"type":"array","items":{"$ref":"#/components/schemas/flightSegment"}},"reportingData":{"type":"object","description":"Any data need for the analytical purposes"}}},"cancellation":{"type":"object","properties":{"orderItemRefs":{"type":"array","description":"Target IDs of OrderItems to cancel.","items":{"type":"string"},"example":["ITEM-LEG2-TICKET"]},"reasonCode":{"type":"string","enum":["VOLUNTARY_CUSTOMER_REQ","INVOLUNTARY_CARRIER_SCHED","RETICKETING_ERROR"],"example":"VOLUNTARY_CUSTOMER_REQ"}}},"update":{"type":"object","properties":{"passengerUpdates":{"type":"array","items":{"$ref":"#/components/schemas/passengerUpdate"}},"orderItemUpdates":{"type":"array","items":{"$ref":"#/components/schemas/orderItemUpdate"}}}}}},"newOrderItem":{"$ref":"#/components/schemas/orderItem"},"passengerUpdate":{"type":"object","required":["passengerRef"],"properties":{"passengerRef":{"type":"string","description":"unique ID targeting the existing Passenger ID.","example":"PAX-1"},"updatedFields":{"type":"object","properties":{"email":{"type":"string","format":"email","example":"jane.doe@example.com"}}}}},"orderItemUpdate":{"type":"object","required":["orderItemRef"],"properties":{"orderItemRef":{"type":"string","format":"uuid"},"subActionType":{"type":"string","description":"To define a specific task for the order item update that needs to be performed"},"updatedFields":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/orderItemStatus"},"paymentRefs":{"type":"array","items":{"type":"string"}},"refundRefs":{"type":"array","items":{"type":"string"}}}},"overwriteOrderItem":{"type":"object","properties":{"latestOrderItem":{"$ref":"#/components/schemas/orderItem"}}}}},"orderChangeResponse":{"type":"object","properties":{"errorDetails":{"$ref":"#/components/schemas/errorDetails"},"changeStatus":{"type":"string","enum":["PROCESSED","RE_PRICING_REQUIRED","FAILED","PARTIAL"],"example":"PROCESSED"},"changeInstructionResults":{"type":"array","items":{"$ref":"#/components/schemas/changeInstructionResult"}},"totalAmountDue":{"type":"number","example":50.0,"description":"Additional collection amount or refund amount balance."},"order":{"$ref":"#/components/schemas/order"}}},"errorDetails":{"type":"object","properties":{"errorCode":{"type":"string"},"errorMessage":{"type":"string"}}},"changeInstructionResult":{"type":"object","properties":{"changeInstructionID":{"type":"string"},"status":{"type":"string","enum":["success","failed","partial"]},"errorDetails":{"$ref":"#/components/schemas/errorDetails"}}},"orderCreateErrorResponse":{"$ref":"#/components/schemas/errorDetails"},"orderRetrieveErrorResponse":{"$ref":"#/components/schemas/errorDetails"}}},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/American-Airlines7/OrderManagementSystem/1.1.9"}]}