@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Order API
@base https://apix.ebay.com/buy/order/v2
@version v2.1.2
@auth OAuth2
@common_fields {X-EBAY-C-MARKETPLACE-ID: str, X-EBAY-C-ENDUSERCTX: str}
@endpoints 8
@toc guest_checkout_session(7), guest_purchase_order(1)

@group guest_checkout_session
@endpoint POST /guest_checkout_session/{checkoutSessionId}/apply_coupon
@required {checkoutSessionId: str, Content-Type: str}
@optional {redemptionCode: str}
@returns(200) {appliedCoupons: [map], checkoutSessionId: str, lineItems: [map], pricingSummary: map{additionalSavings: map{currency: str, value: str}, adjustment: map{amount: map{currency: str, value: str}, label: str}, deliveryCost: map{currency: str, value: str}, fee: map{currency: str, value: str}, importCharges: map{amount: map{currency: str, value: str}, applicableChargeType: str}, importTax: map{amount: map{currency: str, value: str}, importTaxType: str}, priceDiscount: map{currency: str, value: str}, priceSubtotal: map{currency: str, value: str}, tax: map{currency: str, value: str}, total: map{currency: str, value: str}}, shippingAddress: map{addressLine1: str, addressLine2: str, city: str, country: str, county: str, phoneNumber: str, postalCode: str, recipient: map{firstName: str, lastName: str}, stateOrProvince: str}, warnings: [map]}
@errors {400, 403, 404, 409, 500}

@endpoint GET /guest_checkout_session/{checkoutSessionId}
@required {checkoutSessionId: str}
@returns(200) {appliedCoupons: [map], checkoutSessionId: str, lineItems: [map], pricingSummary: map{additionalSavings: map{currency: str, value: str}, adjustment: map{amount: map{currency: str, value: str}, label: str}, deliveryCost: map{currency: str, value: str}, fee: map{currency: str, value: str}, importCharges: map{amount: map{currency: str, value: str}, applicableChargeType: str}, importTax: map{amount: map{currency: str, value: str}, importTaxType: str}, priceDiscount: map{currency: str, value: str}, priceSubtotal: map{currency: str, value: str}, tax: map{currency: str, value: str}, total: map{currency: str, value: str}}, shippingAddress: map{addressLine1: str, addressLine2: str, city: str, country: str, county: str, phoneNumber: str, postalCode: str, recipient: map{firstName: str, lastName: str}, stateOrProvince: str}, warnings: [map]}
@errors {400, 403, 404, 409, 500}

@endpoint POST /guest_checkout_session/initiate
@required {Content-Type: str}
@optional {contactEmail: str, lineItemInputs: [map{itemId: str, quantity: int(int32)}], shippingAddress: map{addressLine1: str, addressLine2: str, city: str, country: str, county: str, phoneNumber: str, postalCode: str, recipient: map, stateOrProvince: str}}
@returns(200) {appliedCoupons: [map], checkoutSessionId: str, lineItems: [map], pricingSummary: map{additionalSavings: map{currency: str, value: str}, adjustment: map{amount: map{currency: str, value: str}, label: str}, deliveryCost: map{currency: str, value: str}, fee: map{currency: str, value: str}, importCharges: map{amount: map{currency: str, value: str}, applicableChargeType: str}, importTax: map{amount: map{currency: str, value: str}, importTaxType: str}, priceDiscount: map{currency: str, value: str}, priceSubtotal: map{currency: str, value: str}, tax: map{currency: str, value: str}, total: map{currency: str, value: str}}, shippingAddress: map{addressLine1: str, addressLine2: str, city: str, country: str, county: str, phoneNumber: str, postalCode: str, recipient: map{firstName: str, lastName: str}, stateOrProvince: str}, warnings: [map]}
@errors {400, 409, 500}

@endpoint POST /guest_checkout_session/{checkoutSessionId}/remove_coupon
@required {checkoutSessionId: str, Content-Type: str}
@optional {redemptionCode: str}
@returns(200) {appliedCoupons: [map], checkoutSessionId: str, lineItems: [map], pricingSummary: map{additionalSavings: map{currency: str, value: str}, adjustment: map{amount: map{currency: str, value: str}, label: str}, deliveryCost: map{currency: str, value: str}, fee: map{currency: str, value: str}, importCharges: map{amount: map{currency: str, value: str}, applicableChargeType: str}, importTax: map{amount: map{currency: str, value: str}, importTaxType: str}, priceDiscount: map{currency: str, value: str}, priceSubtotal: map{currency: str, value: str}, tax: map{currency: str, value: str}, total: map{currency: str, value: str}}, shippingAddress: map{addressLine1: str, addressLine2: str, city: str, country: str, county: str, phoneNumber: str, postalCode: str, recipient: map{firstName: str, lastName: str}, stateOrProvince: str}, warnings: [map]}
@errors {400, 403, 404, 409, 500}

