MobiariDocs
Admin APIProducts

Look up a variant by SKU or barcode

GET
/stores/{store_id}/variants/lookup

For scanning: finds the variant whose SKU (case-insensitive) or barcode equals code, falling back to a product whose GTIN, EAN or UPC equals it. Returns the variant with its options and stock per location, and its product as a list row. Drafts and archived products are found too. When the code is shared (match_count above 1), matches lists every match so the user can pick one.

Authorization

bearer_auth
AuthorizationBearer <token>

Authorization: Bearer <token>. Either a session access token from POST /auth/login (refresh it with POST /auth/refresh) or a store API token (mobi_st_…). A store API token works only for the store it was issued in, and can do at most what its issuing user can there, narrowed to the scopes it was issued with.

In: header

Path Parameters

store_id*string

Store id

Formatuuid

Query Parameters

code*string

An exact SKU (case-insensitive) or barcode/GTIN/EAN/UPC, as typed or scanned. Surrounding whitespace is ignored.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/variants/lookup?code=string"
{
  "match_count": 0,
  "matched_on": "sku",
  "matches": [
    {
      "product": {
        "availability": "in_stock",
        "available_stock": 0,
        "created_at": "2019-08-24T14:15:22Z",
        "expected_availability_at": "2019-08-24T14:15:22Z",
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "is_launch": true,
        "price_max_cents": 0,
        "price_min_cents": 0,
        "primary_image_filename": "string",
        "primary_image_thumbnail_url": "string",
        "primary_image_url": "string",
        "priority": 0,
        "product_type": "single",
        "short_description": "string",
        "sku_prefix": "string",
        "slug": "string",
        "status": "draft",
        "store_id": "7fe87115-950c-4ae8-bd7e-970406bc9ac0",
        "title": "string",
        "total_stock": 0,
        "updated_at": "2019-08-24T14:15:22Z",
        "variant_count": 0,
        "variants": [
          {
            "available_quantity": 0,
            "backorderable": true,
            "barcode": "string",
            "compare_at_cents": 0,
            "cost_cents": 0,
            "created_at": "2019-08-24T14:15:22Z",
            "expected_availability_at": "2019-08-24T14:15:22Z",
            "fulfillment_mode": "stocked",
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "is_active": true,
            "lead_time_days": 0,
            "position": 0,
            "price_cents": 0,
            "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
            "reserved_quantity": 0,
            "sku": "string",
            "stock_quantity": 0,
            "title": "string",
            "updated_at": "2019-08-24T14:15:22Z",
            "uses_components": true
          }
        ]
      },
      "variant": {
        "available_quantity": 0,
        "backorderable": true,
        "barcode": "string",
        "compare_at_cents": 0,
        "cost_cents": 0,
        "created_at": "2019-08-24T14:15:22Z",
        "expected_availability_at": "2019-08-24T14:15:22Z",
        "fulfillment_mode": "stocked",
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "is_active": true,
        "lead_time_days": 0,
        "position": 0,
        "price_cents": 0,
        "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
        "reserved_quantity": 0,
        "sku": "string",
        "stock_quantity": 0,
        "title": "string",
        "updated_at": "2019-08-24T14:15:22Z",
        "uses_components": true,
        "options": [
          {
            "color_hex": "string",
            "option_group_id": "839e5b1e-eb80-492c-ba15-c658a7e6dc75",
            "option_group_name": "string",
            "option_value": "string",
            "option_value_id": "6a860e5d-cc97-4904-8a57-05aef1fdc05f"
          }
        ],
        "stock_by_location": [
          {
            "available": 0,
            "location_id": "46910cc3-ab41-4b80-b4a7-94dab9f1b795",
            "location_name": "string",
            "on_hand": 0,
            "reserved": 0
          }
        ]
      }
    }
  ],
  "product": {
    "availability": "in_stock",
    "available_stock": 0,
    "created_at": "2019-08-24T14:15:22Z",
    "expected_availability_at": "2019-08-24T14:15:22Z",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "is_launch": true,
    "price_max_cents": 0,
    "price_min_cents": 0,
    "primary_image_filename": "string",
    "primary_image_thumbnail_url": "string",
    "primary_image_url": "string",
    "priority": 0,
    "product_type": "single",
    "short_description": "string",
    "sku_prefix": "string",
    "slug": "string",
    "status": "draft",
    "store_id": "7fe87115-950c-4ae8-bd7e-970406bc9ac0",
    "title": "string",
    "total_stock": 0,
    "updated_at": "2019-08-24T14:15:22Z",
    "variant_count": 0,
    "variants": [
      {
        "available_quantity": 0,
        "backorderable": true,
        "barcode": "string",
        "compare_at_cents": 0,
        "cost_cents": 0,
        "created_at": "2019-08-24T14:15:22Z",
        "expected_availability_at": "2019-08-24T14:15:22Z",
        "fulfillment_mode": "stocked",
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "is_active": true,
        "lead_time_days": 0,
        "position": 0,
        "price_cents": 0,
        "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
        "reserved_quantity": 0,
        "sku": "string",
        "stock_quantity": 0,
        "title": "string",
        "updated_at": "2019-08-24T14:15:22Z",
        "uses_components": true
      }
    ]
  },
  "variant": {
    "available_quantity": 0,
    "backorderable": true,
    "barcode": "string",
    "compare_at_cents": 0,
    "cost_cents": 0,
    "created_at": "2019-08-24T14:15:22Z",
    "expected_availability_at": "2019-08-24T14:15:22Z",
    "fulfillment_mode": "stocked",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "is_active": true,
    "lead_time_days": 0,
    "position": 0,
    "price_cents": 0,
    "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
    "reserved_quantity": 0,
    "sku": "string",
    "stock_quantity": 0,
    "title": "string",
    "updated_at": "2019-08-24T14:15:22Z",
    "uses_components": true,
    "options": [
      {
        "color_hex": "string",
        "option_group_id": "839e5b1e-eb80-492c-ba15-c658a7e6dc75",
        "option_group_name": "string",
        "option_value": "string",
        "option_value_id": "6a860e5d-cc97-4904-8a57-05aef1fdc05f"
      }
    ],
    "stock_by_location": [
      {
        "available": 0,
        "location_id": "46910cc3-ab41-4b80-b4a7-94dab9f1b795",
        "location_name": "string",
        "on_hand": 0,
        "reserved": 0
      }
    ]
  }
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}