1 min read

Product extension

Product details in your app appear on the Product Details screen.

You can use the Product extension to add and amend product data in real time.

Get products

Gets data about a product from your external system to be added to the app.

FETCH

Use this extension type to get data about a product directly from your external system. Any data in the Poq database for this product is ignored, and the data from your system is used.

Request

This request is sent by the Poq platform to your external system:

GET{yourApi}?ids={product ids}
Accept: application/json
Accept-Encoding: gzip, deflate
App-Identifier: fac91234-5c38-4a9f-8846-a53144e13356 - The unique app identifier (UUID)
Currency-Code: GBP -Three digit ISO currency code
Poq-User-Id: 3f332b0c-9ed0-4ebc-8ebe-ba13f429f3ff - An auto-generated user ID (UUID)
User-Agent: MyShop/15.0 - User agent passed from the iOS or Android SDK to Poq backend
X-Forwarded-For: 127.0.0.1 - IP Address of the client

Response:

The response below is a sample of what should be returned by your external system.

200 OK

[
{
"meta": {
"clientId": "5",
"defaultVariantId": "sku_51",
"sizeGuideUrl": "https://myshop.com/sizeguides/shoes",
"webUrl": "https://myshop.com/products/5"
},
"details": {
"name": "A Shoe",
"brand": "An Accessory Maker",
"shortDescription": "This is an ordinary t-shirt",
"shortDescriptionRaw": "<p>This is an ordinary t-shirt.</p>",
"description": "This is an ordinary shoe that matches an ordinary trouser alright.",
"descriptionRaw": "<p>This is an ordinary t-shirt to wear on an ordinary day.</p>",
"extraDescriptions": [
{
"title": "Outfit",
"description": "One of our designers designed this t-shirt.",
"descriptionRaw": "<p>One of our designers designed this t-shirt.</p>\",\"<p>Fabric, Paint</p>"
},
{
"title": "Ingredients",
"description": "Fabric, Rubber",
"descriptionRaw": "Fabric, Rubber"
}
]
},
"review": {
"rating": 4,
"count": 21
},
"promotion": {
"badges": ["Exlcusive"],
"messages": []
},
"forms": [
{
"name": "colour",
"variations": [
{
"id": "colour_red",
"value": "Red"
}
]
},
{
"name": "size",
"variations": [
{
"id": "size_small",
"value": "Small"
}
]
}
],
"variants": {
"sku_51": {
"id": "sku_51",
"forms": {
"colour": {
"id": "colour_red",
"value": "Red"
},
"size": {
"id": "size_small",
"value": "Small"
}
},
"images": {
"default": [
"https://static.myshop.com/sku_11_1.jpg",
"https://static.myshop.com/sku_11_1.jpg"
],
"swatch": "https://static.myshop.com/sku_11_1.jpg"
},
"meta": {
"ean": null,
"videoURL": null,
"defaultCurrency": "GBP"
},
"name": "A Shoe",
"prices": {
"GBP": {
"now": 69.67,
"was": 220,
"saving": {
"amount": 150.33,
"percent": 68.3318181818182
}
},
"EUR": {
"now": 112.33,
"was": 157.67,
"saving": {
"amount": 45.34,
"percent": 28.7562630811188
}
}
},
"stock": {
"available": true,
"lowOnStock": false,
"leadTime": "21 weeks",
"maxOrderableQuantity": 10,
"quantity": 221
}
}
},
"customData": {}
}
]

When no products are found, the response must have the 200 OK status code with an empty array in the response body:

200 OK
[]

REPLACE

The Poq platform sends the entire product data object to your system. Your system makes changes to some or all of the data and returns it to the Poq platform.

Use the Replace extension to update certain product data that changes all the time, like stock levels.

Request

This request is sent by the Poq platform to your external system (for just one product). It contains the full data object schema:

POST{yourApi}?ids={ids}
Accept: application/json
Accept-Encoding: gzip, deflate
App-Identifier: fac91234-5c38-4a9f-8846-a53144e13356 - The unique app identifier (UUID)
Currency-Code: GBP -Three digit ISO currency code
Poq-User-Id: 3f332b0c-9ed0-4ebc-8ebe-ba13f429f3ff - An auto-generated user ID (UUID)
User-Agent: MyShop/15.0 - User agent passed from the iOS or Android SDK to Poq backend
X-Forwarded-For: 127.0.0.1 - IP Address of the client