@endpoint POST /guest_checkout_session/{checkoutSessionId}/update_quantity
@required {checkoutSessionId: str, Content-Type: str}
@optional {lineItemId: str, quantity: int(int32)}
@returns(200) {appliedCoupons: [map], checkoutSessionId: str, lineItems: [map], pricingSummary: map{additionalSavings: map{currency: str, value: str}, adjustment: map{amount: map{currency: str, value: str}, label: str}, deliveryCost: map{currency: str, value: str}, fee: map{currency: str, value: str}, importCharges: map{amount: map{currency: str, value: str}, applicableChargeType: str}, importTax: map{amount: map{currency: str, value: str}, importTaxType: str}, priceDiscount: map{currency: str, value: str}, priceSubtotal: map{currency: str, value: str}, tax: map{currency: str, value: str}, total: map{currency: str, value: str}}, shippingAddress: map{addressLine1: str, addressLine2: str, city: str, country: str, county: str, phoneNumber: str, postalCode: str, recipient: map{firstName: str, lastName: str}, stateOrProvince: str}, warnings: [map]}
@errors {400, 403, 404, 409, 500}

@endpoint POST /guest_checkout_session/{checkoutSessionId}/update_shipping_address
@required {checkoutSessionId: str, Content-Type: str}
@optional {addressLine1: str, addressLine2: str, city: str, country: str, county: str, phoneNumber: str, postalCode: str, recipient: map{firstName: str, lastName: str}, stateOrProvince: str}
@returns(200) {appliedCoupons: [map], checkoutSessionId: str, lineItems: [map], pricingSummary: map{additionalSavings: map{currency: str, value: str}, adjustment: map{amount: map{currency: str, value: str}, label: str}, deliveryCost: map{currency: str, value: str}, fee: map{currency: str, value: str}, importCharges: map{amount: map{currency: str, value: str}, applicableChargeType: str}, importTax: map{amount: map{currency: str, value: str}, importTaxType: str}, priceDiscount: map{currency: str, value: str}, priceSubtotal: map{currency: str, value: str}, tax: map{currency: str, value: str}, total: map{currency: str, value: str}}, shippingAddress: map{addressLine1: str, addressLine2: str, city: str, country: str, county: str, phoneNumber: str, postalCode: str, recipient: map{firstName: str, lastName: str}, stateOrProvince: str}, warnings: [map]}
@errors {400, 403, 404, 409, 500}

@endpoint POST /guest_checkout_session/{checkoutSessionId}/update_shipping_option
@required {checkoutSessionId: str, Content-Type: str}
@optional {lineItemId: str, shippingOptionId: str}
@returns(200) {appliedCoupons: [map], checkoutSessionId: str, lineItems: [map], pricingSummary: map{additionalSavings: map{currency: str, value: str}, adjustment: map{amount: map{currency: str, value: str}, label: str}, deliveryCost: map{currency: str, value: str}, fee: map{currency: str, value: str}, importCharges: map{amount: map{currency: str, value: str}, applicableChargeType: str}, importTax: map{amount: map{currency: str, value: str}, importTaxType: str}, priceDiscount: map{currency: str, value: str}, priceSubtotal: map{currency: str, value: str}, tax: map{currency: str, value: str}, total: map{currency: str, value: str}}, shippingAddress: map{addressLine1: str, addressLine2: str, city: str, country: str, county: str, phoneNumber: str, postalCode: str, recipient: map{firstName: str, lastName: str}, stateOrProvince: str}, warnings: [map]}
@errors {400, 403, 404, 409, 500}

@endgroup

@group guest_purchase_order
@endpoint GET /guest_purchase_order/{purchaseOrderId}
@required {purchaseOrderId: str}
@returns(200) {lineItems: [map], pricingSummary: map{additionalSavings: map{currency: str, value: str}, adjustment: map{amount: map{currency: str, value: str}, label: str}, deliveryCost: map{currency: str, value: str}, deliveryDiscount: map{currency: str, value: str}, fee: map{currency: str, value: str}, importCharges: map{currency: str, value: str}, importTax: map{amount: map{currency: str, value: str}, importTaxType: str}, priceDiscount: map{currency: str, value: str}, priceSubtotal: map{currency: str, value: str}, tax: map{currency: str, value: str}, total: map{currency: str, value: str}}, purchaseOrderCreationDate: str, purchaseOrderId: str, purchaseOrderPaymentStatus: str, purchaseOrderStatus: str, refundedAmount: map{currency: str, value: str}, warnings: [map]}
@errors {400, 403, 404, 500}

@endgroup

@end
