Orders

Creating a Order

Endpoint

POST /v1/orders

Parameters

Name Description
notes required Notes
shipping_method required Shipping method

Request

curl "https://capi.storyblok.com/v1/orders" -d '{"notes":"My notes","shipping_method":"hash-of-shipping-method"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=ahMLlTHubsq0lhoPdmrC1Att" \

Response

{
  "id": 10357,
  "order_number": null,
  "total": null,
  "ordered_on": null,
  "shipped_on": null,
  "currency": "EUR",
  "delivery_time": 0,
  "shipping_notes": null,
  "tracking_number": null,
  "status": "Open",
  "email": "",
  "notes": "My notes",
  "ship_address": null,
  "bill_address": null,
  "payments": [

  ],
  "subtotal": null,
  "affiliate_id": null,
  "shipping_method": "hash-of-shipping-method",
  "coupon_discount": null,
  "language": null,
  "shipping": null,
  "tax": null,
  "histories": [
    {
      "id": 7835,
      "order_id": 10357,
      "order_status": "Open",
      "created_at": "2018-07-04T16:57:03.000Z",
      "updated_at": "2018-07-04T16:57:03.000Z",
      "action": "New status: Open"
    }
  ],
  "order_items": [

  ],
  "item_returns": [

  ]
}

Deleting a Order

Endpoint

DELETE /v1/orders/:id

Request

curl "https://capi.storyblok.com/v1/orders/10361" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=cJemzzy29nJP8uWirbkNiAtt" \

Getting a Order

Endpoint

GET /v1/orders/:id

Request

curl "https://capi.storyblok.com/v1/orders/10354" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=Cv5JQAkCcutNjTNCcSVF5wtt" \

Response

{
  "id": 10354,
  "order_number": "153072342374",
  "total": 10.5,
  "ordered_on": "2018-07-04T16:56:33.000Z",
  "shipped_on": null,
  "currency": "EUR",
  "delivery_time": 0,
  "shipping_notes": null,
  "tracking_number": "",
  "status": "Open",
  "email": "",
  "notes": null,
  "ship_address": null,
  "bill_address": null,
  "payments": [

  ],
  "subtotal": 10.5,
  "affiliate_id": null,
  "shipping_method": "test",
  "coupon_discount": 0.0,
  "language": "",
  "shipping": 0.0,
  "tax": 0.0,
  "histories": [
    {
      "id": 7832,
      "order_id": 10354,
      "order_status": "Open",
      "created_at": "2018-07-04T16:57:03.000Z",
      "updated_at": "2018-07-04T16:57:03.000Z",
      "action": "New status: Open"
    }
  ],
  "order_items": [

  ],
  "item_returns": [

  ]
}

Getting a list of orders

Endpoint

GET /v1/orders

Parameters

Name Description
page Current page of orders
per_page Number of items per page. Default is 25 and max. is 500
customer_id Filter by customer
status Filter by status
ordered_on_gte Filter by order date from
ordered_on_lte Filter by order date to

Request

Query Parameters

page=0
per_page=25
status=Pending
ordered_on_gte=2011-01-01 00:00:00
ordered_on_lte=2020-01-01 24:00:00
curl "https://capi.storyblok.com/v1/orders?page=0&per_page=25&status=Pending&ordered_on_gte=2011-01-01+00%3A00%3A00&ordered_on_lte=2020-01-01+24%3A00%3A00" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=5sYvknPy986RcPJDYid61Att" \

Response

[
  {
    "id": 10355,
    "order_number": "153072342397",
    "total": 10.5,
    "currency": "EUR",
    "history": [

    ],
    "ordered_on": "2018-07-04T16:56:33.000Z",
    "status": "Open",
    "email": ""
  }
]

Updating a Order

Endpoint

PUT /v1/orders/:id

Parameters

Name Description
notes Notes
status Status

Request

curl "https://capi.storyblok.com/v1/orders/10359" -d '{"notes":"My notes","@status":"Processing"}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=i21adjbzgOtGamDGnQjqzgtt" \

Response

{
  "id": 10359,
  "order_number": "153072342485",
  "total": 10.5,
  "ordered_on": "2018-07-04T16:56:33.000Z",
  "shipped_on": null,
  "currency": "EUR",
  "delivery_time": 0,
  "shipping_notes": null,
  "tracking_number": "",
  "status": "Open",
  "email": "",
  "notes": "My notes",
  "ship_address": null,
  "bill_address": null,
  "payments": [

  ],
  "subtotal": 10.5,
  "affiliate_id": null,
  "shipping_method": "test",
  "coupon_discount": 0.0,
  "language": "",
  "shipping": 0.0,
  "tax": 0.0,
  "histories": [
    {
      "id": 7837,
      "order_id": 10359,
      "order_status": "Open",
      "created_at": "2018-07-04T16:57:04.000Z",
      "updated_at": "2018-07-04T16:57:04.000Z",
      "action": "New status: Open"
    }
  ],
  "order_items": [

  ],
  "item_returns": [

  ]
}