orders

Create an order

post/orders

Request

  • Base URL
    https://{your_organization_slug}.commercelayer.io/api
  • URL
    https://{your_organization_slug}.commercelayer.io/api/orders
  • Auth
    HTTP bearer

Request body

Example request

{
  "data": {
    "attributes": {
      "number": "1234",
      "affiliate_code": "xxxx-yyyy-zzzz",
      "autorefresh": true,
      "place_async": true,
      "guest": true,
      "customer_email": "john@example.com",
      "customer_password": "secret",
      "language_code": "it",
      "freight_taxable": true,
      "payment_method_taxable": true,
      "adjustment_taxable": true,
      "shipping_country_code_lock": "IT",
      "coupon_code": "SUMMERDISCOUNT",
      "gift_card_code": "cc92c23e-967e-48b2-a323-59add603301f",
      "gift_card_or_coupon_code": "cc92c23e-967e-48b2-a323-59add603301f",
      "cart_url": "https://yourdomain.com/cart",
      "return_url": "https://yourdomain.com/",
      "terms_url": "https://yourdomain.com/terms",
      "privacy_url": "https://yourdomain.com/privacy",
      "expires_at": "2018-01-02T12:00:00.000Z",
      "expiration_info": {
        "summary_message": "Your tickets are reserved for the remaining time.",
        "expired_message": "Your session has expired. Please start your checkout again.",
        "redirect_url": "https://yourshop.com/"
      },
      "reference": "ANY-EXTERNAL-REFEFERNCE",
      "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
      "metadata": {
        "foo": "bar"
      }
    },
    "relationships": {
      "market": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "customer": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "shipping_address": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "billing_address": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "store": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "payment_method": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "payment_source": {
        "data": {
          "id": "XAyRWNUzyN",
          "attributes": {
            "public_key": "xxxx-yyyy-zzzz",
            "payment_methods": {
              "foo": "bar"
            },
            "payment_request_data": {
              "foo": "bar"
            },
            "payment_request_details": {
              "foo": "bar"
            },
            "payment_response": {
              "foo": "bar"
            },
            "balance": 1000,
            "expires_at": "2018-01-02T12:00:00.000Z",
            "closed_at": "2018-01-02T12:00:00.000Z",
            "payment_instrument": {
              "issuer": "cl bank",
              "card_type": "visa"
            },
            "created_at": "2018-01-01T12:00:00.000Z",
            "updated_at": "2018-01-01T12:00:00.000Z",
            "reference": "ANY-EXTERNAL-REFEFERNCE",
            "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
            "metadata": {
              "foo": "bar"
            }
          },
          "relationships": {
            "order": {
              "data": {
                "id": "XAyRWNUzyN"
              }
            },
            "payment_gateway": {
              "data": {
                "id": "XAyRWNUzyN"
              }
            },
            "event_stores": {
              "data": {
                "id": "XAyRWNUzyN"
              }
            }
          }
        }
      },
      "tags": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      }
    }
  }
}

Response

The created order object

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • breaking

      added the new required request property ///

    • breaking

      added the new required request property ///

    • breaking

      added the new required request property ///

    • breaking

      added the new required request property ///

    • breaking

      added the new required request property ///

    • breaking

      added the new required request property ///

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property ///////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property / was restricted to a list of enum values

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property default value adyen_payments was removed

    • info

      the request property default value braintree_payments was removed

    • info

      the request property default value checkout_com_payments was removed

    • info

      the request property default value external_payments was removed

    • info

      the request property default value klarna_payments was removed

    • info

      the request property default value orders was removed

    • info

      the request property default value paypal_payments was removed

    • info

      the request property default value stripe_payments was removed

    • info

      the request property default value wire_transfers was removed

    • info

      added the new adyen_payments enum value to the request property ////////

    • info

      added the new approved enum value to the request property /////////

    • info

      added the new braintree_payments enum value to the request property ////////

    • info

      added the new checkout_com_payments enum value to the request property ////////

    • info

      added the new created enum value to the request property /////////

    • info

      added the new external_payments enum value to the request property ////////

    • info

      added the new klarna_payments enum value to the request property ////////

    • info

      added the new orders enum value to the request property /

    • info

      added the new paypal_payments enum value to the request property ////////

    • info

      added the new stripe_payments enum value to the request property ////////

    • info

      added the new wire_transfers enum value to the request property ////////

    • info

      added to the // request property oneOf list

    • info

      added the media type application/vnd.api+json for the response with the status