Flavours Partner API
ProductModifierBarcode

Barcode Variants

GET
/api/v2/products/modifiers/barcode/variants

Paginated, searchable list of every barcode-bearing modifier for the export drawer table. Each row carries the owning product (localized name + id), the variant's own localized name and its kind (OPTION for a product option, ADD_ON for an add-on, ADD_ON_GROUP for an add-on-group option), the barcode value and barcode_type, and the id the frontend sends back to /export/product-barcode. Only rows with a non-empty barcode are returned, scoped to the caller's tenant (market). search matches the barcode, the variant name, and the product name. Add-on and add-on-group barcodes are included (the older product-key export dropped them).

Authorization

API-TOKEN
API-TOKEN<token>

Your partner API key. Send it in the API-TOKEN header on every request.

In: header

Header Parameters

X-API-Version*string

API contract version to target. See the Changelog for what changed in each version.

Default"2.0.0"
Value in"2.3.0" | "2.2.0" | "2.1.0" | "2.0.0"

Request Body

application/json

page?|

Must be at least 1.

per_page?|

Must be at least 1.

search?|
sort?|
key_by?|

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://api.flavours.sa/dev/api/v2/products/modifiers/barcode/variants" \  -H "X-API-Version: 2.3.0" \  -H "Content-Type: application/json" \  -d '{}'
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Barcode variants retrieved successfully."
  },
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": 738792838097093,
        "name_en": "Small",
        "name_ar": "صغير",
        "kind": "OPTION",
        "barcode": "BC-DOCS-1",
        "barcode_type": "CODE_128",
        "product": {
          "id": "14136ec6-36b1-42a4-bd1f-fe7e3dcb008b",
          "name_en": "Barcode Latte",
          "name_ar": "لاتيه باركود"
        }
      }
    ],
    "first_page_url": "https://localhost:8000/api/v2/products/modifiers/barcode/variants?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://localhost:8000/api/v2/products/modifiers/barcode/variants?page=1",
    "links": [
      {
        "url": null,
        "label": "&laquo; Previous",
        "page": null,
        "active": false
      },
      {
        "url": "https://localhost:8000/api/v2/products/modifiers/barcode/variants?page=1",
        "label": "1",
        "page": 1,
        "active": true
      },
      {
        "url": null,
        "label": "Next &raquo;",
        "page": null,
        "active": false
      }
    ],
    "next_page_url": null,
    "path": "https://localhost:8000/api/v2/products/modifiers/barcode/variants",
    "per_page": 20,
    "prev_page_url": null,
    "to": 1,
    "total": 1
  }
}
{
  "meta": {
    "code": 401,
    "status": "error",
    "message": "Unauthenticated."
  },
  "data": null
}
{
  "meta": {
    "code": 403,
    "status": "error",
    "message": "Unauthorized."
  },
  "data": null
}
{
  "meta": {
    "code": 404,
    "status": "error",
    "message": "Resource not found."
  },
  "data": null
}
{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Internal server error."
  },
  "data": null
}