Checkouts

Creating a checkout

Endpoint

POST /v1/checkouts

Parameters

Name Description
shipping_method Shipping method
company Company name
firstname Firstname
lastname Lastname
phone Phone
email Email
is_guest Guest checkout (1 = true, 0 = false)
ship_as_bill Use shipping a billing address
currency Cart currency
affiliate_id Affiliate id
shipping_notes Shipping notes
ship_address_attributes[id] id
ship_address_attributes[company] Company name
ship_address_attributes[firstname] Firstname
ship_address_attributes[lastname] Lastname
ship_address_attributes[email] Email
ship_address_attributes[phone] Phone
ship_address_attributes[address1] Street and housenumber
ship_address_attributes[address2] Building, Floor
ship_address_attributes[district] District
ship_address_attributes[city] City
ship_address_attributes[zip] Zip code
ship_address_attributes[zone_id] Zone Id
ship_address_attributes[country_id] Country Id
ship_address_attributes[reference] Reference
ship_address_attributes[extra] Extra fields
ship_address_attributes[sex] Gender
bill_address_attributes[id] id
bill_address_attributes[company] Company Name
bill_address_attributes[firstname] Firstname
bill_address_attributes[lastname] Lastname
bill_address_attributes[email] Email
bill_address_attributes[phone] Phone
bill_address_attributes[address1] Street and housenumber
bill_address_attributes[address2] Building, Floor
bill_address_attributes[district] District
bill_address_attributes[city] City
bill_address_attributes[zip] Zip code
bill_address_attributes[zone_id] Zone Id
bill_address_attributes[country_id] Country Id
bill_address_attributes[reference] Reference
bill_address_attributes[extra] Extra fields
bill_address_attributes[sex] Gender

Request

curl "https://capi.storyblok.com/v1/checkouts" -d '{"currency":"EUR"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=0db59c247399d1d651472670b896c27e" \

Response

{
  "uuid": "13016fc7-25b0-40d2-ab8d-d36f017af9fe",
  "email": "",
  "company": "",
  "firstname": "",
  "lastname": "",
  "subtotal": 0.0,
  "shipping": 0.0,
  "shipping_method": null,
  "shipping_methods": [
    {
      "num": 10,
      "str": 10,
      "id": "cod"
    }
  ],
  "payment_methods": [
    {
      "id": "cod",
      "module_id": "cod",
      "name": "Cash",
      "description": ""
    }
  ],
  "tax": 0.0,
  "total": 0.0,
  "status": "Open",
  "ship_address": null,
  "bill_address": null,
  "customer": null,
  "is_guest": false,
  "language": "en",
  "currency": "EUR",
  "coupon_discount": 0.0,
  "ship_as_bill": true,
  "shipping_notes": null,
  "affiliate_id": null,
  "terms_link": "https://www.storyblok.com",
  "order_items": [

  ],
  "applied_coupons": [

  ]
}

Getting a checkout

Endpoint

GET /v1/checkouts/:uuid

Request

curl "https://capi.storyblok.com/v1/checkouts/f1936690-9c57-4c5f-b810-5e7b000a1f15" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=beafc6f931ee06e81c72ae10f9887879" \

Response

{
  "uuid": "f1936690-9c57-4c5f-b810-5e7b000a1f15",
  "email": "",
  "company": "",
  "firstname": "",
  "lastname": "",
  "subtotal": 0.0,
  "shipping": 0.0,
  "shipping_method": null,
  "shipping_methods": [
    {
      "num": 10,
      "str": 10,
      "id": "cod"
    }
  ],
  "payment_methods": [
    {
      "id": "cod",
      "module_id": "cod",
      "name": "Cash",
      "description": ""
    }
  ],
  "tax": 0.0,
  "total": 0.0,
  "status": "Open",
  "ship_address": null,
  "bill_address": null,
  "customer": null,
  "is_guest": false,
  "language": "en",
  "currency": "EUR",
  "coupon_discount": 0.0,
  "ship_as_bill": true,
  "shipping_notes": null,
  "affiliate_id": null,
  "terms_link": "https://www.storyblok.com",
  "order_items": [

  ],
  "applied_coupons": [

  ]
}

Deleting a checkout

Endpoint

DELETE /v1/checkouts/:uuid

Request

curl "https://capi.storyblok.com/v1/checkouts/65f2208f-9f2b-46ca-8275-7dab6ae0173f" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=bd8140f8cf47616d05f2951296bcf7b6" \

Getting a list of checkouts

Endpoint

GET /v1/checkouts

Parameters

Name Description
page Current page of checkout

Request

Query Parameters

page=0
curl "https://capi.storyblok.com/v1/checkouts?page=0" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=910680f11473b832d3679c462b1cc4e7" \

Response

[

]

Updating a checkout

Endpoint

PUT /v1/checkouts/:uuid

Parameters

Name Description
shipping_method Shipping method
company Company name
firstname Firstname
lastname Lastname
phone Phone
email Email
is_guest Guest checkout (1 = true, 0 = false)
ship_as_bill Use shipping a billing address
currency Cart currency
affiliate_id Affiliate id
shipping_notes Shipping notes

Request

curl "https://capi.storyblok.com/v1/checkouts/9af7b56a-b235-4c53-84e1-46afc8e64256" -d '{"firstname":"Test","affiliate_id":"AFF_ID","shipping_notes":{"notes":"note1"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=54e96f2f69f40364bbece7ffd6475739" \

Response

{
  "uuid": "9af7b56a-b235-4c53-84e1-46afc8e64256",
  "email": "",
  "company": "",
  "firstname": "Test",
  "lastname": "",
  "subtotal": 0.0,
  "shipping": 0.0,
  "shipping_method": null,
  "shipping_methods": [
    {
      "num": 10,
      "str": 10,
      "id": "cod"
    }
  ],
  "payment_methods": [
    {
      "id": "cod",
      "module_id": "cod",
      "name": "Cash",
      "description": ""
    }
  ],
  "tax": 0.0,
  "total": 0.0,
  "status": "Open",
  "ship_address": null,
  "bill_address": null,
  "customer": null,
  "is_guest": false,
  "language": "en",
  "currency": "EUR",
  "coupon_discount": 0.0,
  "ship_as_bill": true,
  "shipping_notes": {
    "notes": "note1"
  },
  "affiliate_id": "AFF_ID",
  "terms_link": "https://www.storyblok.com",
  "order_items": [

  ],
  "applied_coupons": [

  ]
}