@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Checkouts
@base https://api.bigcommerce.com/stores/{store_hash}/v3
@version 3.0
@auth ApiKey X-Auth-Token in header
@endpoints 19
@toc checkouts(19)

@endpoint GET /checkouts/{checkoutId}
@optional {include: [str]}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}
@errors {404}

@endpoint PUT /checkouts/{checkoutId}
@required {Content-Type: str=application/json, customer_message: str}
@optional {version: int}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}
@errors {409}

@endpoint POST /checkouts/{checkoutId}/discounts
@required {checkoutId: str, Accept: str=application/json, Content-Type: str=application/json}
@optional {cart: map{discounts: [map], line_items: [map], version: int}}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}
@errors {409}

@endpoint POST /checkouts/{checkoutId}/billing-address
@required {checkoutId: str, Accept: str=application/json, Content-Type: str=application/json, email: str, country_code: str}
@optional {first_name: str, last_name: str, company: str, address1: str, address2: str, city: str, state_or_province: str, state_or_province_code: str, postal_code: str, phone: str, custom_fields: [map{field_id: str, field_value: str}], version: int}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}
@errors {409}

@endpoint PUT /checkouts/{checkoutId}/billing-address/{addressId}
@required {checkoutId: str, Accept: str=application/json, Content-Type: str=application/json, addressId: int, email: str, country_code: str}
@optional {first_name: str, last_name: str, company: str, address1: str, address2: str, city: str, state_or_province: str, state_or_province_code: str, postal_code: str, phone: str, custom_fields: [map{field_id: str, field_value: str}], version: int}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}
@errors {409}

@endpoint POST /checkouts/{checkoutId}/consignments
@required {checkoutId: str, Accept: str=application/json, Content-Type: str=application/json}
@optional {include: str}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}
@errors {409}

@endpoint PUT /checkouts/{checkoutId}/consignments/{consignmentId}
@required {Content-Type: str=application/json}
@optional {include: str, address: map{first_name: str, last_name: str, email!: str, company: str, address1: str, address2: str, city: str, state_or_province: str, state_or_province_code: str, country_code!: str, postal_code: str, phone: str, custom_fields: [map]}, line_items: [map{item_id!: str, quantity!: int(int32)}], shipping_option_id: str, pickup_option: map{pickup_method_id: int}, custom_shipping: map{price: num, description: str}, version: int}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}
@errors {409}

@endpoint DELETE /checkouts/{checkoutId}/consignments/{consignmentId}
@optional {version: int}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}

@endpoint POST /checkouts/{checkoutId}/coupons
@required {checkoutId: str, Accept: str=application/json, Content-Type: str=application/json}
@optional {coupon_code: str, version: int}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}
@errors {409}

@endpoint DELETE /checkouts/{checkoutId}/coupons/{couponCode}
@required {checkoutId: str, Accept: str=application/json, couponCode: str}
@optional {version: int}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}
@errors {409}

@endpoint POST /checkouts/{checkoutId}/fees
@required {checkoutId: str, Accept: str=application/json, Content-Type: str=application/json, fees: [map{type!: str, name!: str, display_name!: str, cost!: num, source!: str, tax_class_id: int}]}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}

@endpoint PUT /checkouts/{checkoutId}/fees
@required {checkoutId: str, Accept: str=application/json, fees: [any]}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}

@endpoint DELETE /checkouts/{checkoutId}/fees
@required {checkoutId: str, Accept: str=application/json, ids: [str]}
@returns(200) {data: map{id: str(uuid), cart: map{id: str(uuid), customer_id: int, email: str, currency: map{code: str}, tax_included: bool, base_amount: num(double), channel_id: num, discount_amount: num(double), cart_amount_inc_tax: num(double), cart_amount_ex_tax: num(double), coupons: [map], discounts: [map], line_items: map{physical_items: [map], digital_items: [map], gift_certificates: [map], custom_items: [map]}, created_time: str, updated_time: str}, billing_address: any, consignments: [map], taxes: [map], coupons: [map], fees: [map], order_id: str?, shipping_cost_total_inc_tax: num(double), shipping_cost_total_ex_tax: num(double), handling_cost_total_inc_tax: num(double), handling_cost_total_ex_tax: num(double), tax_total: num(double), subtotal_inc_tax: num(double), subtotal_ex_tax: num(double), grand_total: num(double), created_time: str, updated_time: str, customer_message: str, promotions: [map], version: int}, meta: map}

@endpoint POST /checkouts/{checkoutId}/orders
@required {checkoutId: str, Accept: str=application/json, Content-Type: str=application/json}
@returns(200) {data: map{id: int}, meta: map}

@endpoint GET /checkouts/settings
@returns(200) {data: map{custom_checkout_script_url: str, order_confirmation_use_custom_checkout_script: bool, custom_order_confirmation_script_url: str, custom_checkout_supports_uco_settings: bool, custom_checkout_sri_hash: str, custom_order_confirmation_sri_hash: str}, meta: map}

@endpoint PUT /checkouts/settings
@required {Content-Type: str=application/json}
@optional {custom_checkout_script_url: str, order_confirmation_use_custom_checkout_script: bool, custom_order_confirmation_script_url: str, custom_checkout_supports_uco_settings: bool, custom_checkout_sri_hash: str, custom_order_confirmation_sri_hash: str}
@returns(200) {data: map{custom_checkout_script_url: str, order_confirmation_use_custom_checkout_script: bool, custom_order_confirmation_script_url: str, custom_checkout_supports_uco_settings: bool, custom_checkout_sri_hash: str, custom_order_confirmation_sri_hash: str}, meta: map}

@endpoint GET /checkouts/settings/channels/{channelId}
@returns(200) {data: any, meta: map}
@errors {422}

@endpoint PUT /checkouts/settings/channels/{channelId}
@returns(200) {data: any, meta: map}
@errors {422}

@endpoint POST /checkouts/{checkoutId}/token
@required {Content-Type: str=application/json}
@optional {maxUses: num, ttl: num}
@returns(200) {checkoutToken: str, meta: map}
@errors {401, 422}

@end
