Storefront APIs (v1.0)
Download OpenAPI specification:Download
Get a product by slug
path Parameters
slug required | string |
query Parameters
storefront_token | string Example: storefront_token=ptkn_xxxxxxxxxxxxxxxxxx |
currency | string Enum: "USD" "EUR" "CAD" "GBP" "AUD" "NZD" "SEK" "NOK" "DKK" "PLN" "INR" "JPY" "MYR" "SGD" |
Responses
Response samples
- 200
Content type
application/json
{- "id": "string",
- "name": "string",
- "slug": "string",
- "description": "string",
- "state": {
- "type": "AVAILABLE"
}, - "access": {
- "type": "PUBLIC"
}, - "images": [
- {
- "id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
- "width": 800,
- "height": 600
}
], - "variants": [
- {
- "id": "string",
- "name": "string",
- "sku": "string",
- "unitPrice": {
- "value": 10,
- "currency": "USD"
}, - "compareAtPrice": {
- "value": 10,
- "currency": "USD"
}, - "attributes": {
- "description": "Black, L",
- "color": {
- "name": "Black",
- "swatch": "#000000"
}, - "size": {
- "name": "L"
}
}, - "stock": {
- "type": "UNLIMITED"
}, - "weight": {
- "value": 1,
- "unit": "kg"
}, - "dimensions": {
- "length": 1,
- "width": 2,
- "height": 3,
- "unit": "cm"
}, - "images": [
- {
- "id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
- "width": 800,
- "height": 600
}
]
}
], - "createdAt": "2020-08-13T09:05:36.939Z",
- "updatedAt": "2020-08-13T09:05:36.939Z"
}
Get all collections
Returns all collections
query Parameters
storefront_token | string Example: storefront_token=ptkn_xxxxxxxxxxxxxxxxxx |
page | integer <int32> |
size | integer <int32> |
Responses
Response samples
- 200
Content type
application/json
{- "results": [
- {
- "id": "col_b1EVARkUTcCTSfspQaXr1Q",
- "name": "My collection",
- "slug": "my-collection",
- "description": "My collection description"
}
], - "paging": {
- "pageNumber": 0,
- "pageSize": 0,
- "elementsSize": 0,
- "elementsTotal": 0,
- "totalPages": 0,
- "hasNextPage": true
}
}
Get a collection
Returns a collection
path Parameters
slug required | string |
query Parameters
storefront_token | string Example: storefront_token=ptkn_xxxxxxxxxxxxxxxxxx |
Responses
Response samples
- 200
Content type
application/json
{- "id": "col_b1EVARkUTcCTSfspQaXr1Q",
- "name": "My collection",
- "slug": "my-collection",
- "description": "My collection description"
}
Get products (offers) in a collection
Returns all products in the collection
path Parameters
slug required | string |
query Parameters
storefront_token | string Example: storefront_token=ptkn_xxxxxxxxxxxxxxxxxx |
currency | string Enum: "USD" "EUR" "CAD" "GBP" "AUD" "NZD" "SEK" "NOK" "DKK" "PLN" "INR" "JPY" "MYR" "SGD" |
page | integer <int32> |
size | integer <int32> |
Responses
Response samples
- 200
Content type
application/json
{- "results": [
- {
- "id": "string",
- "name": "string",
- "slug": "string",
- "description": "string",
- "state": {
- "type": "AVAILABLE"
}, - "access": {
- "type": "PUBLIC"
}, - "images": [
- {
- "id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
- "width": 800,
- "height": 600
}
], - "variants": [
- {
- "id": "string",
- "name": "string",
- "sku": "string",
- "unitPrice": {
- "value": 10,
- "currency": "USD"
}, - "compareAtPrice": {
- "value": 10,
- "currency": "USD"
}, - "attributes": {
- "description": "Black, L",
- "color": {
- "name": "Black",
- "swatch": "#000000"
}, - "size": {
- "name": "L"
}
}, - "stock": {
- "type": "UNLIMITED"
}, - "weight": {
- "value": 1,
- "unit": "kg"
}, - "dimensions": {
- "length": 1,
- "width": 2,
- "height": 3,
- "unit": "cm"
}, - "images": [
- {
- "id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
- "width": 800,
- "height": 600
}
]
}
], - "createdAt": "2020-08-13T09:05:36.939Z",
- "updatedAt": "2020-08-13T09:05:36.939Z"
}
], - "paging": {
- "pageNumber": 0,
- "pageSize": 0,
- "elementsSize": 0,
- "elementsTotal": 0,
- "totalPages": 0,
- "hasNextPage": true
}
}
Create cart
query Parameters
storefront_token | string Example: storefront_token=ptkn_xxxxxxxxxxxxxxxxxx |
currency | string Enum: "USD" "EUR" "CAD" "GBP" "AUD" "NZD" "SEK" "NOK" "DKK" "PLN" "INR" "JPY" "MYR" "SGD" |
Request Body schema: application/jsonrequired
required | Array of objects (com.fourthwall.app.headless.HeadlessCart$RequestItem) | ||||
Array
|
Responses
Request samples
- Payload
Content type
application/json
{- "items": [
- {
- "variantId": "d53feca7-c65b-4741-aca7-827a42d686bf",
- "quantity": 1
}
]
}
Response samples
- 200
Content type
application/json
{- "id": "string",
- "items": [
- {
- "variant": {
- "id": "string",
- "name": "string",
- "sku": "string",
- "unitPrice": {
- "value": 10,
- "currency": "USD"
}, - "compareAtPrice": {
- "value": 10,
- "currency": "USD"
}, - "attributes": {
- "description": "Black, L",
- "color": {
- "name": "Black",
- "swatch": "#000000"
}, - "size": {
- "name": "L"
}
}, - "stock": {
- "type": "UNLIMITED"
}, - "weight": {
- "value": 1,
- "unit": "kg"
}, - "dimensions": {
- "length": 1,
- "width": 2,
- "height": 3,
- "unit": "cm"
}, - "images": [
- {
- "id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
- "width": 800,
- "height": 600
}
], - "product": {
- "id": "string",
- "name": "string",
- "slug": "string"
}
}, - "quantity": 0
}
]
}
Remove from cart
path Parameters
cartId required | string |
query Parameters
storefront_token | string Example: storefront_token=ptkn_xxxxxxxxxxxxxxxxxx |
currency | string Enum: "USD" "EUR" "CAD" "GBP" "AUD" "NZD" "SEK" "NOK" "DKK" "PLN" "INR" "JPY" "MYR" "SGD" |
Request Body schema: application/jsonrequired
required | Array of objects (com.fourthwall.cart.usecase.CartRemoveFromCart$RequestItem) | ||
Array
|
Responses
Request samples
- Payload
Content type
application/json
{- "items": [
- {
- "variantId": "d53feca7-c65b-4741-aca7-827a42d686bf"
}
]
}
Response samples
- 200
Content type
application/json
{- "id": "string",
- "items": [
- {
- "variant": {
- "id": "string",
- "name": "string",
- "sku": "string",
- "unitPrice": {
- "value": 10,
- "currency": "USD"
}, - "compareAtPrice": {
- "value": 10,
- "currency": "USD"
}, - "attributes": {
- "description": "Black, L",
- "color": {
- "name": "Black",
- "swatch": "#000000"
}, - "size": {
- "name": "L"
}
}, - "stock": {
- "type": "UNLIMITED"
}, - "weight": {
- "value": 1,
- "unit": "kg"
}, - "dimensions": {
- "length": 1,
- "width": 2,
- "height": 3,
- "unit": "cm"
}, - "images": [
- {
- "id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
- "width": 800,
- "height": 600
}
], - "product": {
- "id": "string",
- "name": "string",
- "slug": "string"
}
}, - "quantity": 0
}
]
}
Change cart items quantity
path Parameters
cartId required | string |
query Parameters
storefront_token | string Example: storefront_token=ptkn_xxxxxxxxxxxxxxxxxx |
currency | string Enum: "USD" "EUR" "CAD" "GBP" "AUD" "NZD" "SEK" "NOK" "DKK" "PLN" "INR" "JPY" "MYR" "SGD" |
Request Body schema: application/jsonrequired
required | Array of objects (com.fourthwall.cart.usecase.CartUpdateItemsQuantity$RequestItem) | ||||
Array
|
Responses
Request samples
- Payload
Content type
application/json
{- "items": [
- {
- "variantId": "d53feca7-c65b-4741-aca7-827a42d686bf",
- "quantity": 0
}
]
}
Response samples
- 200
Content type
application/json
{- "id": "string",
- "items": [
- {
- "variant": {
- "id": "string",
- "name": "string",
- "sku": "string",
- "unitPrice": {
- "value": 10,
- "currency": "USD"
}, - "compareAtPrice": {
- "value": 10,
- "currency": "USD"
}, - "attributes": {
- "description": "Black, L",
- "color": {
- "name": "Black",
- "swatch": "#000000"
}, - "size": {
- "name": "L"
}
}, - "stock": {
- "type": "UNLIMITED"
}, - "weight": {
- "value": 1,
- "unit": "kg"
}, - "dimensions": {
- "length": 1,
- "width": 2,
- "height": 3,
- "unit": "cm"
}, - "images": [
- {
- "id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
- "width": 800,
- "height": 600
}
], - "product": {
- "id": "string",
- "name": "string",
- "slug": "string"
}
}, - "quantity": 0
}
]
}
Add to cart
path Parameters
cartId required | string |
query Parameters
storefront_token | string Example: storefront_token=ptkn_xxxxxxxxxxxxxxxxxx |
currency | string Enum: "USD" "EUR" "CAD" "GBP" "AUD" "NZD" "SEK" "NOK" "DKK" "PLN" "INR" "JPY" "MYR" "SGD" |
Request Body schema: application/jsonrequired
required | Array of objects (com.fourthwall.cart.usecase.CartAdd$RequestItem) | ||||||
Array
|
Responses
Request samples
- Payload
Content type
application/json
{- "items": [
- {
- "variantId": "d53feca7-c65b-4741-aca7-827a42d686bf",
- "quantity": 1,
- "recStrategy": "string"
}
]
}
Response samples
- 200
Content type
application/json
{- "id": "string",
- "items": [
- {
- "variant": {
- "id": "string",
- "name": "string",
- "sku": "string",
- "unitPrice": {
- "value": 10,
- "currency": "USD"
}, - "compareAtPrice": {
- "value": 10,
- "currency": "USD"
}, - "attributes": {
- "description": "Black, L",
- "color": {
- "name": "Black",
- "swatch": "#000000"
}, - "size": {
- "name": "L"
}
}, - "stock": {
- "type": "UNLIMITED"
}, - "weight": {
- "value": 1,
- "unit": "kg"
}, - "dimensions": {
- "length": 1,
- "width": 2,
- "height": 3,
- "unit": "cm"
}, - "images": [
- {
- "id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
- "width": 800,
- "height": 600
}
], - "product": {
- "id": "string",
- "name": "string",
- "slug": "string"
}
}, - "quantity": 0
}
]
}
Get cart by id
path Parameters
cartId required | string |
query Parameters
storefront_token | string Example: storefront_token=ptkn_xxxxxxxxxxxxxxxxxx |
currency | string Enum: "USD" "EUR" "CAD" "GBP" "AUD" "NZD" "SEK" "NOK" "DKK" "PLN" "INR" "JPY" "MYR" "SGD" |
Responses
Response samples
- 200
Content type
application/json
{- "id": "string",
- "items": [
- {
- "variant": {
- "id": "string",
- "name": "string",
- "sku": "string",
- "unitPrice": {
- "value": 10,
- "currency": "USD"
}, - "compareAtPrice": {
- "value": 10,
- "currency": "USD"
}, - "attributes": {
- "description": "Black, L",
- "color": {
- "name": "Black",
- "swatch": "#000000"
}, - "size": {
- "name": "L"
}
}, - "stock": {
- "type": "UNLIMITED"
}, - "weight": {
- "value": 1,
- "unit": "kg"
}, - "dimensions": {
- "length": 1,
- "width": 2,
- "height": 3,
- "unit": "cm"
}, - "images": [
- {
- "id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
- "width": 800,
- "height": 600
}
], - "product": {
- "id": "string",
- "name": "string",
- "slug": "string"
}
}, - "quantity": 0
}
]
}