Price Lists

Price List Index Endpoint

Structure

See View Price List Endpoint for the structure of the price list payload inside the data array.

Example Request

GET /api/price-lists?per_page=2

Example Response

{
    "current_page": 1,
    "data": [
        //...
    ],
    "first_page_url": "http://aero.test/api/price-lists?page=1",
    "from": 1,
    "last_page": 3,
    "last_page_url": "http://aero.test/api/price-lists?page=3",
    "next_page_url": "http://aero.test/api/price-lists?page=2",
    "path": "http://aero.test/api/price-lists",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 5
}

See View Price List Endpoint for the structure of the price list payload inside the data array.

View Price List Endpoint

Structure

Price List

Name
Type
Description
id int The id of the price list
name string The name of the price list
applies_to string The applies to of the price list (e.g., everyone, not-customers, customers, groups)
start_at timestamp The start at of the price list
end_at timestamp The end at of the price list
entries array An array of Entry objects
customer_groups array An array of Customer Group objects

Entry

Name
Type
Description
id int The id of the price list entry
for string What the entry applies to (e.g., all_products, all_products_unless_reduced, product, variant, category, tag, manufacturer)
target string Identifier of the target (if applicable) — e.g. product id, variant id, category id, etc...
type string Type of price adjustment (e.g., fixed_price, fixed_price_decrease, fixed_price_increase, percentage_decrease, percentage_increase)
price object The Price object (only present when type is fixed based)
percentage float Percentage value (only present when type is percentage based)
for_price string Which price the entry affects (e.g., sale_price, base_price, rrp, cost_price)

Price

Name
Type
Description
amount float The price including tax, in whole units (e.g., 10 = £10)
currency string The currency for the price (e.g., GBP)

Customer Group

Name
Type
Description
id int The id of the customer group
name string The name of the customer group
start_at timestamp The start at for the customer group
end_at timestamp The end at for the customer group

Example Request

GET /api/price-lists/{id}

Example Response

{
  "id": 1,
  "name": "API Test",
  "applies_to": "everyone",
  "start_at": null,
  "end_at": null,
  "entries": [
    {
      "id": 1,
      "for": "all_products",
      "target": null,
      "type": "fixed_price",
      "price": {
        "amount": 10,
        "currency": "GBP"
      },
      "for_price": "base_price"
    },
    {
      "id": 2,
      "for": "all_products_unless_reduced",
      "target": null,
      "type": "fixed_price_decrease",
      "price": {
        "amount": 10,
        "currency": "GBP"
      },
      "for_price": "base_price"
    },
    {
      "id": 3,
      "for": "product",
      "target": 1,
      "type": "percentage_decrease",
      "percentage": 10,
      "for_price": "sale_price"
    },
    {
      "id": 4,
      "for": "variant",
      "target": 1,
      "type": "percentage_decrease",
      "percentage": 10,
      "for_price": "sale_price"
    },
    {
      "id": 5,
      "for": "category",
      "target": 1,
      "type": "percentage_decrease",
      "percentage": 10,
      "for_price": "sale_price"
    },
    {
      "id": 6,
      "for": "tag",
      "target": 1,
      "type": "percentage_decrease",
      "percentage": 10,
      "for_price": "sale_price"
    },
    {
      "id": 7,
      "for": "manufacturer",
      "target": 1,
      "type": "percentage_decrease",
      "percentage": 10,
      "for_price": "sale_price"
    }
  ],
  "customer_groups": []
}

Create Price List

Structure

Price List

Name
Type
Description
Required
id int The id of the price list No
name string The name of the price list Yes
applies_to string The applies to of the price list (everyone, not-customers, customers, groups) Yes
start_at timestamp The start at of the price list No
end_at timestamp The end at of the price list No
entries array An array of Entry objects No
customer_groups array An array of Customer Group objects (only required when applies_to = "groups") No

Entry

Name
Type
Description
Required
id int The id for the entry No
for string What the entry applies to (e.g., all_products, all_products_unless_reduced, product, variant, category, tag, manufacturer) Yes
target string Identifier of the target (e.g., id corresponding to the for or model for product, or sku for variant or name for category/tag/manufacturer) Conditional
type string Type of the price adjustment (e.g., fixed_price, fixed_price_decrease, fixed_price_increase, percentage_decrease, percentage_increase) Yes
price object The Price object (not required when type is percentage based) Conditional
percentage float The percentage of the price list entry (only required when type is percentage based) Conditional
for_price string Which price the entry affects (e.g., sale_price, base_price, rrp, cost_price) Yes

Price

Name
Type
Description
Required
amount float The price including tax, in whole units (e.g., 10 = £10) Yes
currency string The currency for the price (e.g., GBP) Yes

Customer Group

Name
Type
Description
Required
id int The id of the customer group Yes
start_at timestamp The start at for the customer group No
end_at timestamp The end at for the customer group No

Example Request

POST /api/price-lists
{
  "id": 1,
  "name": "API Test",
  "applies_to": "everyone",
  "entries": [
    {
      "for": "all_products",
      "type": "fixed_price",
      "price": {
        "amount": 10,
        "currency": "GBP"
      },
      "for_price": "base_price"
    },
    {
      "for": "all_products_unless_reduced",
      "type": "fixed_price_decrease",
      "price": {
        "amount": 10,
        "currency": "GBP"
      },
      "for_price": "base_price"
    },
    {
      "for": "product",
      "target": 1,
      "type": "percentage_decrease",
      "percentage": 10,
      "for_price": "sale_price"
    },
    {
      "for": "variant",
      "target": 1,
      "type": "percentage_decrease",
      "percentage": 10,
      "for_price": "sale_price"
    },
    {
      "for": "category",
      "target": 1,
      "type": "percentage_decrease",
      "percentage": 10,
      "for_price": "sale_price"
    },
    {
      "for": "tag",
      "target": 1, 
      "type": "percentage_decrease",
      "percentage": 10,
      "for_price": "sale_price"
    },
    {
      "for": "manufacturer",
      "target": 1,
      "type": "percentage_decrease",
      "percentage": 10,
      "for_price": "sale_price"
    }
  ],
  "customer_groups": []
}

Example Response

{
    "priceList": {
        "id": 1
    }
}

Update Price List

Structure

Price List

Name
Type
Description
Required
name string The name of the price list No
applies_to string The applies to of the price list (everyone, not-customers, customers, groups) No
start_at timestamp The start at of the price list No
end_at timestamp The end at of the price list No
customer_groups array An array of Customer Group objects (only required when applies_to = "groups") No

Customer Group

Name
Type
Description
Required
id int The id of the customer group Yes
start_at timestamp The start at for the customer group No
end_at timestamp The end at for the customer group No

Example Request

PUT /api/price-lists/{id}
{
    "name": "API Test Updated",
    "applies_to": "customers"
}

Example Response

{
    "priceList": {
        "id": 1
    }
}