openapi: 3.0.0
info:
  title: Shopping API
  version: v0
servers:
  - url: https://dodici.x.newstore.net/v0/c
paths:
  /orders:
    post:
      summary: Create cart
      security:
        - newStoreAccessToken: []
      responses:
        '200':
          description: The order has been created successfully.
          content:
            application/json:
              example:
                schema:
                  associate_id: 7b08ff9a82c9488e905003fce9ad0a53
                  billing_address:
                    address_line_1: 1 United Nations Plaza
                    city: New York
                    country: US
                    first_name: John
                    last_name: Doe
                    phone: '7036917165'
                    state: NY
                    zip_code: '10017'
                  channel:
                    name: NewStore Associate App
                    type: web
                  currency: USD
                  customer:
                    email: johndoe@example.com
                    id: f4251bc6-2871-419c-84d0-c9ea40785fa2
                    language: EN
                    name: John Doe
                  discounts: null
                  id: 569ac9d0-9d69-429c-b263-fe7482561a25
                  messages: null
                  payment_statuses: {}
                  price_modifiers: {}
                  products:
                    - calculated_price:
                        gift_wrapping_price: 0
                        gift_wrapping_tax: 0
                        item_discount: 0
                        item_discount_info: null
                        item_gross: 15
                        item_list_price: 13.78
                        item_order_discount: 0
                        item_price: 13.78
                        item_tax: 1.22
                        item_tax_base: 13.78
                        item_tax_details:
                          - Amount: 0.55
                            Name: NY STATE TAX
                            Rate: 0.04
                          - Amount: 0.62
                            Name: NY CITY TAX
                            Rate: 0.045
                      extended_attributes:
                        - name: item-level
                          value: attribute
                      external_identifiers:
                        - ean13: '2900010000114'
                          sku: '1000011'
                      fulfillment_group:
                        type: IN_STORE_HANDOVER
                      group_id: ''
                      item_ids:
                        - 0332684e-73f6-47f8-83b9-0d3948d33b77
                      pricebook: ''
                      product_id: '1000011'
                      quantity: 1
                    - calculated_price:
                        gift_wrapping_price: 0
                        gift_wrapping_tax: 0
                        item_discount: 0
                        item_discount_info: null
                        item_gross: 15
                        item_list_price: 13.78
                        item_order_discount: 0
                        item_order_discount_info: null
                        item_price: 13.78
                        item_tax: 1.22
                        item_tax_base: 13.78
                        item_tax_details:
                          - Amount: 0.55
                            Name: NY STATE TAX
                            Rate: 0.04
                          - Amount: 0.62
                            Name: NY CITY TAX
                            Rate: 0.045
                          - Amount: 0.05
                            Name: NY SPECIAL TAX
                            Rate: 0.00375
                      extended_attributes:
                        - name: item-level
                          value: attribute
                      external_identifiers:
                        - ean13: '2900010000114'
                          sku: '1000011'
                      fulfillment_group:
                        type: SHIPPING
                      group_id: ''
                      item_ids:
                        - 40a3dc40-56cf-415e-b9a3-9d2a1f3a1791
                      pricebook: ''
                      product_id: '1000011'
                      quantity: 1
                  remaining_amount: 30
                  shipping_address:
                    address_line_1: 1 United Nations Plaza
                    city: New York
                    country: US
                    first_name: John
                    last_name: Doe
                    phone: '7036917165'
                    state: NY
                    zip_code: '10017'
                  shipping_solution_id: ''
                  shop: storefront-catalog-en
                  shop_locale: en-US
                  state: draft
                  store_id: 7c9f2605-9fb3-5444-8fee-47fe51608efe
                  tax_exempt: false
                  totals:
                    discount_total: 0
                    grand_total: 30
                    price_method: tax_excluded
                    shipping_tax_amount: 0
                    shipping_total: 0
                    sub_total: 0
                    subtotal: 27.56
                    tax_strategy: avalara
                    tax_total: 2.44
              schema:
                required:
                  - id
                allOf:
                  - type: object
                    properties:
                      returns:
                        description: Describes returned items if any.
                        anyOf:
                          - type: array
                            description: Returned items.
                            items:
                              type: object
                              anyOf:
                                - required:
                                    - order_id
                                    - item_id
                                - required:
                                    - blind_return
                              properties:
                                order_id:
                                  type: string
                                  description: >-
                                    The identifier of the order the item is part
                                    of.
                                item_id:
                                  type: string
                                  description: The identifier of the returned item.
                                return_reason:
                                  type: string
                                  nullable: true
                                  description: The reason why this item is returned.
                                refund:
                                  type: object
                                  description: >-
                                    The preferred specifications for refund
                                    operation. When not specified the default
                                    refund configuration is used (e.g. refund on
                                    the original payment method).
                                  properties:
                                    amount:
                                      type: number
                                      description: >-
                                        The amount which will be refunded,
                                        calculated based on the cart state. The
                                        amount cannot be specified beforehand.
                                        The amount includes shipping costs to be
                                        refunded if all items of the order are
                                        being returned, and the
                                        `refund_shipping_cost` configuration of
                                        `item_return` is set to `True`.
                                    metadata:
                                      type: object
                                      description: >-
                                        Extra information from the NewStore
                                        platform to attach to the refund method
                                        that is retrieved by the payment
                                        provider. For example, you could add the
                                        order identifier in this field to attach
                                        it to the Stripe charge. Talk to your
                                        contact point at NewStore for more
                                        information.
                                      maxProperties: 100
                                    available_methods:
                                      type: array
                                      description: >-
                                        The list of payment methods to perform a
                                        refund.
                                      items:
                                        type: string
                                        description: Name of a payment method.
                                    method:
                                      type: string
                                      description: >-
                                        The preferred refund method (e.g.
                                        gift_card).
                                blind_return:
                                  type: object
                                  title: Properties for the blind return
                                  required:
                                    - product_id
                                  properties:
                                    product_id:
                                      type: string
                                      description: >-
                                        ID of the product as fetched from the
                                        catalog.
                                      minLength: 1
                                      maxLength: 64
                                    external_order_id:
                                      type: string
                                      description: >-
                                        Order identifier from the different
                                        order management system rather than
                                        NewStore
                                      maxLength: 64
                                    adjusted_item_price:
                                      type: number
                                      description: >-
                                        Item price that was manually adjusted by
                                        the associate.
                                      minimum: 0
                                      exclusiveMinimum: true
                                    pricebook:
                                      type: string
                                      description: >-
                                        Identifier of the pricebook to use
                                        instead of the default pricebook.
                                      maxLength: 64
                                    extended_attributes:
                                      type: array
                                      description: >-
                                        Attributes set by the tenant that can be
                                        exported or displayed in NOM. These
                                        attributes do not impact the business
                                        logic of the NewStore platform.
                                      maxItems: 100
                                      items:
                                        type: object
                                        required:
                                          - name
                                        maxProperties: 2
                                        properties:
                                          name:
                                            type: string
                                            minLength: 1
                                            maxLength: 100
                                          value:
                                            type: string
                                            maxLength: 8192
                                    calculated_price:
                                      type: object
                                      description: >-
                                        Prices, taxes, and discounts calculated
                                        for the item.
                                      properties:
                                        item_price:
                                          description: >-
                                            Catalog price of the item. Can be
                                            affected by pricebooks and bundle
                                            pricing.
                                          type: number
                                          minimum: 0
                                        item_list_price:
                                          description: Price from the default pricebook.
                                          type: number
                                          minimum: 0
                                        item_tax_base:
                                          description: >-
                                            The price of the line item after
                                            applying discounts.
                                          type: number
                                          minimum: 0
                                        item_tax:
                                          description: The tax amount for the line item.
                                          type: number
                                          minimum: 0
                                        item_gross:
                                          description: >-
                                            The final gross amount for the line
                                            item.
                                          type: number
                                          minimum: 0
                                        item_discount:
                                          description: >-
                                            The item scope discount for this line
                                            item.
                                          type: number
                                          minimum: 0
                                        item_order_discount:
                                          description: >-
                                            The portion from the order scope
                                            discount distributed to this line item.
                                          type: number
                                          minimum: 0
                                        item_discount_info:
                                          anyOf:
                                            - type: array
                                              description: >-
                                                Information about item-level discounts
                                                applied to the line item.
                                              items:
                                                type: object
                                                properties:
                                                  discount_ref:
                                                    type: string
                                                    description: >-
                                                      A string token identifying the discount,
                                                      e.g. BLACK_FRIDAY_SALE.
                                                    minLength: 1
                                                    maxLength: 256
                                                  coupon_code:
                                                    description: Code of the coupon.
                                                    type: string
                                                    maxLength: 250
                                                  description:
                                                    type: string
                                                    description: >-
                                                      Internal description of the coupon code.
                                                      Appears in the HQ app.
                                                    maxLength: 1024
                                                  type:
                                                    type: string
                                                    description: Type of discount, fixed or percentage.
                                                    enum:
                                                      - fixed
                                                      - percentage
                                                  scope:
                                                    type: string
                                                    description: >-
                                                      Scope of the discount. Describes whether
                                                      the discount is applied on a single
                                                      item, the entire order or on the
                                                      shipping price.
                                                    enum:
                                                      - order
                                                      - item
                                                      - shipping
                                                  original_value:
                                                    description: >-
                                                      Discount applied. In the case of an item
                                                      discount, the discount is applied to the
                                                      item itself. In the case of an order
                                                      discount, the discount is applied to the
                                                      whole order.
                                                    type: number
                                                    minimum: 0
                                                  price_adjustment:
                                                    description: >-
                                                      Monetary discount amount applied to the
                                                      current item.
                                                    type: number
                                                    minimum: 0
                                                  discount_source:
                                                    description: >-
                                                      Source of discount e.g Automatic, Manual
                                                      e.t.c
                                                    type: string
                                                    enum:
                                                      - automatic
                                                      - coupon
                                                      - manual
                                            - nullable: true
                                        item_order_discount_info:
                                          anyOf:
                                            - type: array
                                              description: >-
                                                Information about order-level discounts
                                                applied to the line item.
                                              items:
                                                type: object
                                                properties:
                                                  discount_ref:
                                                    type: string
                                                    description: >-
                                                      A string token identifying the discount,
                                                      e.g. BLACK_FRIDAY_SALE.
                                                    minLength: 1
                                                    maxLength: 256
                                                  coupon_code:
                                                    description: Code of the coupon.
                                                    type: string
                                                    maxLength: 250
                                                  description:
                                                    type: string
                                                    description: >-
                                                      Internal description of the coupon code.
                                                      Appears in the HQ app.
                                                    maxLength: 1024
                                                  type:
                                                    type: string
                                                    description: Type of discount, fixed or percentage.
                                                    enum:
                                                      - fixed
                                                      - percentage
                                                  scope:
                                                    type: string
                                                    description: >-
                                                      Scope of the discount. Describes whether
                                                      the discount is applied on a single
                                                      item, the entire order or on the
                                                      shipping price.
                                                    enum:
                                                      - order
                                                      - item
                                                      - shipping
                                                  original_value:
                                                    description: >-
                                                      Discount applied. In the case of an item
                                                      discount, the discount is applied to the
                                                      item itself. In the case of an order
                                                      discount, the discount is applied to the
                                                      whole order.
                                                    type: number
                                                    minimum: 0
                                                  price_adjustment:
                                                    description: >-
                                                      Monetary discount amount applied to the
                                                      current item.
                                                    type: number
                                                    minimum: 0
                                                  discount_source:
                                                    description: >-
                                                      Source of discount e.g Automatic, Manual
                                                      e.t.c
                                                    type: string
                                                    enum:
                                                      - automatic
                                                      - coupon
                                                      - manual
                                            - nullable: true
                                        gift_wrapping_price:
                                          type: number
                                          description: >-
                                            Catalog price of gift wrapping if the
                                            product is wrapped.
                                          minimum: 0
                                        gift_wrapping_tax:
                                          type: number
                                          description: >-
                                            Tax of gift wrapping, if the product is
                                            wrapped.
                                          minimum: 0
                                    external_identifier:
                                      type: object
                                      description: >-
                                        The keys of this object are the names of
                                        identifying systems (sku, ean, epc,
                                        ...). The values are the identifiers
                                        themselves. The keys are automatically
                                        converted to lower case whenever
                                        provided as upper case.
                                      maxProperties: 100
                                was_blind:
                                  type: boolean
                                  description: >-
                                    A flag that indicates if the order was
                                    exchanged from a blind return order. In case
                                    of multiple exchanges of an order this flag
                                    would be inherited from the original order.
                                return_code:
                                  type: integer
                                  nullable: true
                                  description: The code of the return reason.
                                item_condition:
                                  type: string
                                  nullable: true
                                  description: The condition in which the item is returned.
                                condition_code:
                                  type: integer
                                  nullable: true
                                  description: The code of the selected condition.
                          - nullable: true
                      state:
                        description: >-
                          Desired state of the order. Use 'draft' while patching
                          the order, use 'placed' to make an attempt to place
                          the order.
                        type: string
                        title: Order state
                        enum:
                          - draft
                          - ready
                          - placed
                          - accepted
                          - failed
                      shop:
                        type: string
                        nullable: true
                        description: The shop containing the items of the order.
                        maxLength: 128
                      shop_locale:
                        type: string
                        nullable: true
                        description: The locale used for the shop, in RFC 5646.
                        maxLength: 128
                      customer:
                        description: Personal information about the customer.
                        anyOf:
                          - nullable: true
                          - type: object
                            description: Customer.
                            properties:
                              id:
                                type: string
                                description: Customer identifier.
                              name:
                                type: string
                                description: Customer name.
                                maxLength: 128
                              email:
                                type: string
                                description: Customer email.
                                maxLength: 64
                              language:
                                description: >-
                                  The code of the language to be used in
                                  communicating with the customer in ISO 639-1
                                  format, e.g. fr, de or en.
                                type: string
                                maxLength: 2
                              display_id:
                                type: string
                                description: >-
                                  Unique human readable identifier of the
                                  profile.
                      tax_exempt:
                        description: If true, the order is tax exempt.
                        type: boolean
                        default: false
                      billing_address:
                        description: >-
                          Billing address. If not set, the shipping address will
                          be used.
                        anyOf:
                          - type: object
                            description: Address.
                            properties:
                              title:
                                type: string
                                description: Title.
                                maxLength: 32
                              suffix:
                                type: string
                                description: Suffix.
                                maxLength: 32
                              salutation:
                                type: string
                                description: Salutation.
                                maxLength: 32
                              first_name:
                                type: string
                                description: First name.
                                maxLength: 64
                              last_name:
                                type: string
                                description: Last name.
                                maxLength: 64
                              country:
                                description: >-
                                  The code of the country in the ISO 3166
                                  ALPHA-2 format. For example, GB, DE or US.
                                type: string
                                minLength: 2
                                maxLength: 2
                              zip_code:
                                type: string
                                description: Zip code.
                                maxLength: 32
                              city:
                                type: string
                                description: City.
                                maxLength: 64
                              state:
                                type: string
                                description: State.
                                maxLength: 32
                              address_line_1:
                                type: string
                                description: First line of the address.
                                minLength: 1
                                maxLength: 128
                              address_line_2:
                                type: string
                                description: Second line of the address.
                                maxLength: 256
                              phone:
                                type: string
                                description: Phone number.
                                maxLength: 128
                          - nullable: true
                      store_id:
                        type: string
                        description: ID of the store where this order was placed.
                        maxLength: 256
                      price_modifiers:
                        description: Manual order level price adjustments and coupons.
                        anyOf:
                          - type: object
                            properties:
                              manual_price_modifier:
                                anyOf:
                                  - nullable: true
                                  - required:
                                      - action
                                      - value
                                    properties:
                                      action:
                                        description: Type of a price adjustment.
                                        type: string
                                        enum:
                                          - fixed
                                          - percentage
                                          - override
                                      value:
                                        type: number
                                        minimum: 0
                                        description: >-
                                          Value of the price adjustment, it could
                                          be fixed amount, percentage or override
                                          according to the value of the 'action'
                                          property.
                                      reason:
                                        type: string
                                        description: Description for the price adjustment.
                                        maxLength: 512
                                      reason_type:
                                        type: string
                                        description: >-
                                          Type of the reason for the price
                                          adjustment.
                                        enum:
                                          - custom_discount
                                          - reason_code
                                    type: object
                                    title: Manual price adjustment
                              coupons:
                                type: array
                                nullable: true
                                items:
                                  required:
                                    - code
                                  properties:
                                    code:
                                      type: string
                                      description: Code of a coupon.
                                      maxLength: 250
                                      minLength: 1
                                  type: object
                                  title: Coupon
                          - nullable: true
                      extended_attributes:
                        description: >-
                          Attributes set by the tenant to be carried over to the
                          export APIs without affecting the business logic of
                          the NewStore platform.
                        anyOf:
                          - nullable: true
                          - type: array
                            maxItems: 100
                            items:
                              type: object
                              required:
                                - name
                              maxProperties: 2
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 100
                                value:
                                  type: string
                                  maxLength: 8192
                      channel:
                        description: Information about the source of the order.
                        anyOf:
                          - nullable: true
                          - type: object
                            description: >-
                              This schema represents the channels used by the
                              customer when they place an order. A channel is a
                              way of offering products or services to consumers
                              for sale, for example a mobile device, or a store.
                            required:
                              - type
                              - name
                            properties:
                              type:
                                type: string
                                description: >-
                                  Identifies a channel. Typical values are
                                  'web', 'mobile_ios', 'mobile_android'
                                minLength: 1
                                maxLength: 32
                              name:
                                description: >-
                                  Name of the channel. The name is displayed in
                                  HQ and can be used for sorting purposes in the
                                  interface.
                                type: string
                                minLength: 1
                                maxLength: 64
                      products:
                        description: The list of products contained in the order.
                        anyOf:
                          - nullable: true
                          - type: array
                            items:
                              properties:
                                product_id:
                                  type: string
                                  description: >-
                                    ID of the product as it was fetched from the
                                    catalog.
                                  minLength: 1
                                  maxLength: 64
                                quantity:
                                  type: integer
                                  description: Quantity of this product ordered.
                                  minimum: 1
                                  default: 1
                                item_ids:
                                  type: array
                                  description: >-
                                    Unique identifiers which are generated by
                                    the server and assigned to every item. The
                                    number of identifiers always equals to the
                                    quantity. Item identifiers are generated
                                    anew upon every POST and PATCH request and
                                    returned as part of the response.
                                    Identifiers provided in the request are
                                    ignored.
                                  maxLength: 100
                                  items:
                                    type: string
                                    description: The identifier of the item.
                                    maxLength: 36
                                group_id:
                                  description: >-
                                    Optional grouping information for
                                    calculating group (bundle) prices.
                                  type: string
                                  maxLength: 64
                                pricebook:
                                  description: >-
                                    Overrides the default pricebook. When used
                                    together with group_id, affects the
                                    prorating of group (bundle) prices.
                                  type: string
                                  maxLength: 64
                                gift_wrapping:
                                  type: object
                                  description: >-
                                    Indicates if gift wrapping option was
                                    selected.
                                  properties:
                                    message:
                                      description: >-
                                        Message to be attached to the
                                        gift-wrapped order. Its length is
                                        configurable per tenant.
                                      type: string
                                      maxLength: 512
                                manual_price_modifier:
                                  required:
                                    - action
                                    - value
                                  properties:
                                    action:
                                      description: Type of a price adjustment.
                                      type: string
                                      enum:
                                        - fixed
                                        - percentage
                                        - override
                                    value:
                                      type: number
                                      minimum: 0
                                      description: >-
                                        Value of the price adjustment, it could
                                        be fixed amount, percentage or override
                                        according to the value of the 'action'
                                        property.
                                    reason:
                                      type: string
                                      description: Description for the price adjustment.
                                      maxLength: 512
                                    reason_type:
                                      type: string
                                      description: >-
                                        Type of the reason for the price
                                        adjustment.
                                      enum:
                                        - custom_discount
                                        - reason_code
                                  type: object
                                  title: Manual price adjustment
                                  description: Item level manual price adjustment.
                                extended_attributes:
                                  type: array
                                  description: >-
                                    Attributes set by the tenant to be carried
                                    over to the export APIs without affecting
                                    the business logic of the NewStore platform.
                                  maxItems: 100
                                  items:
                                    type: object
                                    required:
                                      - name
                                    maxProperties: 2
                                    properties:
                                      name:
                                        type: string
                                        minLength: 1
                                        maxLength: 100
                                      value:
                                        type: string
                                        maxLength: 8192
                                calculated_price:
                                  type: object
                                  description: >-
                                    Prices, taxes, and discounts calculated for
                                    the item. The object is ignored upon
                                    request.
                                  properties:
                                    item_price:
                                      description: >-
                                        Catalog price of the item. Can be
                                        affected by pricebooks and bundle
                                        pricing.
                                      type: number
                                      minimum: 0
                                    item_list_price:
                                      description: Price from the default pricebook.
                                      type: number
                                      minimum: 0
                                    item_tax_base:
                                      description: >-
                                        The price of the line item after
                                        applying discounts.
                                      type: number
                                      minimum: 0
                                    item_tax:
                                      description: The tax amount for the line item.
                                      type: number
                                      minimum: 0
                                    item_gross:
                                      description: >-
                                        The final gross amount for the line
                                        item.
                                      type: number
                                      minimum: 0
                                    item_discount:
                                      description: >-
                                        The item scope discount for this line
                                        item.
                                      type: number
                                      minimum: 0
                                    item_order_discount:
                                      description: >-
                                        The portion from the order scope
                                        discount distributed to this line item.
                                      type: number
                                      minimum: 0
                                    item_discount_info:
                                      anyOf:
                                        - type: array
                                          description: >-
                                            Information about item-level discounts
                                            applied to the line item.
                                          items:
                                            type: object
                                            properties:
                                              discount_ref:
                                                type: string
                                                description: >-
                                                  A string token identifying the discount,
                                                  e.g. BLACK_FRIDAY_SALE.
                                                minLength: 1
                                                maxLength: 256
                                              coupon_code:
                                                description: Code of the coupon.
                                                type: string
                                                maxLength: 250
                                              description:
                                                type: string
                                                description: >-
                                                  Internal description of the coupon code.
                                                  Appears in the HQ app.
                                                maxLength: 1024
                                              type:
                                                type: string
                                                description: Type of discount, fixed or percentage.
                                                enum:
                                                  - fixed
                                                  - percentage
                                              scope:
                                                type: string
                                                description: >-
                                                  Scope of the discount. Describes whether
                                                  the discount is applied on a single
                                                  item, the entire order or on the
                                                  shipping price.
                                                enum:
                                                  - order
                                                  - item
                                                  - shipping
                                              original_value:
                                                description: >-
                                                  Discount applied. In the case of an item
                                                  discount, the discount is applied to the
                                                  item itself. In the case of an order
                                                  discount, the discount is applied to the
                                                  whole order.
                                                type: number
                                                minimum: 0
                                              price_adjustment:
                                                description: >-
                                                  Monetary discount amount applied to the
                                                  current item.
                                                type: number
                                                minimum: 0
                                              discount_source:
                                                description: >-
                                                  Source of discount e.g Automatic, Manual
                                                  e.t.c
                                                type: string
                                                enum:
                                                  - automatic
                                                  - coupon
                                                  - manual
                                        - nullable: true
                                    item_order_discount_info:
                                      anyOf:
                                        - type: array
                                          description: >-
                                            Information about order-level discounts
                                            applied to the line item.
                                          items:
                                            type: object
                                            properties:
                                              discount_ref:
                                                type: string
                                                description: >-
                                                  A string token identifying the discount,
                                                  e.g. BLACK_FRIDAY_SALE.
                                                minLength: 1
                                                maxLength: 256
                                              coupon_code:
                                                description: Code of the coupon.
                                                type: string
                                                maxLength: 250
                                              description:
                                                type: string
                                                description: >-
                                                  Internal description of the coupon code.
                                                  Appears in the HQ app.
                                                maxLength: 1024
                                              type:
                                                type: string
                                                description: Type of discount, fixed or percentage.
                                                enum:
                                                  - fixed
                                                  - percentage
                                              scope:
                                                type: string
                                                description: >-
                                                  Scope of the discount. Describes whether
                                                  the discount is applied on a single
                                                  item, the entire order or on the
                                                  shipping price.
                                                enum:
                                                  - order
                                                  - item
                                                  - shipping
                                              original_value:
                                                description: >-
                                                  Discount applied. In the case of an item
                                                  discount, the discount is applied to the
                                                  item itself. In the case of an order
                                                  discount, the discount is applied to the
                                                  whole order.
                                                type: number
                                                minimum: 0
                                              price_adjustment:
                                                description: >-
                                                  Monetary discount amount applied to the
                                                  current item.
                                                type: number
                                                minimum: 0
                                              discount_source:
                                                description: >-
                                                  Source of discount e.g Automatic, Manual
                                                  e.t.c
                                                type: string
                                                enum:
                                                  - automatic
                                                  - coupon
                                                  - manual
                                        - nullable: true
                                    gift_wrapping_price:
                                      type: number
                                      description: >-
                                        Catalog price of gift wrapping if the
                                        product is wrapped.
                                      minimum: 0
                                    gift_wrapping_tax:
                                      type: number
                                      description: >-
                                        Tax of gift wrapping, if the product is
                                        wrapped.
                                      minimum: 0
                                external_identifiers:
                                  type: array
                                  description: >-
                                    A list of external identifiers. There should
                                    be the same number of items in this array as
                                    the number defined in the 'quantity'
                                    property.
                                  items:
                                    type: object
                                    description: >-
                                      The keys of this object are the names of
                                      identifying systems (sku, ean, epc, ...).
                                      The values are the identifiers themselves.
                                      The keys are automatically converted to
                                      lower case whenever provided as upper
                                      case.
                                    maxProperties: 100
                                fulfillment_group:
                                  description: >-
                                    Fulfillment group of the product. Use it in
                                    the context of mixed cart to differentiate
                                    products for in store handover and for
                                    shipping.
                                  type: object
                                  title: Fulfillment group
                                  required:
                                    - type
                                  properties:
                                    type:
                                      description: >-
                                        Defines if the product is picked-up by
                                        the customer or shipped to them.
                                      type: string
                                      enum:
                                        - IN_STORE_HANDOVER
                                        - SHIPPING
                              type: object
                              required:
                                - product_id
                      payments:
                        type: object
                        description: >-
                          Payment data blocks, each has the identifier provided
                          as the key. The identifier depends on the 'type'
                          property of the payment. When type is 'token', use the
                          payment token. When type is 'authorized', use the
                          charge identifier. When type is 'captured', use the
                          capture identifier. Payments can be modified by these
                          identifiers. Payment statuses are reported per
                          identifier.
                      shipping_address:
                        description: Shipping address.
                        anyOf:
                          - type: object
                            description: Address.
                            properties:
                              title:
                                type: string
                                description: Title.
                                maxLength: 32
                              suffix:
                                type: string
                                description: Suffix.
                                maxLength: 32
                              salutation:
                                type: string
                                description: Salutation.
                                maxLength: 32
                              first_name:
                                type: string
                                description: First name.
                                maxLength: 64
                              last_name:
                                type: string
                                description: Last name.
                                maxLength: 64
                              country:
                                description: >-
                                  The code of the country in the ISO 3166
                                  ALPHA-2 format. For example, GB, DE or US.
                                type: string
                                minLength: 2
                                maxLength: 2
                              zip_code:
                                type: string
                                description: Zip code.
                                maxLength: 32
                              city:
                                type: string
                                description: City.
                                maxLength: 64
                              state:
                                type: string
                                description: State.
                                maxLength: 32
                              address_line_1:
                                type: string
                                description: First line of the address.
                                minLength: 1
                                maxLength: 128
                              address_line_2:
                                type: string
                                description: Second line of the address.
                                maxLength: 256
                              phone:
                                type: string
                                description: Phone number.
                                maxLength: 128
                          - nullable: true
                      manager_approval:
                        description: >-
                          Describes if the order needs an approval, before it is
                          placed.
                        anyOf:
                          - type: object
                            properties:
                              approved_by:
                                type: string
                                description: >-
                                  The identifier of the store associate who
                                  approved the order.
                                minLength: 1
                              approved_rules:
                                type: array
                                description: The list of rules that are already approved.
                                items:
                                  type: string
                              matched_rules:
                                type: array
                                description: >-
                                  The list of approval rules that are applicable
                                  to the order.
                                items:
                                  type: object
                                  description: The identifier of the approval rule.
                                  properties:
                                    label:
                                      type: string
                                      description: The identifier of the approval rule.
                                    description:
                                      type: string
                                      description: >-
                                        The human readable description to
                                        display the rule on frontend
                                        applications.
                                    restricted_payment_methods:
                                      type: array
                                      description: >-
                                        The list of payment methods that require
                                        manager approval in order to be
                                        processed when this rule matches.
                                      items:
                                        description: Name of the payment method.
                                        type: string
                                        enum:
                                          - cash
                                          - credit_card
                                          - manual_credit_card
                                          - non_integrated
                                          - gift_card
                          - nullable: true
                      associate_id:
                        type: string
                        nullable: true
                        description: ID of the store associate who processed this order.
                        maxLength: 256
                      currency:
                        description: >-
                          The currency for all the prices contained within this
                          payload.
                        anyOf:
                          - type: string
                          - nullable: true
                  - description: >-
                      The following properties MUST to be same as
                      ../get_order/response.json, but because a limitation in
                      our code generation it's not possible reference two json
                      with allOf
                    properties:
                      discounts:
                        anyOf:
                          - type: object
                            description: >-
                              Discounts summary. Map discount_ref ->
                              discount_info.
                          - nullable: true
                      return_status:
                        type: object
                        description: The information about the return process.
                        properties:
                          status:
                            type: string
                            description: >-
                              The status of the return. 'pending': the return is
                              being processed; 'succeeded': the return is
                              complete. Items are considered returned by the
                              system; 'failed': the return failed; typical
                              failure reasons are: expired due date, items
                              already returned, items were not found.
                            enum:
                              - pending
                              - succeeded
                              - failed
                          error:
                            description: >-
                              Description of the error. This field is only used
                              when the 'status' property is 'failed'.
                            type: object
                            properties:
                              code:
                                type: string
                                description: Machine-readable error code.
                              description:
                                type: string
                                description: Human-readable description of the error.
                      exchange:
                        oneOf:
                          - type: object
                            description: >-
                              The information about the exchange of the cart
                              (negative, positive or even).
                            properties:
                              type:
                                type: string
                                description: >-
                                  The type of the exchange (negative, positive,
                                  even)
                              amount:
                                type: number
                                description: The amount of the exchange.
                          - nullable: true
                      id:
                        description: >-
                          The identifier of the order assigned internally by the
                          system.
                        type: string
                        minLength: 1
                        maxLength: 64
                      payment_statuses:
                        anyOf:
                          - type: object
                            description: >-
                              Information about payment statuses. Map payment_id
                              -> payment_status.
                          - nullable: true
                      messages:
                        anyOf:
                          - type: array
                            description: >-
                              List of error messages and/or warnings in response
                              to changes in the document.
                            items:
                              type: string
                          - nullable: true
                      totals:
                        required:
                          - price_method
                          - subtotal
                          - shipping_total
                          - shipping_tax_amount
                          - discount_total
                        properties:
                          price_method:
                            type: string
                            description: >-
                              Price method (or tax method) used to calculate
                              prices for the order.
                            enum:
                              - tax_included
                              - tax_excluded
                          subtotal:
                            type: number
                            description: >-
                              Sum of all product prices including item
                              discounts, can include taxes depending on the tax
                              method.
                          shipping_total:
                            type: number
                            description: >-
                              Shipping amount for the whole order including
                              shipping discounts, can include taxes depending on
                              the tax method.
                          shipping_tax_amount:
                            type: number
                            description: The tax amount of the 'shipping_total' property.
                          discount_total:
                            type: number
                            description: >-
                              Discount amount for the whole order, includes
                              order, item, and shipping discounts.
                          grand_total:
                            type: number
                            description: >-
                              Total order amount that has to be paid by the
                              customer.
                          tax_total:
                            type: number
                            description: >-
                              Total tax amount for the whole order, includes
                              product and shipping taxes.
                        title: Totals
                        description: >-
                          Taxes and total amounts calculated for the products,
                          shipping, and other goods.
                        type: object
                      remaining_amount:
                        description: >-
                          The amount of money that is left to be paid before the
                          order can be submitted. Equal to the grand total minus
                          the sum of amounts of all submitted financial
                          instruments.
                        type: number
                        minimum: 0
                      discount_warnings:
                        description: Warnings regarding discounts e.g. invalid coupon codes
                        type: array
                        nullable: true
                        items:
                          type: object
                          properties:
                            ref:
                              type: string
                              description: >-
                                The reference of the problematic discount e.g.
                                the name of an invalid coupon code.
                              minLength: 1
                              maxLength: 256
                            kind:
                              type: string
                              description: The kind of the warning e.g. coupon_code.
                              maxLength: 250
                            code:
                              type: string
                              description: The code of the warning e.g. not_found.
                              maxLength: 1024
                            msg:
                              type: string
                              description: Detailed message about the warning.
                      fiscal_cashbox_id:
                        oneOf:
                          - type: string
                            description: >-
                              The ID of the fiscal cashbox used in the store,
                              that is used by NewStore to manage fiscal
                              cashboxes in stores operating in countries where
                              [fiscal
                              regulations](/docs/glossary.html#term-fiscal-regulations)
                              apply.
                            maxLength: 256
                          - nullable: true
                      tax_exemption_class:
                        oneOf:
                          - type: string
                            description: >-
                              The tax exemption class that identifies the
                              customer's group/organization that accredited them
                              with the tax exemption status.
                            maxLength: 256
                          - nullable: true
                      tax_exemption_number:
                        oneOf:
                          - type: string
                            description: >-
                              The number of the customer's exemption
                              certificate. This is verified by the auditors in
                              the event of a tax audit.
                            maxLength: 256
                          - nullable: true
                type: object
        '400':
          description: >
            - The input data is invalid.

            - Price is specified with invalid number of decimal places according
            to the specified currency.
              For example, if the currency is specified as ``USD`` and the product price has more
              than 2 decimal places, it is considered as invalid by the platform.
              For more information, see
              [pricing dependencies on currency](/docs/processes/about-payments.html#managing-product-pricing-dependencies-on-currency).
          content:
            application/json:
              schema:
                type: object
                required:
                  - error_code
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
        '500':
          description: An internal error occurred.
      description: >-
        Creates a new cart. Use this method to create an order, or to create a
        return.

        Its state is automatically set to `draft`.

        If you have [enabled the mixed cart
        feature](/docs/development/configuration/config-aa-mixedcarts.html),

        you should set the `fulfillment_group` property for each product of the
        cart. It defines whether the product is to be shipped or picked up in
        store.

        To update the content of the cart, use the [Update cart
        method](#/{id}-update-cart). 
      operationId: CreateCart
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                returns:
                  description: Describes returned items if any.
                  anyOf:
                    - type: array
                      description: Returned items.
                      items:
                        type: object
                        anyOf:
                          - required:
                              - order_id
                              - item_id
                          - required:
                              - blind_return
                        properties:
                          order_id:
                            type: string
                            description: The identifier of the order the item is part of.
                          item_id:
                            type: string
                            description: The identifier of the returned item.
                          return_reason:
                            type: string
                            nullable: true
                            description: The reason why this item is returned.
                          refund:
                            type: object
                            description: >-
                              The preferred specifications for refund operation.
                              When not specified the default refund
                              configuration is used (e.g. refund on the original
                              payment method).
                            properties:
                              amount:
                                type: number
                                description: >-
                                  The amount which will be refunded, calculated
                                  based on the cart state. The amount cannot be
                                  specified beforehand. The amount includes
                                  shipping costs to be refunded if all items of
                                  the order are being returned, and the
                                  `refund_shipping_cost` configuration of
                                  `item_return` is set to `True`.
                              metadata:
                                type: object
                                description: >-
                                  Extra information from the NewStore platform
                                  to attach to the refund method that is
                                  retrieved by the payment provider. For
                                  example, you could add the order identifier in
                                  this field to attach it to the Stripe charge.
                                  Talk to your contact point at NewStore for
                                  more information.
                                maxProperties: 100
                              available_methods:
                                type: array
                                description: >-
                                  The list of payment methods to perform a
                                  refund.
                                items:
                                  type: string
                                  description: Name of a payment method.
                              method:
                                type: string
                                description: The preferred refund method (e.g. gift_card).
                          blind_return:
                            type: object
                            title: Properties for the blind return
                            required:
                              - product_id
                            properties:
                              product_id:
                                type: string
                                description: ID of the product as fetched from the catalog.
                                minLength: 1
                                maxLength: 64
                              external_order_id:
                                type: string
                                description: >-
                                  Order identifier from the different order
                                  management system rather than NewStore
                                maxLength: 64
                              adjusted_item_price:
                                type: number
                                description: >-
                                  Item price that was manually adjusted by the
                                  associate.
                                minimum: 0
                                exclusiveMinimum: true
                              pricebook:
                                type: string
                                description: >-
                                  Identifier of the pricebook to use instead of
                                  the default pricebook.
                                maxLength: 64
                              extended_attributes:
                                type: array
                                description: >-
                                  Attributes set by the tenant that can be
                                  exported or displayed in NOM. These attributes
                                  do not impact the business logic of the
                                  NewStore platform.
                                maxItems: 100
                                items:
                                  type: object
                                  required:
                                    - name
                                  maxProperties: 2
                                  properties:
                                    name:
                                      type: string
                                      minLength: 1
                                      maxLength: 100
                                    value:
                                      type: string
                                      maxLength: 8192
                              calculated_price:
                                type: object
                                description: >-
                                  Prices, taxes, and discounts calculated for
                                  the item.
                                properties:
                                  item_price:
                                    description: >-
                                      Catalog price of the item. Can be affected
                                      by pricebooks and bundle pricing.
                                    type: number
                                    minimum: 0
                                  item_list_price:
                                    description: Price from the default pricebook.
                                    type: number
                                    minimum: 0
                                  item_tax_base:
                                    description: >-
                                      The price of the line item after applying
                                      discounts.
                                    type: number
                                    minimum: 0
                                  item_tax:
                                    description: The tax amount for the line item.
                                    type: number
                                    minimum: 0
                                  item_gross:
                                    description: The final gross amount for the line item.
                                    type: number
                                    minimum: 0
                                  item_discount:
                                    description: >-
                                      The item scope discount for this line
                                      item.
                                    type: number
                                    minimum: 0
                                  item_order_discount:
                                    description: >-
                                      The portion from the order scope discount
                                      distributed to this line item.
                                    type: number
                                    minimum: 0
                                  item_discount_info:
                                    anyOf:
                                      - type: array
                                        description: >-
                                          Information about item-level discounts
                                          applied to the line item.
                                        items:
                                          type: object
                                          properties:
                                            discount_ref:
                                              type: string
                                              description: >-
                                                A string token identifying the discount,
                                                e.g. BLACK_FRIDAY_SALE.
                                              minLength: 1
                                              maxLength: 256
                                            coupon_code:
                                              description: Code of the coupon.
                                              type: string
                                              maxLength: 250
                                            description:
                                              type: string
                                              description: >-
                                                Internal description of the coupon code.
                                                Appears in the HQ app.
                                              maxLength: 1024
                                            type:
                                              type: string
                                              description: Type of discount, fixed or percentage.
                                              enum:
                                                - fixed
                                                - percentage
                                            scope:
                                              type: string
                                              description: >-
                                                Scope of the discount. Describes whether
                                                the discount is applied on a single
                                                item, the entire order or on the
                                                shipping price.
                                              enum:
                                                - order
                                                - item
                                                - shipping
                                            original_value:
                                              description: >-
                                                Discount applied. In the case of an item
                                                discount, the discount is applied to the
                                                item itself. In the case of an order
                                                discount, the discount is applied to the
                                                whole order.
                                              type: number
                                              minimum: 0
                                            price_adjustment:
                                              description: >-
                                                Monetary discount amount applied to the
                                                current item.
                                              type: number
                                              minimum: 0
                                            discount_source:
                                              description: >-
                                                Source of discount e.g Automatic, Manual
                                                e.t.c
                                              type: string
                                              enum:
                                                - automatic
                                                - coupon
                                                - manual
                                      - nullable: true
                                  item_order_discount_info:
                                    anyOf:
                                      - type: array
                                        description: >-
                                          Information about order-level discounts
                                          applied to the line item.
                                        items:
                                          type: object
                                          properties:
                                            discount_ref:
                                              type: string
                                              description: >-
                                                A string token identifying the discount,
                                                e.g. BLACK_FRIDAY_SALE.
                                              minLength: 1
                                              maxLength: 256
                                            coupon_code:
                                              description: Code of the coupon.
                                              type: string
                                              maxLength: 250
                                            description:
                                              type: string
                                              description: >-
                                                Internal description of the coupon code.
                                                Appears in the HQ app.
                                              maxLength: 1024
                                            type:
                                              type: string
                                              description: Type of discount, fixed or percentage.
                                              enum:
                                                - fixed
                                                - percentage
                                            scope:
                                              type: string
                                              description: >-
                                                Scope of the discount. Describes whether
                                                the discount is applied on a single
                                                item, the entire order or on the
                                                shipping price.
                                              enum:
                                                - order
                                                - item
                                                - shipping
                                            original_value:
                                              description: >-
                                                Discount applied. In the case of an item
                                                discount, the discount is applied to the
                                                item itself. In the case of an order
                                                discount, the discount is applied to the
                                                whole order.
                                              type: number
                                              minimum: 0
                                            price_adjustment:
                                              description: >-
                                                Monetary discount amount applied to the
                                                current item.
                                              type: number
                                              minimum: 0
                                            discount_source:
                                              description: >-
                                                Source of discount e.g Automatic, Manual
                                                e.t.c
                                              type: string
                                              enum:
                                                - automatic
                                                - coupon
                                                - manual
                                      - nullable: true
                                  gift_wrapping_price:
                                    type: number
                                    description: >-
                                      Catalog price of gift wrapping if the
                                      product is wrapped.
                                    minimum: 0
                                  gift_wrapping_tax:
                                    type: number
                                    description: >-
                                      Tax of gift wrapping, if the product is
                                      wrapped.
                                    minimum: 0
                              external_identifier:
                                type: object
                                description: >-
                                  The keys of this object are the names of
                                  identifying systems (sku, ean, epc, ...). The
                                  values are the identifiers themselves. The
                                  keys are automatically converted to lower case
                                  whenever provided as upper case.
                                maxProperties: 100
                          was_blind:
                            type: boolean
                            description: >-
                              A flag that indicates if the order was exchanged
                              from a blind return order. In case of multiple
                              exchanges of an order this flag would be inherited
                              from the original order.
                          return_code:
                            type: integer
                            nullable: true
                            description: The code of the return reason.
                          item_condition:
                            type: string
                            nullable: true
                            description: The condition in which the item is returned.
                          condition_code:
                            type: integer
                            nullable: true
                            description: The code of the selected condition.
                    - nullable: true
                state:
                  description: >-
                    Desired state of the order. Use 'draft' while patching the
                    order, use 'placed' to make an attempt to place the order.
                  type: string
                  title: Order state
                  enum:
                    - draft
                    - ready
                    - placed
                    - accepted
                    - failed
                shop:
                  type: string
                  nullable: true
                  description: The shop containing the items of the order.
                  maxLength: 128
                shop_locale:
                  type: string
                  nullable: true
                  description: The locale used for the shop, in RFC 5646.
                  maxLength: 128
                customer:
                  description: Personal information about the customer.
                  anyOf:
                    - nullable: true
                    - type: object
                      description: Customer.
                      properties:
                        id:
                          type: string
                          description: Customer identifier.
                        name:
                          type: string
                          description: Customer name.
                          maxLength: 128
                        email:
                          type: string
                          description: Customer email.
                          maxLength: 64
                        language:
                          description: >-
                            The code of the language to be used in communicating
                            with the customer in ISO 639-1 format, e.g. fr, de
                            or en.
                          type: string
                          maxLength: 2
                        display_id:
                          type: string
                          description: Unique human readable identifier of the profile.
                tax_exempt:
                  description: If true, the order is tax exempt.
                  type: boolean
                  default: false
                billing_address:
                  description: >-
                    Billing address. If not set, the shipping address will be
                    used.
                  anyOf:
                    - type: object
                      description: Address.
                      properties:
                        title:
                          type: string
                          description: Title.
                          maxLength: 32
                        suffix:
                          type: string
                          description: Suffix.
                          maxLength: 32
                        salutation:
                          type: string
                          description: Salutation.
                          maxLength: 32
                        first_name:
                          type: string
                          description: First name.
                          maxLength: 64
                        last_name:
                          type: string
                          description: Last name.
                          maxLength: 64
                        country:
                          description: >-
                            The code of the country in the ISO 3166 ALPHA-2
                            format. For example, GB, DE or US.
                          type: string
                          minLength: 2
                          maxLength: 2
                        zip_code:
                          type: string
                          description: Zip code.
                          maxLength: 32
                        city:
                          type: string
                          description: City.
                          maxLength: 64
                        state:
                          type: string
                          description: State.
                          maxLength: 32
                        address_line_1:
                          type: string
                          description: First line of the address.
                          minLength: 1
                          maxLength: 128
                        address_line_2:
                          type: string
                          description: Second line of the address.
                          maxLength: 256
                        phone:
                          type: string
                          description: Phone number.
                          maxLength: 128
                    - nullable: true
                store_id:
                  type: string
                  description: ID of the store where this order was placed.
                  maxLength: 256
                price_modifiers:
                  description: Manual order level price adjustments and coupons.
                  anyOf:
                    - type: object
                      properties:
                        manual_price_modifier:
                          anyOf:
                            - nullable: true
                            - required:
                                - action
                                - value
                              properties:
                                action:
                                  description: Type of a price adjustment.
                                  type: string
                                  enum:
                                    - fixed
                                    - percentage
                                    - override
                                value:
                                  type: number
                                  minimum: 0
                                  description: >-
                                    Value of the price adjustment, it could be
                                    fixed amount, percentage or override
                                    according to the value of the 'action'
                                    property.
                                reason:
                                  type: string
                                  description: Description for the price adjustment.
                                  maxLength: 512
                                reason_type:
                                  type: string
                                  description: Type of the reason for the price adjustment.
                                  enum:
                                    - custom_discount
                                    - reason_code
                              type: object
                              title: Manual price adjustment
                        coupons:
                          type: array
                          nullable: true
                          items:
                            required:
                              - code
                            properties:
                              code:
                                type: string
                                description: Code of a coupon.
                                maxLength: 250
                                minLength: 1
                            type: object
                            title: Coupon
                    - nullable: true
                extended_attributes:
                  description: >-
                    Attributes set by the tenant to be carried over to the
                    export APIs without affecting the business logic of the
                    NewStore platform.
                  anyOf:
                    - nullable: true
                    - type: array
                      maxItems: 100
                      items:
                        type: object
                        required:
                          - name
                        maxProperties: 2
                        properties:
                          name:
                            type: string
                            minLength: 1
                            maxLength: 100
                          value:
                            type: string
                            maxLength: 8192
                channel:
                  description: Information about the source of the order.
                  anyOf:
                    - nullable: true
                    - type: object
                      description: >-
                        This schema represents the channels used by the customer
                        when they place an order. A channel is a way of offering
                        products or services to consumers for sale, for example
                        a mobile device, or a store.
                      required:
                        - type
                        - name
                      properties:
                        type:
                          type: string
                          description: >-
                            Identifies a channel. Typical values are 'web',
                            'mobile_ios', 'mobile_android'
                          minLength: 1
                          maxLength: 32
                        name:
                          description: >-
                            Name of the channel. The name is displayed in HQ and
                            can be used for sorting purposes in the interface.
                          type: string
                          minLength: 1
                          maxLength: 64
                products:
                  description: The list of products contained in the order.
                  anyOf:
                    - nullable: true
                    - type: array
                      items:
                        properties:
                          product_id:
                            type: string
                            description: >-
                              ID of the product as it was fetched from the
                              catalog.
                            minLength: 1
                            maxLength: 64
                          quantity:
                            type: integer
                            description: Quantity of this product ordered.
                            minimum: 1
                            default: 1
                          item_ids:
                            type: array
                            description: >-
                              Unique identifiers which are generated by the
                              server and assigned to every item. The number of
                              identifiers always equals to the quantity. Item
                              identifiers are generated anew upon every POST and
                              PATCH request and returned as part of the
                              response. Identifiers provided in the request are
                              ignored.
                            maxLength: 100
                            items:
                              type: string
                              description: The identifier of the item.
                              maxLength: 36
                          group_id:
                            description: >-
                              Optional grouping information for calculating
                              group (bundle) prices.
                            type: string
                            maxLength: 64
                          pricebook:
                            description: >-
                              Overrides the default pricebook. When used
                              together with group_id, affects the prorating of
                              group (bundle) prices.
                            type: string
                            maxLength: 64
                          gift_wrapping:
                            type: object
                            description: Indicates if gift wrapping option was selected.
                            properties:
                              message:
                                description: >-
                                  Message to be attached to the gift-wrapped
                                  order. Its length is configurable per tenant.
                                type: string
                                maxLength: 512
                          manual_price_modifier:
                            required:
                              - action
                              - value
                            properties:
                              action:
                                description: Type of a price adjustment.
                                type: string
                                enum:
                                  - fixed
                                  - percentage
                                  - override
                              value:
                                type: number
                                minimum: 0
                                description: >-
                                  Value of the price adjustment, it could be
                                  fixed amount, percentage or override according
                                  to the value of the 'action' property.
                              reason:
                                type: string
                                description: Description for the price adjustment.
                                maxLength: 512
                              reason_type:
                                type: string
                                description: Type of the reason for the price adjustment.
                                enum:
                                  - custom_discount
                                  - reason_code
                            type: object
                            title: Manual price adjustment
                            description: Item level manual price adjustment.
                          extended_attributes:
                            type: array
                            description: >-
                              Attributes set by the tenant to be carried over to
                              the export APIs without affecting the business
                              logic of the NewStore platform.
                            maxItems: 100
                            items:
                              type: object
                              required:
                                - name
                              maxProperties: 2
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 100
                                value:
                                  type: string
                                  maxLength: 8192
                          calculated_price:
                            type: object
                            description: >-
                              Prices, taxes, and discounts calculated for the
                              item. The object is ignored upon request.
                            properties:
                              item_price:
                                description: >-
                                  Catalog price of the item. Can be affected by
                                  pricebooks and bundle pricing.
                                type: number
                                minimum: 0
                              item_list_price:
                                description: Price from the default pricebook.
                                type: number
                                minimum: 0
                              item_tax_base:
                                description: >-
                                  The price of the line item after applying
                                  discounts.
                                type: number
                                minimum: 0
                              item_tax:
                                description: The tax amount for the line item.
                                type: number
                                minimum: 0
                              item_gross:
                                description: The final gross amount for the line item.
                                type: number
                                minimum: 0
                              item_discount:
                                description: The item scope discount for this line item.
                                type: number
                                minimum: 0
                              item_order_discount:
                                description: >-
                                  The portion from the order scope discount
                                  distributed to this line item.
                                type: number
                                minimum: 0
                              item_discount_info:
                                anyOf:
                                  - type: array
                                    description: >-
                                      Information about item-level discounts
                                      applied to the line item.
                                    items:
                                      type: object
                                      properties:
                                        discount_ref:
                                          type: string
                                          description: >-
                                            A string token identifying the discount,
                                            e.g. BLACK_FRIDAY_SALE.
                                          minLength: 1
                                          maxLength: 256
                                        coupon_code:
                                          description: Code of the coupon.
                                          type: string
                                          maxLength: 250
                                        description:
                                          type: string
                                          description: >-
                                            Internal description of the coupon code.
                                            Appears in the HQ app.
                                          maxLength: 1024
                                        type:
                                          type: string
                                          description: Type of discount, fixed or percentage.
                                          enum:
                                            - fixed
                                            - percentage
                                        scope:
                                          type: string
                                          description: >-
                                            Scope of the discount. Describes whether
                                            the discount is applied on a single
                                            item, the entire order or on the
                                            shipping price.
                                          enum:
                                            - order
                                            - item
                                            - shipping
                                        original_value:
                                          description: >-
                                            Discount applied. In the case of an item
                                            discount, the discount is applied to the
                                            item itself. In the case of an order
                                            discount, the discount is applied to the
                                            whole order.
                                          type: number
                                          minimum: 0
                                        price_adjustment:
                                          description: >-
                                            Monetary discount amount applied to the
                                            current item.
                                          type: number
                                          minimum: 0
                                        discount_source:
                                          description: >-
                                            Source of discount e.g Automatic, Manual
                                            e.t.c
                                          type: string
                                          enum:
                                            - automatic
                                            - coupon
                                            - manual
                                  - nullable: true
                              item_order_discount_info:
                                anyOf:
                                  - type: array
                                    description: >-
                                      Information about order-level discounts
                                      applied to the line item.
                                    items:
                                      type: object
                                      properties:
                                        discount_ref:
                                          type: string
                                          description: >-
                                            A string token identifying the discount,
                                            e.g. BLACK_FRIDAY_SALE.
                                          minLength: 1
                                          maxLength: 256
                                        coupon_code:
                                          description: Code of the coupon.
                                          type: string
                                          maxLength: 250
                                        description:
                                          type: string
                                          description: >-
                                            Internal description of the coupon code.
                                            Appears in the HQ app.
                                          maxLength: 1024
                                        type:
                                          type: string
                                          description: Type of discount, fixed or percentage.
                                          enum:
                                            - fixed
                                            - percentage
                                        scope:
                                          type: string
                                          description: >-
                                            Scope of the discount. Describes whether
                                            the discount is applied on a single
                                            item, the entire order or on the
                                            shipping price.
                                          enum:
                                            - order
                                            - item
                                            - shipping
                                        original_value:
                                          description: >-
                                            Discount applied. In the case of an item
                                            discount, the discount is applied to the
                                            item itself. In the case of an order
                                            discount, the discount is applied to the
                                            whole order.
                                          type: number
                                          minimum: 0
                                        price_adjustment:
                                          description: >-
                                            Monetary discount amount applied to the
                                            current item.
                                          type: number
                                          minimum: 0
                                        discount_source:
                                          description: >-
                                            Source of discount e.g Automatic, Manual
                                            e.t.c
                                          type: string
                                          enum:
                                            - automatic
                                            - coupon
                                            - manual
                                  - nullable: true
                              gift_wrapping_price:
                                type: number
                                description: >-
                                  Catalog price of gift wrapping if the product
                                  is wrapped.
                                minimum: 0
                              gift_wrapping_tax:
                                type: number
                                description: >-
                                  Tax of gift wrapping, if the product is
                                  wrapped.
                                minimum: 0
                          external_identifiers:
                            type: array
                            description: >-
                              A list of external identifiers. There should be
                              the same number of items in this array as the
                              number defined in the 'quantity' property.
                            items:
                              type: object
                              description: >-
                                The keys of this object are the names of
                                identifying systems (sku, ean, epc, ...). The
                                values are the identifiers themselves. The keys
                                are automatically converted to lower case
                                whenever provided as upper case.
                              maxProperties: 100
                          fulfillment_group:
                            description: >-
                              Fulfillment group of the product. Use it in the
                              context of mixed cart to differentiate products
                              for in store handover and for shipping.
                            type: object
                            title: Fulfillment group
                            required:
                              - type
                            properties:
                              type:
                                description: >-
                                  Defines if the product is picked-up by the
                                  customer or shipped to them.
                                type: string
                                enum:
                                  - IN_STORE_HANDOVER
                                  - SHIPPING
                        type: object
                        required:
                          - product_id
                payments:
                  type: object
                  description: >-
                    Payment data blocks, each has the identifier provided as the
                    key. The identifier depends on the 'type' property of the
                    payment. When type is 'token', use the payment token. When
                    type is 'authorized', use the charge identifier. When type
                    is 'captured', use the capture identifier. Payments can be
                    modified by these identifiers. Payment statuses are reported
                    per identifier.
                shipping_address:
                  description: Shipping address.
                  anyOf:
                    - type: object
                      description: Address.
                      properties:
                        title:
                          type: string
                          description: Title.
                          maxLength: 32
                        suffix:
                          type: string
                          description: Suffix.
                          maxLength: 32
                        salutation:
                          type: string
                          description: Salutation.
                          maxLength: 32
                        first_name:
                          type: string
                          description: First name.
                          maxLength: 64
                        last_name:
                          type: string
                          description: Last name.
                          maxLength: 64
                        country:
                          description: >-
                            The code of the country in the ISO 3166 ALPHA-2
                            format. For example, GB, DE or US.
                          type: string
                          minLength: 2
                          maxLength: 2
                        zip_code:
                          type: string
                          description: Zip code.
                          maxLength: 32
                        city:
                          type: string
                          description: City.
                          maxLength: 64
                        state:
                          type: string
                          description: State.
                          maxLength: 32
                        address_line_1:
                          type: string
                          description: First line of the address.
                          minLength: 1
                          maxLength: 128
                        address_line_2:
                          type: string
                          description: Second line of the address.
                          maxLength: 256
                        phone:
                          type: string
                          description: Phone number.
                          maxLength: 128
                    - nullable: true
                manager_approval:
                  description: >-
                    Describes if the order needs an approval, before it is
                    placed.
                  anyOf:
                    - type: object
                      properties:
                        approved_by:
                          type: string
                          description: >-
                            The identifier of the store associate who approved
                            the order.
                          minLength: 1
                        approved_rules:
                          type: array
                          description: The list of rules that are already approved.
                          items:
                            type: string
                        matched_rules:
                          type: array
                          description: >-
                            The list of approval rules that are applicable to
                            the order.
                          items:
                            type: object
                            description: The identifier of the approval rule.
                            properties:
                              label:
                                type: string
                                description: The identifier of the approval rule.
                              description:
                                type: string
                                description: >-
                                  The human readable description to display the
                                  rule on frontend applications.
                              restricted_payment_methods:
                                type: array
                                description: >-
                                  The list of payment methods that require
                                  manager approval in order to be processed when
                                  this rule matches.
                                items:
                                  description: Name of the payment method.
                                  type: string
                                  enum:
                                    - cash
                                    - credit_card
                                    - manual_credit_card
                                    - non_integrated
                                    - gift_card
                    - nullable: true
                associate_id:
                  type: string
                  nullable: true
                  description: ID of the store associate who processed this order.
                  maxLength: 256
                currency:
                  description: >-
                    The currency for all the prices contained within this
                    payload.
                  anyOf:
                    - type: string
                    - nullable: true
        required: true
  /orders/{id}:
    get:
      summary: Get cart by id
      security:
        - newStoreAccessToken: []
      responses:
        '200':
          description: Successfully returned the cart.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    description: >-
                      The identifier of the order assigned internally by the
                      system.
                    type: string
                    minLength: 1
                    maxLength: 64
                  messages:
                    anyOf:
                      - type: array
                        description: >-
                          List of error messages and/or warnings in response to
                          changes in the document.
                        items:
                          type: string
                      - nullable: true
                  exchange:
                    oneOf:
                      - type: object
                        description: >-
                          The information about the exchange of the cart
                          (negative, positive or even).
                        properties:
                          type:
                            type: string
                            description: >-
                              The type of the exchange (negative, positive,
                              even)
                          amount:
                            type: number
                            description: The amount of the exchange.
                      - nullable: true
                  payment_statuses:
                    anyOf:
                      - type: object
                        description: >-
                          Information about payment statuses. Map payment_id ->
                          payment_status.
                      - nullable: true
                  totals:
                    required:
                      - price_method
                      - subtotal
                      - shipping_total
                      - shipping_tax_amount
                      - discount_total
                    properties:
                      price_method:
                        type: string
                        description: >-
                          Price method (or tax method) used to calculate prices
                          for the order.
                        enum:
                          - tax_included
                          - tax_excluded
                      subtotal:
                        type: number
                        description: >-
                          Sum of all product prices including item discounts,
                          can include taxes depending on the tax method.
                      shipping_total:
                        type: number
                        description: >-
                          Shipping amount for the whole order including shipping
                          discounts, can include taxes depending on the tax
                          method.
                      shipping_tax_amount:
                        type: number
                        description: The tax amount of the 'shipping_total' property.
                      discount_total:
                        type: number
                        description: >-
                          Discount amount for the whole order, includes order,
                          item, and shipping discounts.
                      grand_total:
                        type: number
                        description: >-
                          Total order amount that has to be paid by the
                          customer.
                      tax_total:
                        type: number
                        description: >-
                          Total tax amount for the whole order, includes product
                          and shipping taxes.
                    title: Totals
                    description: >-
                      Taxes and total amounts calculated for the products,
                      shipping, and other goods.
                    type: object
                  remaining_amount:
                    description: >-
                      The amount of money that is left to be paid before the
                      order can be submitted. Equal to the grand total minus the
                      sum of amounts of all submitted financial instruments.
                    type: number
                    minimum: 0
                  discounts:
                    anyOf:
                      - type: object
                        description: Discounts summary. Map discount_ref -> discount_info.
                      - nullable: true
                  return_status:
                    type: object
                    description: The information about the return process.
                    properties:
                      status:
                        type: string
                        description: >-
                          The status of the return. 'pending': the return is
                          being processed; 'succeeded': the return is complete.
                          Items are considered returned by the system; 'failed':
                          the return failed; typical failure reasons are:
                          expired due date, items already returned, items were
                          not found.
                        enum:
                          - pending
                          - succeeded
                          - failed
                      error:
                        description: >-
                          Description of the error. This field is only used when
                          the 'status' property is 'failed'.
                        type: object
                        properties:
                          code:
                            type: string
                            description: Machine-readable error code.
                          description:
                            type: string
                            description: Human-readable description of the error.
                  manager_approval:
                    description: >-
                      Describes if the order needs an approval, before it is
                      placed.
                    anyOf:
                      - type: object
                        properties:
                          approved_by:
                            type: string
                            description: >-
                              The identifier of the store associate who approved
                              the order.
                            minLength: 1
                          approved_rules:
                            type: array
                            description: The list of rules that are already approved.
                            items:
                              type: string
                          matched_rules:
                            type: array
                            description: >-
                              The list of approval rules that are applicable to
                              the order.
                            items:
                              type: object
                              description: The identifier of the approval rule.
                              properties:
                                label:
                                  type: string
                                  description: The identifier of the approval rule.
                                description:
                                  type: string
                                  description: >-
                                    The human readable description to display
                                    the rule on frontend applications.
                                restricted_payment_methods:
                                  type: array
                                  description: >-
                                    The list of payment methods that require
                                    manager approval in order to be processed
                                    when this rule matches.
                                  items:
                                    description: Name of the payment method.
                                    type: string
                                    enum:
                                      - cash
                                      - credit_card
                                      - manual_credit_card
                                      - non_integrated
                                      - gift_card
                      - nullable: true
                  fiscal_cashbox_id:
                    type: string
                    nullable: true
                    description: >-
                      The ID of the fiscal cashbox used in the store, that is
                      used by NewStore to manage fiscal cashboxes in stores
                      operating in countries where [fiscal
                      regulations](/docs/glossary.html#term-fiscal-regulations)
                      apply.
                    maxLength: 256
                  tax_exemption_class:
                    type: string
                    nullable: true
                    description: >-
                      The tax exemption class that identifies the customer's
                      group/organization that accredited them with the tax
                      exemption status.
                    maxLength: 256
                  tax_exemption_number:
                    type: string
                    nullable: true
                    description: >-
                      The number of the customer's exemption certificate. This
                      is verified by the auditors in the event of a tax audit.
                    maxLength: 256
        '400':
          description: Invalid syntax for order identifier (non-UUID).
          content:
            application/json:
              example:
                schema:
                  error_code: invalid_uuid
                  message: 'invalid uuid for parameter id: EXT12345'
                  request_id: 7ed369b7-f33b-48c2-b1c3-b4c9b29ca220
              schema:
                type: object
                required:
                  - error_code
                  - message
                  - request_id
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
                  request_id:
                    description: >-
                      Unique request identifier which caused the error. Can be
                      used to further debug the root causes of this error.
                    type: string
        '404':
          description: The cart was not found.
          content:
            application/json:
              example:
                schema:
                  error_code: not_found
                  message: The requested document could not be found.
                  request_id: 2018.10.18
              schema:
                type: object
                required:
                  - error_code
                  - message
                  - request_id
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
                  request_id:
                    description: >-
                      Unique request identifier which caused the error. Can be
                      used to further debug the root causes of this error.
                    type: string
        '500':
          description: An internal error occurred.
          content:
            application/json:
              example:
                schema:
                  error_code: server_error
                  message: An internal server error happened.
                  request_id: 2018.10.18
              schema:
                type: object
                required:
                  - error_code
                  - message
                  - request_id
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
                  request_id:
                    description: >-
                      Unique request identifier which caused the error. Can be
                      used to further debug the root causes of this error.
                    type: string
      description: Retrieves the specified cart.
      operationId: GetCartById
    patch:
      summary: Update cart
      security:
        - newStoreAccessToken: []
      responses:
        '200':
          description: The order has been updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    description: >-
                      The identifier of the order assigned internally by the
                      system.
                    type: string
                    minLength: 1
                    maxLength: 64
                  messages:
                    anyOf:
                      - type: array
                        description: >-
                          List of error messages and/or warnings in response to
                          changes in the document.
                        items:
                          type: string
                      - nullable: true
                  exchange:
                    oneOf:
                      - type: object
                        description: >-
                          The information about the exchange of the cart
                          (negative, positive or even).
                        properties:
                          type:
                            type: string
                            description: >-
                              The type of the exchange (negative, positive,
                              even)
                          amount:
                            type: number
                            description: The amount of the exchange.
                      - nullable: true
                  payment_statuses:
                    anyOf:
                      - type: object
                        description: >-
                          Information about payment statuses. Map payment_id ->
                          payment_status.
                      - nullable: true
                  totals:
                    required:
                      - price_method
                      - subtotal
                      - shipping_total
                      - shipping_tax_amount
                      - discount_total
                    properties:
                      price_method:
                        type: string
                        description: >-
                          Price method (or tax method) used to calculate prices
                          for the order.
                        enum:
                          - tax_included
                          - tax_excluded
                      subtotal:
                        type: number
                        description: >-
                          Sum of all product prices including item discounts,
                          can include taxes depending on the tax method.
                      shipping_total:
                        type: number
                        description: >-
                          Shipping amount for the whole order including shipping
                          discounts, can include taxes depending on the tax
                          method.
                      shipping_tax_amount:
                        type: number
                        description: The tax amount of the 'shipping_total' property.
                      discount_total:
                        type: number
                        description: >-
                          Discount amount for the whole order, includes order,
                          item, and shipping discounts.
                      grand_total:
                        type: number
                        description: >-
                          Total order amount that has to be paid by the
                          customer.
                      tax_total:
                        type: number
                        description: >-
                          Total tax amount for the whole order, includes product
                          and shipping taxes.
                    title: Totals
                    description: >-
                      Taxes and total amounts calculated for the products,
                      shipping, and other goods.
                    type: object
                  remaining_amount:
                    description: >-
                      The amount of money that is left to be paid before the
                      order can be submitted. Equal to the grand total minus the
                      sum of amounts of all submitted financial instruments.
                    type: number
                    minimum: 0
                  discounts:
                    anyOf:
                      - type: object
                        description: Discounts summary. Map discount_ref -> discount_info.
                      - nullable: true
                  return_status:
                    type: object
                    description: The information about the return process.
                    properties:
                      status:
                        type: string
                        description: >-
                          The status of the return. 'pending': the return is
                          being processed; 'succeeded': the return is complete.
                          Items are considered returned by the system; 'failed':
                          the return failed; typical failure reasons are:
                          expired due date, items already returned, items were
                          not found.
                        enum:
                          - pending
                          - succeeded
                          - failed
                      error:
                        description: >-
                          Description of the error. This field is only used when
                          the 'status' property is 'failed'.
                        type: object
                        properties:
                          code:
                            type: string
                            description: Machine-readable error code.
                          description:
                            type: string
                            description: Human-readable description of the error.
                  manager_approval:
                    description: >-
                      Describes if the order needs an approval, before it is
                      placed.
                    anyOf:
                      - type: object
                        properties:
                          approved_by:
                            type: string
                            description: >-
                              The identifier of the store associate who approved
                              the order.
                            minLength: 1
                          approved_rules:
                            type: array
                            description: The list of rules that are already approved.
                            items:
                              type: string
                          matched_rules:
                            type: array
                            description: >-
                              The list of approval rules that are applicable to
                              the order.
                            items:
                              type: object
                              description: The identifier of the approval rule.
                              properties:
                                label:
                                  type: string
                                  description: The identifier of the approval rule.
                                description:
                                  type: string
                                  description: >-
                                    The human readable description to display
                                    the rule on frontend applications.
                                restricted_payment_methods:
                                  type: array
                                  description: >-
                                    The list of payment methods that require
                                    manager approval in order to be processed
                                    when this rule matches.
                                  items:
                                    description: Name of the payment method.
                                    type: string
                                    enum:
                                      - cash
                                      - credit_card
                                      - manual_credit_card
                                      - non_integrated
                                      - gift_card
                      - nullable: true
                  fiscal_cashbox_id:
                    type: string
                    nullable: true
                    description: >-
                      The ID of the fiscal cashbox used in the store, that is
                      used by NewStore to manage fiscal cashboxes in stores
                      operating in countries where [fiscal
                      regulations](/docs/glossary.html#term-fiscal-regulations)
                      apply.
                    maxLength: 256
                  tax_exemption_class:
                    type: string
                    nullable: true
                    description: >-
                      The tax exemption class that identifies the customer's
                      group/organization that accredited them with the tax
                      exemption status.
                    maxLength: 256
                  tax_exemption_number:
                    type: string
                    nullable: true
                    description: >-
                      The number of the customer's exemption certificate. This
                      is verified by the auditors in the event of a tax audit.
                    maxLength: 256
        '400':
          description: >
            The input data is invalid.


            Use the error codes for error handling. The error messages should
            never

            be used for error handling as they can change at any time.


            **Error codes**


            **Missing required fields:**


            * `address_validation_error`: This error is returned when the tax
            calculation subsystem can not use
              the provided shipping address for calculating taxes. Most of the time it means that
              either country or postal code is missing.

            * `missing_address_line_1_for_shipping_address`

            * `missing_associate_id`

            * `missing_channel_info`

            * `missing_country_for_billing_address`

            * `missing_country_for_shipping_address`

            * `missing_currency`

            * `missing_customer_email`

            * `missing_customer_info`

            * `missing_products_or_returns`

            * `missing_shipping_address`

            * `missing_shipping_address_phone`

            * `missing_shipping_solution_id_or_associate_id`

            * `missing_shop`

            * `missing_shop_locale`

            * `missing_store_id`


            **Invalid field values:**


            The following error codes are returned in case an invalid value was
            provided for a certain field:


            * `invalid_uuid`: invalid syntax for order identifier (non-UUID)

            * `concurrent_update_error`: coupon redemption failed because the
            provided coupon was modified at the same time as it was supposed to
            be redeemed

            * `coupon_code_not_found`: the requested coupon does not exist

            * `coupon_is_disabled`: the requested coupon is deactivated

            * `discount_bundle_conflict`: the requested coupon can not be
            applied in combination with group pricing ("product bundles")

            * `get_gift_wrapping_error`: failed to fetch gift wrapping
            information for the order

            * `get_products_error`: one of the requested products was not found

            * `invalid_coupon`: coupon validation or redemption failed because
            the requested coupon is not valid for the order

            * `invalid_currency`: the currency that is associated with the
            requested coupon does not match with the order currency

            * `invalid_order_data`: the order information required to calculate
            shipping solutions was incomplete

            * `invalid_paid_amount`: The grand total of the order is not
            sufficiently paid

            * `paid_token_amount_exceeds_grand_total`: The sum of all token
            payments exceeds the grand total. Adjust token payments to avoid
            charging the user extra

            * `items_not_available`: can not determine shipping solutions
            because at least one item is not available

            * `order_data_changed`: the order data was modified while shipping
            solutions are requested (try again)

            * `shipping_solution_not_found`: A shipping solution ID was provided
            with the request, but the corresponding shipping solution does not
            exist

            * `too_low_total`: the requested coupon can not be applied because
            the order grand total is too low

            * `multiple_refunded_payments_error`: multiple "refunded" payments
            were added to the order (i.e. adyen_refund and gift_card)

            * `adjusted_item_price_invalid`: manual price for blind_return
            products is not correct

            * `mixed_country_taxes`: multiple tax country codes were calculated
            for order, created in one of fiscal countries

            * `invalid_currency_rounding`: input price value has incorrect
            number of decimal places according to specified currency

            * `mixed_product_currency`: one of the products has currency
            different from the order

            * `fiscalization_failed_error`: Failed to get a fiscal signature due
            to a fiscal provider error


            **Return not possible:**


            The following errors can be returned for return items added to the
            order.


            * `duplicate_items`: the same return item was added multiple times
            to the order

            * `item_already_returned`: the return item added was already
            returned and cannot be returned again

            * `item_not_found`: the item identifier provided does not match any
            existing item

            * `no_items_provided`: there is no correct item id provided

            * `return_window_missed`: the return item added is not returnable
            anymore because it is outside of the return window

            * `sales_order_not_found`: the order identifier provided does not
            match any existing order

            * `mixed_common_and_blind_returns_not_allowed`: the order contains
            both blind and normal returns

            * `different_external_order_ids_in_blind_return`:  the order
            contains blind return items with different external order ids
          content:
            application/json:
              schema:
                type: object
                required:
                  - error_code
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
        '403':
          description: The order cannot be updated without approval.
          content:
            application/json:
              example:
                schema:
                  error_code: forbidden
                  message: The provided request is forbidden.
                  request_id: 2019.06.05
              schema:
                type: object
                required:
                  - error_code
                  - message
                  - request_id
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
                  request_id:
                    description: >-
                      Unique request identifier which caused the error. Can be
                      used to further debug the root causes of this error.
                    type: string
        '404':
          description: The order was not found.
        '409':
          description: |
            The order update failed due to a concurrent request.

            **Error code:** `not_updated_error`
        '500':
          description: An internal error occurred.
      description: >
        Updates an existing cart.

        Use this method to update the status of the cart or to add items,
        payments, or a shipping method to the cart in order to place an order,
        return items or exchange items.


        This method is also a way to ensure synchronization with the backend.

        For example, if you request a state change from `ready` to `draft`, the
        backend will reject the state change if your order still matches all
        criteria to be ready.


        **Note:** You can call this method with an empty body to get the status
        of the payment(s).


        **Limitations:**


        * An order can only contain one shipping address and one billing
        address.

        * At most 100 items per order are allowed.

        * At most 10 payments can be provided per order.

        * At most 100 extended attributes can be provided per order.

        * At most one discount coupon can be applied per order.

        * At most one manual order-level adjustment can be applied per order.

        * At most one manual item-level adjustment can be applied per item.


        However, a coupon as well as a manual price adjustment can be applied
        together on the same order, even if both

        result in an order-level discount or an item-level discount (also if
        both discounts are applied on the same item).

        **Related resources:**

        - Use the [Orders](#orders) resource to retrieve the identifiers of the
        order and items to return.

        - Use the [User configuration](#user-configuration) resource to retrieve
        the configured return reasons, item conditions, and their corresponding
        codes.
      operationId: UpdateCart
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    returns:
                      description: Describes returned items if any.
                      anyOf:
                        - type: array
                          description: Returned items.
                          items:
                            type: object
                            anyOf:
                              - required:
                                  - order_id
                                  - item_id
                              - required:
                                  - blind_return
                            properties:
                              order_id:
                                type: string
                                description: >-
                                  The identifier of the order the item is part
                                  of.
                              item_id:
                                type: string
                                description: The identifier of the returned item.
                              return_reason:
                                type: string
                                nullable: true
                                description: The reason why this item is returned.
                              refund:
                                type: object
                                description: >-
                                  The preferred specifications for refund
                                  operation. When not specified the default
                                  refund configuration is used (e.g. refund on
                                  the original payment method).
                                properties:
                                  amount:
                                    type: number
                                    description: >-
                                      The amount which will be refunded,
                                      calculated based on the cart state. The
                                      amount cannot be specified beforehand. The
                                      amount includes shipping costs to be
                                      refunded if all items of the order are
                                      being returned, and the
                                      `refund_shipping_cost` configuration of
                                      `item_return` is set to `True`.
                                  metadata:
                                    type: object
                                    description: >-
                                      Extra information from the NewStore
                                      platform to attach to the refund method
                                      that is retrieved by the payment provider.
                                      For example, you could add the order
                                      identifier in this field to attach it to
                                      the Stripe charge. Talk to your contact
                                      point at NewStore for more information.
                                    maxProperties: 100
                                  available_methods:
                                    type: array
                                    description: >-
                                      The list of payment methods to perform a
                                      refund.
                                    items:
                                      type: string
                                      description: Name of a payment method.
                                  method:
                                    type: string
                                    description: >-
                                      The preferred refund method (e.g.
                                      gift_card).
                              blind_return:
                                type: object
                                title: Properties for the blind return
                                required:
                                  - product_id
                                properties:
                                  product_id:
                                    type: string
                                    description: >-
                                      ID of the product as fetched from the
                                      catalog.
                                    minLength: 1
                                    maxLength: 64
                                  external_order_id:
                                    type: string
                                    description: >-
                                      Order identifier from the different order
                                      management system rather than NewStore
                                    maxLength: 64
                                  adjusted_item_price:
                                    type: number
                                    description: >-
                                      Item price that was manually adjusted by
                                      the associate.
                                    minimum: 0
                                    exclusiveMinimum: true
                                  pricebook:
                                    type: string
                                    description: >-
                                      Identifier of the pricebook to use instead
                                      of the default pricebook.
                                    maxLength: 64
                                  extended_attributes:
                                    type: array
                                    description: >-
                                      Attributes set by the tenant that can be
                                      exported or displayed in NOM. These
                                      attributes do not impact the business
                                      logic of the NewStore platform.
                                    maxItems: 100
                                    items:
                                      type: object
                                      required:
                                        - name
                                      maxProperties: 2
                                      properties:
                                        name:
                                          type: string
                                          minLength: 1
                                          maxLength: 100
                                        value:
                                          type: string
                                          maxLength: 8192
                                  calculated_price:
                                    type: object
                                    description: >-
                                      Prices, taxes, and discounts calculated
                                      for the item.
                                    properties:
                                      item_price:
                                        description: >-
                                          Catalog price of the item. Can be
                                          affected by pricebooks and bundle
                                          pricing.
                                        type: number
                                        minimum: 0
                                      item_list_price:
                                        description: Price from the default pricebook.
                                        type: number
                                        minimum: 0
                                      item_tax_base:
                                        description: >-
                                          The price of the line item after
                                          applying discounts.
                                        type: number
                                        minimum: 0
                                      item_tax:
                                        description: The tax amount for the line item.
                                        type: number
                                        minimum: 0
                                      item_gross:
                                        description: >-
                                          The final gross amount for the line
                                          item.
                                        type: number
                                        minimum: 0
                                      item_discount:
                                        description: >-
                                          The item scope discount for this line
                                          item.
                                        type: number
                                        minimum: 0
                                      item_order_discount:
                                        description: >-
                                          The portion from the order scope
                                          discount distributed to this line item.
                                        type: number
                                        minimum: 0
                                      item_discount_info:
                                        anyOf:
                                          - type: array
                                            description: >-
                                              Information about item-level discounts
                                              applied to the line item.
                                            items:
                                              type: object
                                              properties:
                                                discount_ref:
                                                  type: string
                                                  description: >-
                                                    A string token identifying the discount,
                                                    e.g. BLACK_FRIDAY_SALE.
                                                  minLength: 1
                                                  maxLength: 256
                                                coupon_code:
                                                  description: Code of the coupon.
                                                  type: string
                                                  maxLength: 250
                                                description:
                                                  type: string
                                                  description: >-
                                                    Internal description of the coupon code.
                                                    Appears in the HQ app.
                                                  maxLength: 1024
                                                type:
                                                  type: string
                                                  description: Type of discount, fixed or percentage.
                                                  enum:
                                                    - fixed
                                                    - percentage
                                                scope:
                                                  type: string
                                                  description: >-
                                                    Scope of the discount. Describes whether
                                                    the discount is applied on a single
                                                    item, the entire order or on the
                                                    shipping price.
                                                  enum:
                                                    - order
                                                    - item
                                                    - shipping
                                                original_value:
                                                  description: >-
                                                    Discount applied. In the case of an item
                                                    discount, the discount is applied to the
                                                    item itself. In the case of an order
                                                    discount, the discount is applied to the
                                                    whole order.
                                                  type: number
                                                  minimum: 0
                                                price_adjustment:
                                                  description: >-
                                                    Monetary discount amount applied to the
                                                    current item.
                                                  type: number
                                                  minimum: 0
                                                discount_source:
                                                  description: >-
                                                    Source of discount e.g Automatic, Manual
                                                    e.t.c
                                                  type: string
                                                  enum:
                                                    - automatic
                                                    - coupon
                                                    - manual
                                          - nullable: true
                                      item_order_discount_info:
                                        anyOf:
                                          - type: array
                                            description: >-
                                              Information about order-level discounts
                                              applied to the line item.
                                            items:
                                              type: object
                                              properties:
                                                discount_ref:
                                                  type: string
                                                  description: >-
                                                    A string token identifying the discount,
                                                    e.g. BLACK_FRIDAY_SALE.
                                                  minLength: 1
                                                  maxLength: 256
                                                coupon_code:
                                                  description: Code of the coupon.
                                                  type: string
                                                  maxLength: 250
                                                description:
                                                  type: string
                                                  description: >-
                                                    Internal description of the coupon code.
                                                    Appears in the HQ app.
                                                  maxLength: 1024
                                                type:
                                                  type: string
                                                  description: Type of discount, fixed or percentage.
                                                  enum:
                                                    - fixed
                                                    - percentage
                                                scope:
                                                  type: string
                                                  description: >-
                                                    Scope of the discount. Describes whether
                                                    the discount is applied on a single
                                                    item, the entire order or on the
                                                    shipping price.
                                                  enum:
                                                    - order
                                                    - item
                                                    - shipping
                                                original_value:
                                                  description: >-
                                                    Discount applied. In the case of an item
                                                    discount, the discount is applied to the
                                                    item itself. In the case of an order
                                                    discount, the discount is applied to the
                                                    whole order.
                                                  type: number
                                                  minimum: 0
                                                price_adjustment:
                                                  description: >-
                                                    Monetary discount amount applied to the
                                                    current item.
                                                  type: number
                                                  minimum: 0
                                                discount_source:
                                                  description: >-
                                                    Source of discount e.g Automatic, Manual
                                                    e.t.c
                                                  type: string
                                                  enum:
                                                    - automatic
                                                    - coupon
                                                    - manual
                                          - nullable: true
                                      gift_wrapping_price:
                                        type: number
                                        description: >-
                                          Catalog price of gift wrapping if the
                                          product is wrapped.
                                        minimum: 0
                                      gift_wrapping_tax:
                                        type: number
                                        description: >-
                                          Tax of gift wrapping, if the product is
                                          wrapped.
                                        minimum: 0
                                  external_identifier:
                                    type: object
                                    description: >-
                                      The keys of this object are the names of
                                      identifying systems (sku, ean, epc, ...).
                                      The values are the identifiers themselves.
                                      The keys are automatically converted to
                                      lower case whenever provided as upper
                                      case.
                                    maxProperties: 100
                              was_blind:
                                type: boolean
                                description: >-
                                  A flag that indicates if the order was
                                  exchanged from a blind return order. In case
                                  of multiple exchanges of an order this flag
                                  would be inherited from the original order.
                              return_code:
                                type: integer
                                nullable: true
                                description: The code of the return reason.
                              item_condition:
                                type: string
                                nullable: true
                                description: The condition in which the item is returned.
                              condition_code:
                                type: integer
                                nullable: true
                                description: The code of the selected condition.
                        - nullable: true
                    state:
                      description: >-
                        Desired state of the order. Use 'draft' while patching
                        the order, use 'placed' to make an attempt to place the
                        order.
                      type: string
                      title: Order state
                      enum:
                        - draft
                        - ready
                        - placed
                        - accepted
                        - failed
                    shop:
                      type: string
                      nullable: true
                      description: The shop containing the items of the order.
                      maxLength: 128
                    shop_locale:
                      type: string
                      nullable: true
                      description: The locale used for the shop, in RFC 5646.
                      maxLength: 128
                    customer:
                      description: Personal information about the customer.
                      anyOf:
                        - nullable: true
                        - type: object
                          description: Customer.
                          properties:
                            id:
                              type: string
                              description: Customer identifier.
                            name:
                              type: string
                              description: Customer name.
                              maxLength: 128
                            email:
                              type: string
                              description: Customer email.
                              maxLength: 64
                            language:
                              description: >-
                                The code of the language to be used in
                                communicating with the customer in ISO 639-1
                                format, e.g. fr, de or en.
                              type: string
                              maxLength: 2
                            display_id:
                              type: string
                              description: Unique human readable identifier of the profile.
                    tax_exempt:
                      description: If true, the order is tax exempt.
                      type: boolean
                      default: false
                    billing_address:
                      description: >-
                        Billing address. If not set, the shipping address will
                        be used.
                      anyOf:
                        - type: object
                          description: Address.
                          properties:
                            title:
                              type: string
                              description: Title.
                              maxLength: 32
                            suffix:
                              type: string
                              description: Suffix.
                              maxLength: 32
                            salutation:
                              type: string
                              description: Salutation.
                              maxLength: 32
                            first_name:
                              type: string
                              description: First name.
                              maxLength: 64
                            last_name:
                              type: string
                              description: Last name.
                              maxLength: 64
                            country:
                              description: >-
                                The code of the country in the ISO 3166 ALPHA-2
                                format. For example, GB, DE or US.
                              type: string
                              minLength: 2
                              maxLength: 2
                            zip_code:
                              type: string
                              description: Zip code.
                              maxLength: 32
                            city:
                              type: string
                              description: City.
                              maxLength: 64
                            state:
                              type: string
                              description: State.
                              maxLength: 32
                            address_line_1:
                              type: string
                              description: First line of the address.
                              minLength: 1
                              maxLength: 128
                            address_line_2:
                              type: string
                              description: Second line of the address.
                              maxLength: 256
                            phone:
                              type: string
                              description: Phone number.
                              maxLength: 128
                        - nullable: true
                    store_id:
                      type: string
                      description: ID of the store where this order was placed.
                      maxLength: 256
                    price_modifiers:
                      description: Manual order level price adjustments and coupons.
                      anyOf:
                        - type: object
                          properties:
                            manual_price_modifier:
                              anyOf:
                                - nullable: true
                                - required:
                                    - action
                                    - value
                                  properties:
                                    action:
                                      description: Type of a price adjustment.
                                      type: string
                                      enum:
                                        - fixed
                                        - percentage
                                        - override
                                    value:
                                      type: number
                                      minimum: 0
                                      description: >-
                                        Value of the price adjustment, it could
                                        be fixed amount, percentage or override
                                        according to the value of the 'action'
                                        property.
                                    reason:
                                      type: string
                                      description: Description for the price adjustment.
                                      maxLength: 512
                                    reason_type:
                                      type: string
                                      description: >-
                                        Type of the reason for the price
                                        adjustment.
                                      enum:
                                        - custom_discount
                                        - reason_code
                                  type: object
                                  title: Manual price adjustment
                            coupons:
                              type: array
                              nullable: true
                              items:
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    description: Code of a coupon.
                                    maxLength: 250
                                    minLength: 1
                                type: object
                                title: Coupon
                        - nullable: true
                    extended_attributes:
                      description: >-
                        Attributes set by the tenant to be carried over to the
                        export APIs without affecting the business logic of the
                        NewStore platform.
                      anyOf:
                        - nullable: true
                        - type: array
                          maxItems: 100
                          items:
                            type: object
                            required:
                              - name
                            maxProperties: 2
                            properties:
                              name:
                                type: string
                                minLength: 1
                                maxLength: 100
                              value:
                                type: string
                                maxLength: 8192
                    channel:
                      description: Information about the source of the order.
                      anyOf:
                        - nullable: true
                        - type: object
                          description: >-
                            This schema represents the channels used by the
                            customer when they place an order. A channel is a
                            way of offering products or services to consumers
                            for sale, for example a mobile device, or a store.
                          required:
                            - type
                            - name
                          properties:
                            type:
                              type: string
                              description: >-
                                Identifies a channel. Typical values are 'web',
                                'mobile_ios', 'mobile_android'
                              minLength: 1
                              maxLength: 32
                            name:
                              description: >-
                                Name of the channel. The name is displayed in HQ
                                and can be used for sorting purposes in the
                                interface.
                              type: string
                              minLength: 1
                              maxLength: 64
                    products:
                      description: The list of products contained in the order.
                      anyOf:
                        - nullable: true
                        - type: array
                          items:
                            properties:
                              product_id:
                                type: string
                                description: >-
                                  ID of the product as it was fetched from the
                                  catalog.
                                minLength: 1
                                maxLength: 64
                              quantity:
                                type: integer
                                description: Quantity of this product ordered.
                                minimum: 1
                                default: 1
                              item_ids:
                                type: array
                                description: >-
                                  Unique identifiers which are generated by the
                                  server and assigned to every item. The number
                                  of identifiers always equals to the quantity.
                                  Item identifiers are generated anew upon every
                                  POST and PATCH request and returned as part of
                                  the response. Identifiers provided in the
                                  request are ignored.
                                maxLength: 100
                                items:
                                  type: string
                                  description: The identifier of the item.
                                  maxLength: 36
                              group_id:
                                description: >-
                                  Optional grouping information for calculating
                                  group (bundle) prices.
                                type: string
                                maxLength: 64
                              pricebook:
                                description: >-
                                  Overrides the default pricebook. When used
                                  together with group_id, affects the prorating
                                  of group (bundle) prices.
                                type: string
                                maxLength: 64
                              gift_wrapping:
                                type: object
                                description: >-
                                  Indicates if gift wrapping option was
                                  selected.
                                properties:
                                  message:
                                    description: >-
                                      Message to be attached to the gift-wrapped
                                      order. Its length is configurable per
                                      tenant.
                                    type: string
                                    maxLength: 512
                              manual_price_modifier:
                                required:
                                  - action
                                  - value
                                properties:
                                  action:
                                    description: Type of a price adjustment.
                                    type: string
                                    enum:
                                      - fixed
                                      - percentage
                                      - override
                                  value:
                                    type: number
                                    minimum: 0
                                    description: >-
                                      Value of the price adjustment, it could be
                                      fixed amount, percentage or override
                                      according to the value of the 'action'
                                      property.
                                  reason:
                                    type: string
                                    description: Description for the price adjustment.
                                    maxLength: 512
                                  reason_type:
                                    type: string
                                    description: >-
                                      Type of the reason for the price
                                      adjustment.
                                    enum:
                                      - custom_discount
                                      - reason_code
                                type: object
                                title: Manual price adjustment
                                description: Item level manual price adjustment.
                              extended_attributes:
                                type: array
                                description: >-
                                  Attributes set by the tenant to be carried
                                  over to the export APIs without affecting the
                                  business logic of the NewStore platform.
                                maxItems: 100
                                items:
                                  type: object
                                  required:
                                    - name
                                  maxProperties: 2
                                  properties:
                                    name:
                                      type: string
                                      minLength: 1
                                      maxLength: 100
                                    value:
                                      type: string
                                      maxLength: 8192
                              calculated_price:
                                type: object
                                description: >-
                                  Prices, taxes, and discounts calculated for
                                  the item. The object is ignored upon request.
                                properties:
                                  item_price:
                                    description: >-
                                      Catalog price of the item. Can be affected
                                      by pricebooks and bundle pricing.
                                    type: number
                                    minimum: 0
                                  item_list_price:
                                    description: Price from the default pricebook.
                                    type: number
                                    minimum: 0
                                  item_tax_base:
                                    description: >-
                                      The price of the line item after applying
                                      discounts.
                                    type: number
                                    minimum: 0
                                  item_tax:
                                    description: The tax amount for the line item.
                                    type: number
                                    minimum: 0
                                  item_gross:
                                    description: The final gross amount for the line item.
                                    type: number
                                    minimum: 0
                                  item_discount:
                                    description: >-
                                      The item scope discount for this line
                                      item.
                                    type: number
                                    minimum: 0
                                  item_order_discount:
                                    description: >-
                                      The portion from the order scope discount
                                      distributed to this line item.
                                    type: number
                                    minimum: 0
                                  item_discount_info:
                                    anyOf:
                                      - type: array
                                        description: >-
                                          Information about item-level discounts
                                          applied to the line item.
                                        items:
                                          type: object
                                          properties:
                                            discount_ref:
                                              type: string
                                              description: >-
                                                A string token identifying the discount,
                                                e.g. BLACK_FRIDAY_SALE.
                                              minLength: 1
                                              maxLength: 256
                                            coupon_code:
                                              description: Code of the coupon.
                                              type: string
                                              maxLength: 250
                                            description:
                                              type: string
                                              description: >-
                                                Internal description of the coupon code.
                                                Appears in the HQ app.
                                              maxLength: 1024
                                            type:
                                              type: string
                                              description: Type of discount, fixed or percentage.
                                              enum:
                                                - fixed
                                                - percentage
                                            scope:
                                              type: string
                                              description: >-
                                                Scope of the discount. Describes whether
                                                the discount is applied on a single
                                                item, the entire order or on the
                                                shipping price.
                                              enum:
                                                - order
                                                - item
                                                - shipping
                                            original_value:
                                              description: >-
                                                Discount applied. In the case of an item
                                                discount, the discount is applied to the
                                                item itself. In the case of an order
                                                discount, the discount is applied to the
                                                whole order.
                                              type: number
                                              minimum: 0
                                            price_adjustment:
                                              description: >-
                                                Monetary discount amount applied to the
                                                current item.
                                              type: number
                                              minimum: 0
                                            discount_source:
                                              description: >-
                                                Source of discount e.g Automatic, Manual
                                                e.t.c
                                              type: string
                                              enum:
                                                - automatic
                                                - coupon
                                                - manual
                                      - nullable: true
                                  item_order_discount_info:
                                    anyOf:
                                      - type: array
                                        description: >-
                                          Information about order-level discounts
                                          applied to the line item.
                                        items:
                                          type: object
                                          properties:
                                            discount_ref:
                                              type: string
                                              description: >-
                                                A string token identifying the discount,
                                                e.g. BLACK_FRIDAY_SALE.
                                              minLength: 1
                                              maxLength: 256
                                            coupon_code:
                                              description: Code of the coupon.
                                              type: string
                                              maxLength: 250
                                            description:
                                              type: string
                                              description: >-
                                                Internal description of the coupon code.
                                                Appears in the HQ app.
                                              maxLength: 1024
                                            type:
                                              type: string
                                              description: Type of discount, fixed or percentage.
                                              enum:
                                                - fixed
                                                - percentage
                                            scope:
                                              type: string
                                              description: >-
                                                Scope of the discount. Describes whether
                                                the discount is applied on a single
                                                item, the entire order or on the
                                                shipping price.
                                              enum:
                                                - order
                                                - item
                                                - shipping
                                            original_value:
                                              description: >-
                                                Discount applied. In the case of an item
                                                discount, the discount is applied to the
                                                item itself. In the case of an order
                                                discount, the discount is applied to the
                                                whole order.
                                              type: number
                                              minimum: 0
                                            price_adjustment:
                                              description: >-
                                                Monetary discount amount applied to the
                                                current item.
                                              type: number
                                              minimum: 0
                                            discount_source:
                                              description: >-
                                                Source of discount e.g Automatic, Manual
                                                e.t.c
                                              type: string
                                              enum:
                                                - automatic
                                                - coupon
                                                - manual
                                      - nullable: true
                                  gift_wrapping_price:
                                    type: number
                                    description: >-
                                      Catalog price of gift wrapping if the
                                      product is wrapped.
                                    minimum: 0
                                  gift_wrapping_tax:
                                    type: number
                                    description: >-
                                      Tax of gift wrapping, if the product is
                                      wrapped.
                                    minimum: 0
                              external_identifiers:
                                type: array
                                description: >-
                                  A list of external identifiers. There should
                                  be the same number of items in this array as
                                  the number defined in the 'quantity' property.
                                items:
                                  type: object
                                  description: >-
                                    The keys of this object are the names of
                                    identifying systems (sku, ean, epc, ...).
                                    The values are the identifiers themselves.
                                    The keys are automatically converted to
                                    lower case whenever provided as upper case.
                                  maxProperties: 100
                              fulfillment_group:
                                description: >-
                                  Fulfillment group of the product. Use it in
                                  the context of mixed cart to differentiate
                                  products for in store handover and for
                                  shipping.
                                type: object
                                title: Fulfillment group
                                required:
                                  - type
                                properties:
                                  type:
                                    description: >-
                                      Defines if the product is picked-up by the
                                      customer or shipped to them.
                                    type: string
                                    enum:
                                      - IN_STORE_HANDOVER
                                      - SHIPPING
                            type: object
                            required:
                              - product_id
                    payments:
                      type: object
                      description: >-
                        Payment data blocks, each has the identifier provided as
                        the key. The identifier depends on the 'type' property
                        of the payment. When type is 'token', use the payment
                        token. When type is 'authorized', use the charge
                        identifier. When type is 'captured', use the capture
                        identifier. Payments can be modified by these
                        identifiers. Payment statuses are reported per
                        identifier.
                    shipping_address:
                      description: Shipping address.
                      anyOf:
                        - type: object
                          description: Address.
                          properties:
                            title:
                              type: string
                              description: Title.
                              maxLength: 32
                            suffix:
                              type: string
                              description: Suffix.
                              maxLength: 32
                            salutation:
                              type: string
                              description: Salutation.
                              maxLength: 32
                            first_name:
                              type: string
                              description: First name.
                              maxLength: 64
                            last_name:
                              type: string
                              description: Last name.
                              maxLength: 64
                            country:
                              description: >-
                                The code of the country in the ISO 3166 ALPHA-2
                                format. For example, GB, DE or US.
                              type: string
                              minLength: 2
                              maxLength: 2
                            zip_code:
                              type: string
                              description: Zip code.
                              maxLength: 32
                            city:
                              type: string
                              description: City.
                              maxLength: 64
                            state:
                              type: string
                              description: State.
                              maxLength: 32
                            address_line_1:
                              type: string
                              description: First line of the address.
                              minLength: 1
                              maxLength: 128
                            address_line_2:
                              type: string
                              description: Second line of the address.
                              maxLength: 256
                            phone:
                              type: string
                              description: Phone number.
                              maxLength: 128
                        - nullable: true
                    manager_approval:
                      description: >-
                        Describes if the order needs an approval, before it is
                        placed.
                      anyOf:
                        - type: object
                          properties:
                            approved_by:
                              type: string
                              description: >-
                                The identifier of the store associate who
                                approved the order.
                              minLength: 1
                            approved_rules:
                              type: array
                              description: The list of rules that are already approved.
                              items:
                                type: string
                            matched_rules:
                              type: array
                              description: >-
                                The list of approval rules that are applicable
                                to the order.
                              items:
                                type: object
                                description: The identifier of the approval rule.
                                properties:
                                  label:
                                    type: string
                                    description: The identifier of the approval rule.
                                  description:
                                    type: string
                                    description: >-
                                      The human readable description to display
                                      the rule on frontend applications.
                                  restricted_payment_methods:
                                    type: array
                                    description: >-
                                      The list of payment methods that require
                                      manager approval in order to be processed
                                      when this rule matches.
                                    items:
                                      description: Name of the payment method.
                                      type: string
                                      enum:
                                        - cash
                                        - credit_card
                                        - manual_credit_card
                                        - non_integrated
                                        - gift_card
                        - nullable: true
                    associate_id:
                      type: string
                      nullable: true
                      description: ID of the store associate who processed this order.
                      maxLength: 256
                    currency:
                      description: >-
                        The currency for all the prices contained within this
                        payload.
                      anyOf:
                        - type: string
                        - nullable: true
                - properties:
                    shipping_solution_id:
                      type: string
                      nullable: true
                      description: >-
                        Identifies shipping solution for the order. Can be
                        'in_store_handover' when no shipping is required or one
                        of the identifiers returned by the
                        /order/{id}/shipping_solutions endpoint.
                      maxLength: 64
        required: true
    parameters:
      - name: id
        in: path
        required: true
        schema:
          pattern: >-
            ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
        description: >
          UUID-like identifier for the cart. The id is returned when you call
          the [Create cart](#carts-create-cart) method.
  /orders/{id}/shipping_solutions:
    post:
      summary: Get shipping solutions
      security:
        - newStoreAccessToken: []
      responses:
        '200':
          description: The available shipping solutions have been returned successfully.
          content:
            application/json:
              schema:
                type: object
                required:
                  - shipping_solutions
                properties:
                  shipping_solutions:
                    type: object
                    description: >-
                      Available shipping solutions identified by server assigned
                      identifiers. Submit one of the identifiers with the order
                      to use this shipping solution.
                    maxProperties: 512
        '400':
          description: Invalid syntax for order identifier (non-UUID).
          content:
            application/json:
              example:
                schema:
                  error_code: invalid_uuid
                  message: 'invalid uuid for parameter id: EXT12345'
                  request_id: 7ed369b7-f33b-48c2-b1c3-b4c9b29ca220
              schema:
                type: object
                required:
                  - error_code
                  - message
                  - request_id
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
                  request_id:
                    description: >-
                      Unique request identifier which caused the error. Can be
                      used to further debug the root causes of this error.
                    type: string
        '404':
          description: The order was not found.
        '500':
          description: An internal error occurred.
      description: |
        Generates shipping solutions for the order. If there are any
        shipping discounts on the order, they will be applied to the
        shipping solutions. Tax is not calculated on the shipping
        solution generation. The tax is only calculated when the
        shipping solution is added to the order.
      operationId: GetShippingSolutions
    parameters:
      - name: id
        in: path
        required: true
        schema:
          pattern: >-
            ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
        description: >
          UUID-like identifier for the cart. The id is returned when you call
          the [Create cart](#carts-create-cart) method.
  /orders/{id}/documents:
    get:
      summary: Get document
      security:
        - newStoreAccessToken: []
      responses:
        '200':
          description: >-
            Successfully returned the document url together with the document
            type.
          content:
            application/json:
              example:
                schema:
                  document_url: >-
                    https://dodici.d.newstore.net/v0/d/documents/e28f282d-428f-4aee-ab1e-e32b89f17562
                  document_type: sales_receipt
              schema:
                type: object
                required:
                  - document_type
                  - document_url
                properties:
                  document_url:
                    type: string
                    description: The url of the document.
                  document_type:
                    type: string
                    description: >-
                      The type of the document e.g 'refund_note',
                      'sales_receipt', 'exchange_receipt'.
        '400':
          description: Invalid syntax for order identifier (non-UUID).
          content:
            application/json:
              example:
                schema:
                  error_code: invalid_uuid
                  message: 'invalid uuid for parameter id: EXT12345'
                  request_id: 7ed369b7-f33b-48c2-b1c3-b4c9b29ca220
              schema:
                type: object
                required:
                  - error_code
                  - message
                  - request_id
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
                  request_id:
                    description: >-
                      Unique request identifier which caused the error. Can be
                      used to further debug the root causes of this error.
                    type: string
        '404':
          description: The document or order was not found.
          content:
            application/json:
              example:
                schema:
                  error_code: not_found
                  message: The requested document could not be found.
                  request_id: 2018.10.18
              schema:
                type: object
                required:
                  - error_code
                  - message
                  - request_id
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
                  request_id:
                    description: >-
                      Unique request identifier which caused the error. Can be
                      used to further debug the root causes of this error.
                    type: string
        '500':
          description: An internal error occurred.
          content:
            application/json:
              example:
                schema:
                  error_code: server_error
                  message: An internal server error happened.
                  request_id: 2018.10.18
              schema:
                type: object
                required:
                  - error_code
                  - message
                  - request_id
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
                  request_id:
                    description: >-
                      Unique request identifier which caused the error. Can be
                      used to further debug the root causes of this error.
                    type: string
      description: |
        Retrieves the document related to the provided cart id.

        The type of document you get depends on the what the cart was used for:

        - A cart used to place an order: you retrieve a sales receipt.
        - A cart used for a return, you retrieve a refund note.
        - A cart used to exchange some items, you retrieve an exchange receipt.
      operationId: GetDocument
    parameters:
      - name: id
        in: path
        required: true
        schema:
          pattern: >-
            ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
        description: >
          UUID-like identifier for the cart. The id is returned when you call
          the [Create cart](#carts-create-cart) method.
  /orders/{id}/documents/_send:
    post:
      summary: Send document
      security:
        - newStoreAccessToken: []
      responses:
        '202':
          description: >-
            The document for the current transaction has been accepted for
            sending.
        '400':
          description: The provided request is invalid.
          content:
            application/json:
              example:
                schema:
                  error_code: bad_request
                  message: The provided request is invalid.
                  request_id: 2018.10.18
              schema:
                type: object
                required:
                  - error_code
                  - message
                  - request_id
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
                  request_id:
                    description: >-
                      Unique request identifier which caused the error. Can be
                      used to further debug the root causes of this error.
                    type: string
        '404':
          description: The document or order was not found.
          content:
            application/json:
              example:
                schema:
                  error_code: not_found
                  message: The requested document could not be found.
                  request_id: 2018.10.18
              schema:
                type: object
                required:
                  - error_code
                  - message
                  - request_id
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
                  request_id:
                    description: >-
                      Unique request identifier which caused the error. Can be
                      used to further debug the root causes of this error.
                    type: string
        '500':
          description: An internal error occurred.
          content:
            application/json:
              example:
                schema:
                  error_code: server_error
                  message: An internal server error happened.
                  request_id: 2018.10.18
              schema:
                type: object
                required:
                  - error_code
                  - message
                  - request_id
                properties:
                  error_code:
                    description: A code describing the error.
                    type: string
                    minLength: 1
                  message:
                    description: A human-readable error message.
                    type: string
                  request_id:
                    description: >-
                      Unique request identifier which caused the error. Can be
                      used to further debug the root causes of this error.
                    type: string
      description: >
        Sends the document related to the provided cart id to the provided email
        address.


        The type of document depends on the what the cart was used for:


        - A cart used to place an order: a sales receipt is sent.

        - A cart used for a return, a refund note is sent.

        - A cart used to exchange some items, an exchange receipt is sent.
      operationId: SendDocument
      requestBody:
        content:
          application/json:
            example:
              schema:
                email: customer@example.org
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  description: The email address the document is sent to.
                force_send:
                  type: boolean
                  description: >-
                    If it is set to true, the email would be sent even if it was
                    sent before.
        required: true
    parameters:
      - name: id
        in: path
        required: true
        schema:
          pattern: >-
            ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          type: string
        description: >
          UUID-like identifier for the cart. The id is returned when you call
          the [Create cart](#carts-create-cart) method.
components:
  schemas: {}
  responses: {}
  parameters: {}
  examples: {}
  requestBodies: {}
  headers: {}
  securitySchemes:
    newStoreAccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
  links: {}
  callbacks: {}
