» Variation GET API Documentation

Getting All Product Variations

Endpoint: GET /admin/variations

Purpose

This API retrieves a list of product variations available in the system for administrative use. Variations represent different attributes a product can have and help administrators manage configurable product listings. Each variation includes options such as label, value, order, default status, and visual representation. The response also supports pagination and sorting, making it efficient to handle large variation datasets.

Path Parameters

No path parameters for this endpoint.

Query Parameters

ParameterTypeDescription
limitIntegerNumber of variations per request.
offsetIntegerStarting point for pagination.
order_byStringField to sort results.
directionStringSort order.

Use Case

Administrators use this endpoint to retrieve a structured list of product attribute variations. Each variation includes metadata such as its display type and whether it’s marked as disposable. Options under each variation define the available choices, which can include visual representations like color swatches or text. Sorting and pagination allow for streamlined data retrieval, making it easy to manage and edit product configurations within the admin interface.

Request Body

No data is required for the request body.

Response

The response returns a paginated list of all available variations in the system. Each variation object includes its unique ID, name, input standard ( text), and whether the variation is disposable. It also contains an array of associated options, detailing each option's ID, label, value, order, default status, and image reference. The response includes pagination metadata such as total records, current limit, offset, and navigational links for previous and next pages enabling efficient loading and navigation of large variation datasets in the admin panel.

GET
https://{your_site_domain}/api/v4/admin/variations
Try It Out
{
  "variations": [
    {
      "id": "VARIATION_ID_1",
      "name": "VARIATION_NAME_1",
      "standard": "VARIATION_STANDARD_1",
      "is_disposable": "VARIATION_IS_DISPOSABLE_1",
      "options": [
        {
          "id": "VARIATION_OPTION_ID_1",
          "label": "VARIATION_OPTION_LABEL_1",
          "value": "VARIATION_OPTION_VALUE_1",
          "order": "VARIATION_OPTION_ORDER_1",
          "default": "VARIATION_OPTION_DEFAULT_1",
          "image": "VARIATION_OPTION_IMAGE_1"
        }
      ]
    },
    {
      "id": "VARIATION_ID_2",
      "name": "VARIATION_NAME_2",
      "standard": "VARIATION_STANDARD_2",
      "is_disposable": "VARIATION_IS_DISPOSABLE_2",
      "options": [
        {
          "id": "VARIATION_OPTION_ID_2_1",
          "label": "VARIATION_OPTION_LABEL_2_1",
          "value": "VARIATION_OPTION_VALUE_2_1",
          "order": "VARIATION_OPTION_ORDER_2_1",
          "default": "VARIATION_OPTION_DEFAULT_2_1",
          "image": "VARIATION_OPTION_IMAGE_2_1"
        },
        {
          "id": "VARIATION_OPTION_ID_2_2",
          "label": "VARIATION_OPTION_LABEL_2_2",
          "value": "VARIATION_OPTION_VALUE_2_2",
          "order": "VARIATION_OPTION_ORDER_2_2",
          "default": "VARIATION_OPTION_DEFAULT_2_2",
          "image": "VARIATION_OPTION_IMAGE_2_2"
        },
        {
          "id": "VARIATION_OPTION_ID_2_3",
          "label": "VARIATION_OPTION_LABEL_2_3",
          "value": "VARIATION_OPTION_VALUE_2_3",
          "order": "VARIATION_OPTION_ORDER_2_3",
          "default": "VARIATION_OPTION_DEFAULT_2_3",
          "image": "VARIATION_OPTION_IMAGE_2_3"
        }
      ]
    }
  ],
  "pagination": {
    "records": "PAGINATION_RECORDS",
    "limit": "PAGINATION_LIMIT",
    "offset": "PAGINATION_OFFSET",
    "previous_page": "PAGINATION_PREVIOUS_PAGE_URL",
    "next_page": "PAGINATION_NEXT_PAGE_URL"
  }
}

Getting Specific Variation

Endpoint: GET /admin/variations/{variation_id}

Purpose

This API fetches detailed information for a single product variation based on its unique identifier. It allows administrators to retrieve all configuration details of a variation, such as its name, type, disposability status, and available options. This endpoint is useful for editing or reviewing a specific variation.

Path Parameters

ParameterTypeDescription
variation_idIntegerThe unique ID of the variation to retrieve.

Query Parameters

No query parameters for this endpoint.

Use Case

An administrator may want to load the complete details of a specific variation—such as "Shirt 5"—to manage or modify it. This includes reviewing or editing its options, like "Small" or "Medium", and identifying the default choice. This endpoint is essential when working with individual variations in detail during product configuration or updates.

Request Body

No data is required for the request body.

Response

The response provides complete details of a specific variation identified by its unique variation_id. It includes the variation's ID, name, standard input type, and a boolean indicating whether it's disposable. The options array outlines all variation choices, with each option containing detailed information like ID, label, value ( image or text), display order, default flag, and associated image. This detailed response supports accurate viewing and editing of a single variation within the admin system.

GET
https://{your_site_domain}/api/v4/admin/variations/{variation_id}
Try It Out
{
  "variation": {
    "id": "VARIATION_ID",
    "name": "VARIATION_NAME",
    "standard": "VARIATION_STANDARD",
    "is_disposable": "VARIATION_IS_DISPOSABLE",
    "options": [
      {
        "id": "VARIATION_OPTION_ID_1",
        "label": "VARIATION_OPTION_LABEL_1",
        "value": "VARIATION_OPTION_VALUE_1",
        "order": "VARIATION_OPTION_ORDER_1",
        "default": "VARIATION_OPTION_DEFAULT_1"
      },
      {
        "id": "VARIATION_OPTION_ID_2",
        "label": "VARIATION_OPTION_LABEL_2",
        "value": "VARIATION_OPTION_VALUE_2",
        "order": "VARIATION_OPTION_ORDER_2",
        "default": "VARIATION_OPTION_DEFAULT_2"
      }
    ]
  }
}