Shop.app API endpoint
Returns the exact public product variant matching selected options. selected_options must be a JSON object when provided. Repeated option filters may also be sent as option.Name=value or option[Name]=value.
/shop-app/products/{id}/variantPath parameters:
id: required. Shop.app product id. Example: 4596217053229.Query parameters:
selected_options: optional JSON object. Example: {"Colour":"Black","Size":"7","Width":"6E"}.option.Name: optional repeated query form for selected options. Example: option.Colour=Black&option.Size=7&option.Width=6E.option[Name]: optional repeated query map form for selected options.Notable response behavior:
selected_options returns an invalid-param error before upstream IO.| Field | In the sample | Value in the sample |
|---|---|---|
| product_id | Has a value | |
| variant.id | Has a value | |
| variant.gid | Has a value | |
| variant.title | Has a value | “Black / 7 / 6E” |
| variant.options | Has a value | |
| variant.price | Has a value | 169.95 |
| variant.currency | Has a value | “EUR” |
| variant.available_for_sale | Has a value | true |
| variant.requires_shipping | Has a value | true |
| variant.image | Has a value |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| id (path) | string | Yes | Product id | 4596217053229 | |
| selected_options | string | No | Selected options JSON object | {"Colour":"Black","Size":"7","Width":"6E"} | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/shop-app/products/4596217053229/variant" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"product_id": "4596217053229",
"variant": {
"id": "34761278160941",
"title": "Black / 7 / 6E",
"available_for_sale": true
}
}
}Request schema
No body schema
Response schema
#/definitions/shopapp.productVariantResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | shopapp.ProductVariantResponse | No | ||||
| data.product_id | string | No | 4596217053229 | Shop.app ID of the product. | ||
| data.variant | object | No | Variant that matches the selected options. | |||
| data.variant.available_for_sale | boolean | No | `true` when the variant can be bought. | |||
| data.variant.currency | string | No | Currency code of `price` and `original_price`. | |||
| data.variant.gid | string | No | gid://shopify/ProductVariant/34761278160941 | Shopify global ID of the variant. | ||
| data.variant.id | string | No | 34761278160941 | Shop.app variant ID. | ||
| data.variant.image | object | No | Image of the variant. | |||
| data.variant.image.alt | string | No | Product image | Alt text of the image. | ||
| data.variant.image.url | string | No | https://cdn.shopify.com/example.jpg | URL of the image. | ||
| data.variant.options | object | No | Option values of the variant keyed by option name, for example `Size`. | |||
| data.variant.original_price | number | No | Price before the discount, in `currency`. | |||
| data.variant.price | number | No | Current price of the variant, in `currency`. | |||
| data.variant.requires_shipping | boolean | No | `true` when the variant has to be shipped. | |||
| data.variant.title | string | No | Black / 7 / 6E | Variant title, for example `Black / 7 / 6E`. | ||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/shop-app/products/4596217053229/variant" \
-H "x-api-key: $CRAWLORA_API_KEY"