Orders

Available methods

All available methods for resource orders.

HTTP method Endpoint Description
[badge-green POST] /orders Create a new order


Create an order

Create a new order for customer
[badge-green POST] /orders

Request

Parameter name Type Description Mandatory (Yes/No)
order Order Order resource Yes

Response

Status code: 201 Created
Output structure : object

Parameter name Type Description
order_id string The unique id for the order

Example request

POST https://<projectURL>/rest-api/customer-interface/v1.0/orders
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic Y3VzdG9tZXJfaW50ZXJmYWNMjk5OTE1Nzk4YWVmM2JmMTg5MDU2MDIxMTY4MWFkMjcwNzM3ZWExMjhlODViOGU0MmI1NQ==

{
  "customer_id": "87a6f37e138c1ef18918e747d",
  "currency_id": "8bed991c68a470eaaeffbf048",
  "total_price": "36.00",
  "discount_codes": null,
  "order_items": [
    {
      "product_variant_id": "8fcc724e1514dafb0a70228d3",
      "amount": 1,
      "unit_price": "36",
      "vat_rate": 19
    }
  ],
  "invoicing_data": {
    "payment_id": "8bd481170064960b1788109b8",
    "personal_information": {
      "gender": 2,
      "first_name": "jana",
      "last_name": "testová",
      "email": "happy_customer@crmcarecloud.com",
      "language_id": "sl",
      "store_id": "89d88719b8b442e2d11b401a2",
      "phone": "38612345678",
      "address": {
        "address1": "lomená 5",
        "address2": "",
        "zip": "1500",
        "city": "praha 5",
        "country_code": "si"
      }
    }
  },
  "shipping_data": {
    "shipping_id": "81eaeea13b8984a69c490a325",
    "contact_firstname": "jana",
    "contact_lastname": "testová",
    "phone": "38612345678",
    "address": {
      "address1": "lomená 5",
      "address2": "",
      "zip": "1500",
      "city": "praha 5",
      "country_code": "si"
    }
  }
}

Example response

HTTP/1.1 201 Created
Date: Tue, 29 Sep 2020 14:56:30 GMT
Content-Type: application/json; charset=utf-8

{
    "data": {
        "order_id": "80af8a5dcc0702daf336f4de41"
    }
}