Commerce Layer orders API

resource type

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

commerce-layer-orders-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Commerce Layer addresses orders API
  version: 7.10.1
  contact:
    name: API Support
    url: https://commercelayer.io
    email: support@commercelayer.io
  description: Headless Commerce for Global Brands.
servers:
- url: https://{your_organization_slug}.commercelayer.io/api
  description: API
- url: https://core.commercelayer.io/users/sign_in
  description: Sign in
- url: https://docs.commercelayer.io/api
  description: API reference
security:
- bearerAuth: []
tags:
- name: orders
  description: resource type
paths:
  /adyen_payments/{adyenPaymentId}/order:
    get:
      operationId: GET/adyenPaymentId/order
      summary: Retrieve the order associated to the adyen payment
      description: Retrieve the order associated to the adyen payment
      tags:
      - orders
      parameters:
      - name: adyenPaymentId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the adyen payment
  /authorizations/{authorizationId}/order:
    get:
      operationId: GET/authorizationId/order
      summary: Retrieve the order associated to the authorization
      description: Retrieve the order associated to the authorization
      tags:
      - orders
      parameters:
      - name: authorizationId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the authorization
  /axerve_payments/{axervePaymentId}/order:
    get:
      operationId: GET/axervePaymentId/order
      summary: Retrieve the order associated to the axerve payment
      description: Retrieve the order associated to the axerve payment
      tags:
      - orders
      parameters:
      - name: axervePaymentId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the axerve payment
  /braintree_payments/{braintreePaymentId}/order:
    get:
      operationId: GET/braintreePaymentId/order
      summary: Retrieve the order associated to the braintree payment
      description: Retrieve the order associated to the braintree payment
      tags:
      - orders
      parameters:
      - name: braintreePaymentId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the braintree payment
  /captures/{captureId}/order:
    get:
      operationId: GET/captureId/order
      summary: Retrieve the order associated to the capture
      description: Retrieve the order associated to the capture
      tags:
      - orders
      parameters:
      - name: captureId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the capture
  /checkout_com_payments/{checkoutComPaymentId}/order:
    get:
      operationId: GET/checkoutComPaymentId/order
      summary: Retrieve the order associated to the checkout.com payment
      description: Retrieve the order associated to the checkout.com payment
      tags:
      - orders
      parameters:
      - name: checkoutComPaymentId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the checkout.com payment
  /customers/{customerId}/orders:
    get:
      operationId: GET/customerId/orders
      summary: Retrieve the orders associated to the customer
      description: Retrieve the orders associated to the customer
      tags:
      - orders
      parameters:
      - name: customerId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The orders associated to the customer
  /discount_engine_items/{discountEngineItemId}/order:
    get:
      operationId: GET/discountEngineItemId/order
      summary: Retrieve the order associated to the discount engine item
      description: Retrieve the order associated to the discount engine item
      tags:
      - orders
      parameters:
      - name: discountEngineItemId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the discount engine item
  /external_payments/{externalPaymentId}/order:
    get:
      operationId: GET/externalPaymentId/order
      summary: Retrieve the order associated to the external payment
      description: Retrieve the order associated to the external payment
      tags:
      - orders
      parameters:
      - name: externalPaymentId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the external payment
  /klarna_payments/{klarnaPaymentId}/order:
    get:
      operationId: GET/klarnaPaymentId/order
      summary: Retrieve the order associated to the klarna payment
      description: Retrieve the order associated to the klarna payment
      tags:
      - orders
      parameters:
      - name: klarnaPaymentId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the klarna payment
  /line_items/{lineItemId}/order:
    get:
      operationId: GET/lineItemId/order
      summary: Retrieve the order associated to the line item
      description: Retrieve the order associated to the line item
      tags:
      - orders
      parameters:
      - name: lineItemId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the line item
  /order_copies/{orderCopyId}/source_order:
    get:
      operationId: GET/orderCopyId/source_order
      summary: Retrieve the source order associated to the order copy
      description: Retrieve the source order associated to the order copy
      tags:
      - orders
      parameters:
      - name: orderCopyId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The source_order associated to the order copy
  /order_copies/{orderCopyId}/target_order:
    get:
      operationId: GET/orderCopyId/target_order
      summary: Retrieve the target order associated to the order copy
      description: Retrieve the target order associated to the order copy
      tags:
      - orders
      parameters:
      - name: orderCopyId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The target_order associated to the order copy
  /order_factories/{orderFactoryId}/source_order:
    get:
      operationId: GET/orderFactoryId/source_order
      summary: Retrieve the source order associated to the order factory
      description: Retrieve the source order associated to the order factory
      tags:
      - orders
      parameters:
      - name: orderFactoryId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The source_order associated to the order factory
  /order_factories/{orderFactoryId}/target_order:
    get:
      operationId: GET/orderFactoryId/target_order
      summary: Retrieve the target order associated to the order factory
      description: Retrieve the target order associated to the order factory
      tags:
      - orders
      parameters:
      - name: orderFactoryId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The target_order associated to the order factory
  /order_subscriptions/{orderSubscriptionId}/source_order:
    get:
      operationId: GET/orderSubscriptionId/source_order
      summary: Retrieve the source order associated to the order subscription
      description: Retrieve the source order associated to the order subscription
      tags:
      - orders
      parameters:
      - name: orderSubscriptionId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The source_order associated to the order subscription
  /order_subscriptions/{orderSubscriptionId}/orders:
    get:
      operationId: GET/orderSubscriptionId/orders
      summary: Retrieve the orders associated to the order subscription
      description: Retrieve the orders associated to the order subscription
      tags:
      - orders
      parameters:
      - name: orderSubscriptionId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The orders associated to the order subscription
  /orders:
    get:
      operationId: GET/orders
      summary: List all orders
      description: List all orders
      tags:
      - orders
      responses:
        '200':
          description: A list of order objects
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/orderResponseList'
    post:
      operationId: POST/orders
      summary: Create an order
      description: Create an order
      tags:
      - orders
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/orderCreate'
      responses:
        '201':
          description: The created order object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/orderResponse'
  /orders/{orderId}:
    get:
      operationId: GET/orders/orderId
      summary: Retrieve an order
      description: Retrieve an order
      tags:
      - orders
      parameters:
      - name: orderId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/orderResponse'
    patch:
      operationId: PATCH/orders/orderId
      summary: Update an order
      description: Update an order
      tags:
      - orders
      parameters:
      - name: orderId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/orderUpdate'
      responses:
        '200':
          description: The updated order object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/orderResponse'
    delete:
      operationId: DELETE/orders/orderId
      summary: Delete an order
      description: Delete an order
      tags:
      - orders
      parameters:
      - name: orderId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '204':
          description: No content
  /payment_options/{paymentOptionId}/order:
    get:
      operationId: GET/paymentOptionId/order
      summary: Retrieve the order associated to the payment option
      description: Retrieve the order associated to the payment option
      tags:
      - orders
      parameters:
      - name: paymentOptionId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the payment option
  /paypal_payments/{paypalPaymentId}/order:
    get:
      operationId: GET/paypalPaymentId/order
      summary: Retrieve the order associated to the paypal payment
      description: Retrieve the order associated to the paypal payment
      tags:
      - orders
      parameters:
      - name: paypalPaymentId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the paypal payment
  /recurring_order_copies/{recurringOrderCopyId}/source_order:
    get:
      operationId: GET/recurringOrderCopyId/source_order
      summary: Retrieve the source order associated to the recurring order copy
      description: Retrieve the source order associated to the recurring order copy
      tags:
      - orders
      parameters:
      - name: recurringOrderCopyId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The source_order associated to the recurring order copy
  /recurring_order_copies/{recurringOrderCopyId}/target_order:
    get:
      operationId: GET/recurringOrderCopyId/target_order
      summary: Retrieve the target order associated to the recurring order copy
      description: Retrieve the target order associated to the recurring order copy
      tags:
      - orders
      parameters:
      - name: recurringOrderCopyId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The target_order associated to the recurring order copy
  /refunds/{refundId}/order:
    get:
      operationId: GET/refundId/order
      summary: Retrieve the order associated to the refund
      description: Retrieve the order associated to the refund
      tags:
      - orders
      parameters:
      - name: refundId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the refund
  /returns/{returnId}/order:
    get:
      operationId: GET/returnId/order
      summary: Retrieve the order associated to the return
      description: Retrieve the order associated to the return
      tags:
      - orders
      parameters:
      - name: returnId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the return
  /satispay_payments/{satispayPaymentId}/order:
    get:
      operationId: GET/satispayPaymentId/order
      summary: Retrieve the order associated to the satispay payment
      description: Retrieve the order associated to the satispay payment
      tags:
      - orders
      parameters:
      - name: satispayPaymentId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the satispay payment
  /shipments/{shipmentId}/order:
    get:
      operationId: GET/shipmentId/order
      summary: Retrieve the order associated to the shipment
      description: Retrieve the order associated to the shipment
      tags:
      - orders
      parameters:
      - name: shipmentId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the shipment
  /stock_reservations/{stockReservationId}/order:
    get:
      operationId: GET/stockReservationId/order
      summary: Retrieve the order associated to the stock reservation
      description: Retrieve the order associated to the stock reservation
      tags:
      - orders
      parameters:
      - name: stockReservationId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the stock reservation
  /stores/{storeId}/orders:
    get:
      operationId: GET/storeId/orders
      summary: Retrieve the orders associated to the store
      description: Retrieve the orders associated to the store
      tags:
      - orders
      parameters:
      - name: storeId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The orders associated to the store
  /stripe_payments/{stripePaymentId}/order:
    get:
      operationId: GET/stripePaymentId/order
      summary: Retrieve the order associated to the stripe payment
      description: Retrieve the order associated to the stripe payment
      tags:
      - orders
      parameters:
      - name: stripePaymentId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the stripe payment
  /transactions/{transactionId}/order:
    get:
      operationId: GET/transactionId/order
      summary: Retrieve the order associated to the transaction
      description: Retrieve the order associated to the transaction
      tags:
      - orders
      parameters:
      - name: transactionId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the transaction
  /voids/{voidId}/order:
    get:
      operationId: GET/voidId/order
      summary: Retrieve the order associated to the void
      description: Retrieve the order associated to the void
      tags:
      - orders
      parameters:
      - name: voidId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the void
  /wire_transfers/{wireTransferId}/order:
    get:
      operationId: GET/wireTransferId/order
      summary: Retrieve the order associated to the wire transfer
      description: Retrieve the order associated to the wire transfer
      tags:
      - orders
      parameters:
      - name: wireTransferId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The order associated to the wire transfer
  /orders/breakdown:
    post:
      operationId: POST/orders/breakdown
      summary: Query breakdown on orders
      description: "Breakdowns are aggregations that summarize your data as metrics (based on specific operators) or statistics, computed on field values. When performing a breakdown query on the Metrics API endpoint you get in the response the value of the computation (based on the selected operator) on the selected field, aggregated by another field.\r\n\r\n### Nesting breakdowns\r\nBreakdowns can be nested recursively one into the other, up to one level (see example). The valid values allowed for the by key of the nested breakdown are strictly dependent on the value you specified in the by key of the parent breakdown. Hence, they are different for each resource you’re doing statistics on (see orders, returns, and carts for the related lists).You cannot group the nested breakdown by the same field by which you’re already grouping the parent breakdown.\r\n\r\nSingle breakdown request\r\n\r\n`{\r\n\t\"breakdown\": {\r\n\t  \"by\": \"market.name\",\r\n\t  \"field\": \"order.id\",\r\n\t  \"operator\": \"value_count\",\r\n\t  \"condition\": {\r\n\t    \"gte_lte\": [ 10000, 100000 ]\r\n\t  },\r\n\t  \"sort\": \"desc\",\r\n\t  \"limit\": 2\r\n\t}\r\n}`\r\n  \r\n  \r\n Nested breakdown request\r\n \r\n` {\r\n    \"breakdown\": {\r\n      \"by\": \"market.name\",\r\n      \"field\": \"order.id\",\r\n      \"operator\": \"value_count\",\r\n      \"condition\": {\r\n        \"gte_lte\": [ 10000, 100000 ]  \r\n      },\r\n      \"sort\": \"desc\",\r\n      \"limit\": 3,\r\n      \"breakdown\": {\r\n        \"by\": \"order.currency_code\",\r\n        \"field\": \"order.total_amount_with_taxes\",\r\n        \"operator\": \"sum\"\r\n        \"sort\": \"desc\",\r\n        \"limit\": 2\r\n      }\r\n    }\r\n  }`"
      tags:
      - orders
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/orders_breakdown_request'
      responses:
        '200':
          description: The breakdown result from orders
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    oneOf:
                    - type: object
                      properties:
                        billing_address.business:
                          type: array
                          items:
                            type: object
                            properties:
                              label:
                                type: string
                              value:
                                oneOf:
                                - type: number
                                  example: 8
                                - type: string
                                - type: object
                                  properties:
                                    count:
                                      type: number
                                      example: 8
                                    min:
                                      type: number
                                      example: 8
                                    max:
                                      type: number
                                      example: 8
                                    avg:
                                      type: number
                                      example: 8
                                    sum:
                                      type: number
                                      example: 8
                            additionalProperties:
                              type: object
                              properties:
                                label:
                                  type: string
                                value:
                                  oneOf:
                                  - type: number
                                    example: 8
                                  - type: string
                                  - type: object
                                    properties:
                                      count:
                                        type: number
                                        example: 8
                                      min:
                                        type: number
                                        example: 8
                                      max:
                                        type: number
                                        example: 8
                                      avg:
                                        type: number
                                        example: 8
                                      sum:
                                        type: number
                                        example: 8
                    - type: object
                      properties:
                        billing_address.city:
                          type: array
                          items:
                            type: object
                            properties:
                              label:
                                type: string
                              value:
                                oneOf:
                                - type: number
                                  example: 8
                                - type: string
                                - type: object
                                  properties:
                                    count:
                                      type: number
                                      example: 8
                                    min:
                                      type: number
                                      example: 8
                                    max:
                                      type: number
                                      example: 8
                                    avg:
                                      type: number
                                      example: 8
                                    sum:
                                      type: number
                                      example: 8
                            additionalProperties:
                              type: object
                              properties:
                                label:
                                  type: string
                                value:
                                  oneOf:
                                  - type: number
                                    example: 8
                                  - type: string
                                  - type: object
                                    properties:
                                      count:
                                        type: number
                                        example: 8
                                      min:
                                        type: number
                                        example: 8
                                      max:
                                        type: number
                                        example: 8
                                      avg:
                                        type: number
                                        example: 8
                                      sum:
                                        type: number
                                        example: 8
                    - type: object
                      properties:
                        billing_address.country_code:
                          type: array
                          items:
                            type: object
                            properties:
                              label:
                                type: string
                              value:
                                oneOf:
                                - type: number
                                  example: 8
                                - type: string
                                - type: object
                                  properties:
                                    count:
                                      type: number
                                      example: 8
                                    min:
                                      type: number
                                      example: 8
                                    max:
                                      type: number
                                      example: 8
                                    avg:
                                      type: number
                                      example: 8
                                    sum:
                                      type: number
                                      example: 8
                            additionalProperties:
                              type: object
                              properties:
                                label:
                                  type: string
                                value:
                                  oneOf:
                                  - type: number
                                    example: 8
                                  - type: string
                                  - type: object
                                    properties:
                                      count:
                                        type: number
                                        example: 8
                                      min:
                                        type: number
                                        example: 8
                                      max:
                                        type: number
                                        example: 8
                                      avg:
                                        type: number
                                        example: 8
                                      sum:
                                        type: number
                                        example: 8
                    - type: object
                      properties:
                        billing_address.geocoded:
                          type: array
                          items:
                            type: object
                            properties:
                              label:
                                type: string
                              value:
                                oneOf:
                                - type: number
                                  example: 8
                                - type: string
                                - type: object
                                  properties:
                                    count:
                                      type: number
                                      example: 8
                                    min:
                                      type: number
                                      example: 8
                                    max:
                                      type: number
                                      example: 8
                                    avg:
                                      type: number
                                      example: 8
                                    sum:
                                      type: number
                                      example: 8
                            additionalProperties:
                              type: object
                              properties:
                                label:
                                  type: string
                                value:
                                  oneOf:
                                  - type: number
                                    example: 8
                                  - type: string
                                  - type: object
                                    properties:
                                      count:
                                        type: number
                                        example: 8
                                      min:
                                        type: number
                                        example: 8
                                      max:
                                        type: number
                                        example: 8
                                      avg:
                                        type: number
                                        example: 8
                                      sum:
                                        type: number
                                        example: 8
                    - type: object
                      properties:
                        billing_address.localized:
                          type: array
                          items:
                            type: object
                            properties:
                              label:
                                type: string
                              value:
                                

# --- truncated at 32 KB (871 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/commerce-layer/refs/heads/main/openapi/commerce-layer-orders-api-openapi.yml