Checkout - Order items

Create an order item

Endpoint

POST /v1/checkouts/:uuid/order_items

Parameters

Name Description
product_id required Product ID
quantity required Quantity
url required URL
currency required Currency
meta_data required Meta data

Request

curl "https://capi.storyblok.com/v1/checkouts/be3c3401-32e4-42c4-8d9c-42f48bc621c2/order_items" -d '{"product_id":40282,"quantity":"5","url":"http://localhost:3000","currency":"USD","meta_data":{"name":"Tshirt"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=911d4a703fccaa0a6718554a884da06c" \

Response

{
  "order_item": {
    "id": 14904,
    "sku": "123",
    "url": "http://localhost:3000",
    "product_id": 40282,
    "order_id": null,
    "quantity": 5,
    "value": 0.0,
    "meta_data": {
      "id": 40282,
      "sku": "123",
      "name": "Tshirt",
      "slug": null,
      "route_id": 0,
      "description": null,
      "excerpt": null,
      "price": 0.0,
      "saleprice": 0.0,
      "free_shipping": false,
      "shippable": true,
      "taxable": true,
      "fixed_quantity": false,
      "weight": "0",
      "track_stock": false,
      "quantity": 0,
      "related_products": null,
      "images": [

      ],
      "seo_title": null,
      "meta": null,
      "enabled": true,
      "video": "",
      "height": 0.0,
      "width": 0.0,
      "depth": 0.0,
      "factory_price": 0.0,
      "video_img": "",
      "site_id": 38562,
      "installments": 0,
      "stared": false,
      "seo_description": "",
      "seo_keywords": "",
      "variant_details": false,
      "subscription_days": 0,
      "subscription_period": "",
      "subscription_trial": null,
      "lookable": false,
      "reduction_type": "",
      "purchasable": true,
      "reduction_amount": 0.0,
      "parent_id": 0,
      "production_time": 0,
      "display_size_as": "",
      "child_image": null,
      "jproperties": null,
      "ad_first_child": "",
      "ean": "",
      "product_type": "standard",
      "sales": 0,
      "updated_at": "2018-07-04T16:56:43.000Z",
      "created_at": "2018-07-04T16:56:43.000Z",
      "description_md": null,
      "property_ids": [

      ],
      "category_ids": [

      ],
      "product_option_ids": [

      ]
    },
    "contents": null,
    "total_value": 0.0,
    "image": "",
    "parent_item_id": null,
    "total_price": null,
    "price": null,
    "item_status": "Open",
    "package_id": null,
    "discount": 0.0,
    "translated_item_status": null
  },
  "checkout": {
    "uuid": "be3c3401-32e4-42c4-8d9c-42f48bc621c2",
    "email": "",
    "company": "",
    "firstname": "",
    "lastname": "",
    "subtotal": 0.0,
    "shipping": 10.0,
    "shipping_method": "cod",
    "shipping_methods": [
      {
        "num": 10,
        "str": 10,
        "id": "cod"
      }
    ],
    "payment_methods": [
      {
        "id": "cod",
        "module_id": "cod",
        "name": "Cash",
        "description": ""
      }
    ],
    "tax": 0.0,
    "total": 10.0,
    "status": "Open",
    "ship_address": null,
    "bill_address": null,
    "customer": null,
    "is_guest": false,
    "language": "en",
    "currency": "USD",
    "coupon_discount": 0.0,
    "ship_as_bill": true,
    "shipping_notes": null,
    "affiliate_id": null,
    "terms_link": "https://www.storyblok.com",
    "order_items": [
      {
        "id": 14904,
        "sku": "123",
        "url": "http://localhost:3000",
        "product_id": 40282,
        "order_id": null,
        "quantity": 5,
        "value": 0.0,
        "meta_data": {
          "id": 40282,
          "sku": "123",
          "name": "Tshirt",
          "slug": null,
          "route_id": 0,
          "description": null,
          "excerpt": null,
          "price": 0.0,
          "saleprice": 0.0,
          "free_shipping": false,
          "shippable": true,
          "taxable": true,
          "fixed_quantity": false,
          "weight": "0",
          "track_stock": false,
          "quantity": 0,
          "related_products": null,
          "images": [

          ],
          "seo_title": null,
          "meta": null,
          "enabled": true,
          "video": "",
          "height": 0.0,
          "width": 0.0,
          "depth": 0.0,
          "factory_price": 0.0,
          "video_img": "",
          "site_id": 38562,
          "installments": 0,
          "stared": false,
          "seo_description": "",
          "seo_keywords": "",
          "variant_details": false,
          "subscription_days": 0,
          "subscription_period": "",
          "subscription_trial": null,
          "lookable": false,
          "reduction_type": "",
          "purchasable": true,
          "reduction_amount": 0.0,
          "parent_id": 0,
          "production_time": 0,
          "display_size_as": "",
          "child_image": null,
          "jproperties": null,
          "ad_first_child": "",
          "ean": "",
          "product_type": "standard",
          "sales": 0,
          "updated_at": "2018-07-04T16:56:43.000Z",
          "created_at": "2018-07-04T16:56:43.000Z",
          "description_md": null,
          "property_ids": [

          ],
          "category_ids": [

          ],
          "product_option_ids": [

          ]
        },
        "contents": null,
        "total_value": 0.0,
        "image": "",
        "parent_item_id": null,
        "total_price": null,
        "price": null,
        "item_status": "Open",
        "package_id": null,
        "discount": 0.0,
        "translated_item_status": null
      }
    ],
    "applied_coupons": [

    ]
  }
}

Getting a list of order items for this checkout

Endpoint

GET /v1/checkouts/:uuid/order_items

Request

curl "https://capi.storyblok.com/v1/checkouts/852fa547-ed89-4e97-9929-e9ef12720178/order_items" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=91d96e0e90cedee0296b63405d1af31b" \

Response

[

]

Getting an order item

Endpoint

GET /v1/checkouts/:uuid/order_items/:id

Request

curl "https://capi.storyblok.com/v1/checkouts/c01d0ad4-b9e4-4035-aec3-f1f9b76f9113/order_items/14902" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=b296bdbd0b21c083a34c123cbad7ac09" \

Response

{
  "id": 14902,
  "sku": "123",
  "url": "http://localhost:3000",
  "product_id": 0,
  "order_id": null,
  "quantity": 10,
  "value": 10.0,
  "meta_data": null,
  "contents": null,
  "total_value": 100.0,
  "image": null,
  "parent_item_id": null,
  "total_price": null,
  "price": null,
  "item_status": "Open",
  "package_id": null,
  "discount": null,
  "translated_item_status": null
}