[
{
"meta": {
"clientId": "5",
"defaultVariantId": "sku_51",
"sizeGuideUrl": "https://myshop.com/sizeguides/shoes",
"webUrl": "https://myshop.com/products/5"
},
"details": {
"name": "A Shoe",
"brand": "An Accessory Maker",
"shortDescription": "This is an ordinary t-shirt",
"shortDescriptionRaw": "<p>This is an ordinary t-shirt.</p>",
"description": "This is an ordinary shoe that matches an ordinary trouser alright.",
"descriptionRaw": "<p>This is an ordinary t-shirt to wear on an ordinary day.</p>",
"extraDescriptions": [
{
"title": "Outfit",
"description": "One of our designers designed this t-shirt.",
"descriptionRaw": "<p>One of our designers designed this t-shirt.</p>\",\"<p>Fabric, Paint</p>"
},
{
"title": "Ingredients",
"description": "Fabric, Rubber",
"descriptionRaw": "Fabric, Rubber"
}
]
},
"review": {
"rating": 4,
"count": 21
},
"promotion": {
"badges": ["Exlcusive"],
"messages": []
},
"forms": [
{
"name": "colour",
"variations": [
{
"id": "colour_red",
"value": "Red"
}
]
},
{
"name": "size",
"variations": [
{
"id": "size_small",
"value": "Small"
}
]
}
],
"variants": {
"sku_51": {
"id": "sku_51",
"forms": {
"colour": {
"id": "colour_red",
"value": "Red"
},
"size": {
"id": "size_small",
"value": "Small"
}
},
"images": {
"default": [
"https://static.myshop.com/sku_11_1.jpg",
"https://static.myshop.com/sku_11_1.jpg"
],
"swatch": "https://static.myshop.com/sku_11_1.jpg"
},
"meta": {
"ean": null,
"videoURL": null,
"defaultCurrency": "GBP"
},
"name": "A Shoe",
"prices": {
"GBP": {
"now": 69.67,
"was": 220,
"saving": {
"amount": 150.33,
"percent": 68.3318181818182
}
},
"EUR": {
"now": 112.33,
"was": 157.67,
"saving": {
"amount": 45.34,
"percent": 28.7562630811188
}
}
},
"stock": {
"available": true,
"lowOnStock": false,
"leadTime": "21 weeks",
"maxOrderableQuantity": 10,
"quantity": 221
}
}
},
"customData": {}
}
]

If the extension chooses not to remove any products, the response must have the 200 OK status code with an empty array in the response body:

200 OK
[]

Response

The response from your system contains the whole data object, including changed or additional data. In the example below, stock levels of the product have reduced:

200 OK

[
{
"meta": {
"clientId": "5",
"defaultVariantId": "sku_51",
"sizeGuideUrl": "https://myshop.com/sizeguides/shoes",
"webUrl": "https://myshop.com/products/5"
},
"details": {
"name": "A Shoe",
"brand": "An Accessory Maker",
"shortDescription": "This is an ordinary t-shirt",
"shortDescriptionRaw": "<p>This is an ordinary t-shirt.</p>",
"description": "This is an ordinary shoe that matches an ordinary trouser alright.",
"descriptionRaw": "<p>This is an ordinary t-shirt to wear on an ordinary day.</p>",
"extraDescriptions": [
{
"title": "Outfit",
"description": "One of our designers designed this t-shirt.",
"descriptionRaw": "<p>One of our designers designed this t-shirt.</p>\",\"<p>Fabric, Paint</p>"
},
{
"title": "Ingredients",
"description": "Fabric, Rubber",
"descriptionRaw": "Fabric, Rubber"
}
]
},
"review": {
"rating": 4,
"count": 21
},
"promotion": {
"badges": ["Exlcusive"],
"messages": []
},
"forms": [
{
"name": "colour",
"variations": [
{
"id": "colour_red",
"value": "Red"
}
]
},
{
"name": "size",
"variations": [
{
"id": "size_small",
"value": "Small"
}
]
}
],
"variants": {
"sku_51": {
"id": "sku_51",
"forms": {
"colour": {
"id": "colour_red",
"value": "Red"
},
"size": {
"id": "size_small",
"value": "Small"
}
},
"images": {
"default": [
"https://static.myshop.com/sku_11_1.jpg",
"https://static.myshop.com/sku_11_1.jpg"
],
"swatch": "https://static.myshop.com/sku_11_1.jpg"
},
"meta": {
"ean": null,
"videoURL": null,
"defaultCurrency": "GBP"
},
"name": "A Shoe",
"prices": {
"GBP": {
"now": 69.67,
"was": 220,
"saving": {
"amount": 150.33,
"percent": 68.3318181818182
}
},
"EUR": {
"now": 112.33,
"was": 157.67,
"saving": {
"amount": 45.34,
"percent": 28.7562630811188
}
}
},
"stock": {
"available": true,
"lowOnStock": true,
"leadTime": "21 weeks",
"maxOrderableQuantity": 10,
"quantity": 21
}
}
},
"customData": {}
}
]

EXTEND

Use the Extend extension to request data from your external system and add it to the existing data on the Poq platform. You can include new data fields about a product, and overwrite existing fields without needing to send the entire data object to your system.

Request

This request is sent by the Poq platform to your external system (for just one product). It contains simple product data:

GEThttps://api.myshop.com/products/product1
Accept: application/json
Accept-Encoding: gzip, deflate
App-Identifier: fac91234-5c38-4a9f-8846-a53144e13356 - The unique app identifier (UUID)
Currency-Code: GBP -Three digit ISO currency code
Poq-User-Id: 3f332b0c-9ed0-4ebc-8ebe-ba13f429f3ff - An auto-generated user ID (UUID)
User-Agent: MyShop/15.0 - User agent passed from the iOS or Android SDK to Poq backend
X-Forwarded-For: 127.0.0.1 - IP Address of the client

Response

The response from your system only needs to include the added and modified fields. In this case, the availability of the product is explicitly set to false in real time.

The number of the products in the response must exactly match the number of the products in the request.

200 OK

[
{
"variants": {
"sku_51": {
"stock": {
"available": false
}
}
}
}
]