Checkout - Coupons

Apply a Coupon

Endpoint

POST /v1/checkouts/:uuid/coupons

Parameters

Name Description
code required Coupon code

Request

curl "https://capi.storyblok.com/v1/checkouts/f3d406c2-c1a8-4d35-b64f-b1400cdbf054/coupons" -d '{"code":"oQTGgfS7uXUHvIrzQNTlXQtt"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=RDYUVWWpQVyRQgre51xKwgtt" \

Response

{
  "uuid": "f3d406c2-c1a8-4d35-b64f-b1400cdbf054",
  "email": "",
  "company": "",
  "firstname": "",
  "lastname": "",
  "subtotal": 21.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": 27.9,
  "status": "Open",
  "ship_address": null,
  "bill_address": null,
  "customer": null,
  "is_guest": false,
  "language": "en",
  "currency": "EUR",
  "coupon_discount": 3.1,
  "ship_as_bill": true,
  "shipping_notes": null,
  "affiliate_id": null,
  "terms_link": "https://www.storyblok.com",
  "order_items": [
    {
      "id": 14898,
      "sku": "STRAW",
      "url": "https://0387bdac.me.storyblok.com/products/strawberry",
      "product_id": 0,
      "order_id": null,
      "quantity": 1,
      "value": 10.5,
      "meta_data": null,
      "contents": {
        "ean": "8884652088399"
      },
      "total_value": 10.5,
      "image": null,
      "parent_item_id": null,
      "total_price": null,
      "price": null,
      "item_status": "Open",
      "package_id": null,
      "discount": null,
      "translated_item_status": null
    },
    {
      "id": 14899,
      "sku": "STRAW",
      "url": "https://0387bdac.me.storyblok.com/products/strawberry",
      "product_id": 0,
      "order_id": null,
      "quantity": 1,
      "value": 10.5,
      "meta_data": null,
      "contents": {
        "ean": "8884652088399"
      },
      "total_value": 10.5,
      "image": null,
      "parent_item_id": null,
      "total_price": null,
      "price": null,
      "item_status": "Open",
      "package_id": null,
      "discount": null,
      "translated_item_status": null
    }
  ],
  "applied_coupons": [
    {
      "id": 635,
      "coupon_id": 1720,
      "checkout_id": 4828,
      "order_id": null,
      "created_at": "2018-07-04T16:56:42.000Z",
      "updated_at": "2018-07-04T16:56:42.000Z"
    }
  ]
}