Sending GET request to this url, returns collection of PRODUCT VARIANTS resources that belong to given shop and product.
You can narrow down list of resources by passing proper query parameters (list of which you can find below in request params section). You can basically search by:
`description` fields can be a pattern and we will try to match this phrase.
You can specify which page of results you want and how many results per page should be there. You can also specify sort-order using one or more of allowed fields (listed below in request params section).
Last but not least you can even specify which fields from resource you want to get. If you pass param `fields` with list of fields (separated by comma [,]) we will return list of resources with only those fields (we will always add resource id to ensure that you can use that data later on)
Returns status code
200
Request url
/shops/p/products/P/?query[name]=foo&query[sku]=SKU&query[createdOn][from]=2010-10-13&query[createdOn][to]=2020-03-15
Request params
Field name | Field type | Field description |
---|
query | hash | Used to search only resources that meets criteria. You can specify multiple parameters, then it uses AND logic.Key | Possible values if fixed |
---|
name | * | sku | * | description | * | createdOn | createdOn[from]={Y-m-d}&createdOn[to]={Y-m-d} - It can be also UTC format |
|
fields | string | List of fields that should be returned. Id is always returned. Fields should be separated by comma |
sort | hash | Enable sorting using specified field (set as a key) and order (set as a value). You can specify multiple fields to sort by.Key | Possible values if fixed |
---|
createdOn | asc,desc |
|
perPage | int | Number results on page |
page | int | Page number |
Example Response
[
{
"variantId": "VTB",
"href": "https://api.getresponse.com/v3/shops/nM/products/9I/variants/VTB",
"name": "Red Monster Cap",
"url": "https://somedomain.com/products/456/variant/4",
"price": 20,
"priceTax": 23,
"previousPrice": null,
"previousPriceTax": null,
"quantity": 200,
"position": 1,
"barcode": "12455687",
"sku": "SKU-1254-56-457-5689",
"externalId": "127788",
"description": "Red Cap with GetResponse Monster print",
"images": [
{
"imageId": "hY",
"href": "https://api.getresponse.com/v3/shops/nM/images/hY",
"src": "http://somedomain.com/images/src/img58db7ec64bab9.png",
"position": "1"
}
],
"metaFields": [
{
"metaFieldId": "p0U",
"href": "https://api.getresponse.com/v3/shops/nM/meta-fields/p0U",
"name": "colour",
"value": "red",
"valueType": "string"
},
{
"metaFieldId": "hyk",
"href": "https://api.getresponse.com/v3/shops/nM/meta-fields/hyk",
"name": "size",
"value": "large",
"valueType": "string"
}
],
"taxes": [
{
"taxId": "pZz",
"href": "https://api.getresponse.com/v3/shops/nM/taxes/pZz",
"name": "VAT",
"rate": 23
}
],
"createdOn": "2017-03-29T09:30:46+0000",
"updatedOn": "2017-04-05T10:29:40+0000"
}
]
Possible Errors
Method returns PRODUCT VARIANT according to given variantId in context of given shopId and productId
Returns status code
200
Request url
/shops/V/products/P/variants/d?fields=name
Request params
Field name | Field type | Field description |
---|
fields | string | List of fields that should be returned. Id is always returned. Fields should be separated by comma |
Example Response
{
"variantId": "VTB",
"href": "https://api.getresponse.com/v3/shops/nM/products/9I/variants/VTB",
"name": "Red Monster Cap",
"url": "https://somedomain.com/products/456/variant/4",
"price": 20,
"priceTax": 23,
"previousPrice": null,
"previousPriceTax": null,
"quantity": 200,
"position": 1,
"barcode": "12455687",
"sku": "SKU-1254-56-457-5689",
"externalId": "127788",
"description": "Red Cap with GetResponse Monster print",
"images": [
{
"imageId": "hY",
"href": "https://api.getresponse.com/v3/shops/nM/images/hY",
"src": "http://somedomain.com/images/src/img58db7ec64bab9.png",
"position": "1"
}
],
"metaFields": [
{
"metaFieldId": "p0U",
"href": "https://api.getresponse.com/v3/shops/nM/meta-fields/p0U",
"name": "colour",
"value": "red",
"valueType": "string"
},
{
"metaFieldId": "hyk",
"href": "https://api.getresponse.com/v3/shops/nM/meta-fields/hyk",
"name": "size",
"value": "large",
"valueType": "string"
}
],
"taxes": [
{
"taxId": "pZz",
"href": "https://api.getresponse.com/v3/shops/nM/taxes/pZz",
"name": "VAT",
"rate": 23
}
],
"createdOn": "2017-03-29T09:30:46+0000",
"updatedOn": "2017-04-05T10:29:40+0000"
}
Possible Errors
Sending a POST request to this url, will create a new PRODUCT VARIANT resource.
In order to create a new PRODUCT VARIANT, you need to send PRODUCT VARIANT resource in BODY of the request (remember that you need to serialize body into JSON string)
There is no need to create every elements (like: image, meta-field, tax) one by one by their own endpoints, all these elements can be created during this method.
Returns status code
201
Example Request Body
{
"name": "Red Monster Cap",
"url": "https://somedomain.com/products/456/variant/4",
"price": 20,
"priceTax": 23,
"previousPrice": null,
"previousPriceTax": null,
"quantity": 200,
"position": 1,
"barcode": "12455687",
"sku": "SKU-1254-56-457-5689",
"externalId": "127788",
"description": "Red Cap with GetResponse Monster print",
"images": [
{
"src": "http://somedomain.com/images/src/img58db7ec64bab9.png",
"position": "1"
}
],
"metaFields": [
{
"name": "colour",
"value": "red",
"valueType": "string"
},
{
"name": "size",
"value": "large",
"valueType": "string"
}
],
"taxes": [
{
"name": "VAT",
"rate": 23
}
]
}
Body params
Field name | Field type | Field description |
---|
name (required) | string | Name of the variant |
url | string | External url of the variant |
price (required) | float | Price |
priceTax (required) | float | Price including tax |
sku (required) | string | Stock-keeping unit of variant. Must be unique within product |
previousPrice | float | Price before change |
previousPriceTax | float | Price before change including tax |
quantity | integer | Quantity of variant items. Set 1 by default |
position | integer | Position of variant |
barcode | string | Barcode of variant, maximum 255 characters |
description | string | Description of variant, maximum 1000 characters |
externalId | string | Variant external ID |
images | collection | Collection of variant imagesField name | Field type | Field description |
---|
src (required) | string | Source url of image | position (required) | integer | Position of image |
|
metaFields | collection | Collection of variant meta fieldsField name | Field type | Field description |
---|
name (required) | string | Name, minLength=3, maxLength=63 | value (required) | string | Meta value , minLength=0, maxLength=65000 | valueType (required) | string | One of values: 'string' or 'integer' | description | string | Meta description minLength=0, maxLength=255 |
|
taxes | collection | Collection of variant taxesField name | Field type | Field description |
---|
name (required) | string | Name | rate (required) | string | Rate value, min=0, max=99.9 |
|
Example Response
{
"variantId": "VTB",
"href": "https://api.getresponse.com/v3/shops/nM/products/9I/variants/VTB",
"name": "Red Monster Cap",
"url": "https://somedomain.com/products/456/variant/4",
"price": 20,
"priceTax": 23,
"previousPrice": null,
"previousPriceTax": null,
"quantity": 200,
"position": 1,
"barcode": "12455687",
"sku": "SKU-1254-56-457-5689",
"externalId": "127788",
"description": "Red Cap with GetResponse Monster print",
"images": [
{
"imageId": "hY",
"href": "https://api.getresponse.com/v3/shops/nM/images/hY",
"src": "http://somedomain.com/images/src/img58db7ec64bab9.png",
"position": "1"
}
],
"metaFields": [
{
"metaFieldId": "p0U",
"href": "https://api.getresponse.com/v3/shops/nM/meta-fields/p0U",
"name": "colour",
"value": "red",
"valueType": "string"
},
{
"metaFieldId": "hyk",
"href": "https://api.getresponse.com/v3/shops/nM/meta-fields/hyk",
"name": "size",
"value": "large",
"valueType": "string"
}
],
"taxes": [
{
"taxId": "pZz",
"href": "https://api.getresponse.com/v3/shops/nM/taxes/pZz",
"name": "VAT",
"rate": 23
}
],
"createdOn": "2017-03-29T09:30:46+0000",
"updatedOn": "2017-04-05T10:29:40+0000"
}
Possible Errors
Update properties of PRODUCTS VARIANT. You should send only those fields that need to be changed. The rest of properties will stay the same. However In case of updateing metaFields, images and taxes You must send entire collections, individual fields cannot be updated. If You want to update individual fields of metaFields or taxes resources You can do so by POSTING to their particular endpoints, i.e:
- taxes - /v3/shops/{shopId}/taxes/{taxeId}
- metaFields - /v3/shops/{shopId}/meta-fields/{metaFieldId}
Returns status code
200
Example Request Body
{
"name": "Red Monster Cap",
"url": "https://somedomain.com/products/456/variant/4",
"price": 20,
"priceTax": 23,
"previousPrice": null,
"previousPriceTax": null,
"quantity": 200,
"position": 1,
"barcode": "12455687",
"sku": "SKU-1254-56-457-5689",
"externalId": "127788",
"description": "Red Cap with GetResponse Monster print",
"images": [
{
"src": "http://somedomain.com/images/src/img58db7ec64bab9.png",
"position": "1"
}
],
"metaFields": [
{
"name": "colour",
"value": "red",
"valueType": "string"
},
{
"name": "size",
"value": "large",
"valueType": "string"
}
],
"taxes": [
{
"name": "VAT",
"rate": 23
}
]
}
Body params
Field name | Field type | Field description |
---|
name | string | Name of the variant |
url | string | External url of the variant |
price | float | Price |
priceTax | float | Price including tax |
sku | string | Stock-keeping unit of variant. Must be unique within product |
previousPrice | float | Price before change |
previousPriceTax | float | Price before change including tax |
quantity | integer | Quantity of variant items. Set 1 by default |
position | integer | Position of variant |
barcode | string | Barcode of variant, maximum 255 characters |
externalId | string | Variant external ID |
description | string | Description of variant, maximum 1000 characters |
images | collection | Collection of variant imagesField name | Field type | Field description |
---|
src (required) | string | Source url of image | position (required) | integer | Position of image |
|
metaFields | collection | Collection of variant meta fieldsField name | Field type | Field description |
---|
name (required) | string | Name, minLength=3, maxLength=63 | value (required) | string | Meta value , minLength=0, maxLength=65000 | valueType (required) | string | One of values: 'string' or 'integer' | description | string | Meta description minLength=0, maxLength=255 |
|
taxes | collection | Collection of variant taxesField name | Field type | Field description |
---|
name (required) | string | Name | rate (required) | string | Rate value, min=0, max=99.9 |
|
Example Response
{
"variantId": "VTB",
"href": "https://api.getresponse.com/v3/shops/nM/products/9I/variants/VTB",
"name": "Red Monster Cap",
"url": "https://somedomain.com/products/456/variant/4",
"price": 20,
"priceTax": 23,
"previousPrice": null,
"previousPriceTax": null,
"quantity": 200,
"position": 1,
"barcode": "12455687",
"sku": "SKU-1254-56-457-5689",
"externalId": "127788",
"description": "Red Cap with GetResponse Monster print",
"images": [
{
"imageId": "hY",
"href": "https://api.getresponse.com/v3/shops/nM/images/hY",
"src": "http://somedomain.com/images/src/img58db7ec64bab9.png",
"position": "1"
}
],
"metaFields": [
{
"metaFieldId": "p0U",
"href": "https://api.getresponse.com/v3/shops/nM/meta-fields/p0U",
"name": "colour",
"value": "red",
"valueType": "string"
},
{
"metaFieldId": "hyk",
"href": "https://api.getresponse.com/v3/shops/nM/meta-fields/hyk",
"name": "size",
"value": "large",
"valueType": "string"
}
],
"taxes": [
{
"taxId": "pZz",
"href": "https://api.getresponse.com/v3/shops/nM/taxes/pZz",
"name": "VAT",
"rate": 23
}
],
"createdOn": "2017-03-29T09:30:46+0000",
"updatedOn": "2017-04-05T10:29:40+0000"
}
Possible Errors
Returns status code
204
Possible Errors