# Price Lists

# Price List Index Endpoint

#### Structure

See [View Price List Endpoint](https://support.aerocommerce.com/books/api/page/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

```json
{
    "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
}
```

<p class="callout info">See [View Price List Endpoint](https://support.aerocommerce.com/books/api/page/view-price-list-endpoint) for the structure of the price list payload inside the `data` array.</p>

# View Price List Endpoint

#### Structure

##### Price List

<table border="1" id="bkmrk-name-type-descriptio" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the price list</td></tr><tr><td>`name`</td><td>string</td><td>The name of the price list</td></tr><tr><td>`applies_to`</td><td>string</td><td>The applies to of the price list (e.g., everyone, not-customers, customers, groups)</td></tr><tr><td>`start_at`</td><td>timestamp</td><td>The start at of the price list</td></tr><tr><td>`end_at`</td><td>timestamp</td><td>The end at of the price list</td></tr><tr><td>`entries`</td><td>array</td><td>An array of [Entry](https://support.aerocommerce.com/books/api/page/view-price-list-endpoint#bkmrk-entry) objects</td></tr><tr><td>`customer_groups`</td><td>array</td><td>An array of [Customer Group](https://support.aerocommerce.com/books/api/page/view-price-list-endpoint#bkmrk-customer-group) objects</td></tr></tbody></table>

##### Entry

<table border="1" id="bkmrk-name-type-descriptio-1" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the price list entry</td></tr><tr><td>`for`</td><td>string</td><td>What the entry applies to (e.g., all\_products, all\_products\_unless\_reduced, product, variant, category, tag, manufacturer)</td></tr><tr><td>`target`</td><td>string</td><td>Identifier of the target (if applicable) — e.g. product id, variant id, category id, etc...</td></tr><tr><td>`type`</td><td>string</td><td>Type of price adjustment (e.g., fixed\_price, fixed\_price\_decrease, fixed\_price\_increase, percentage\_decrease, percentage\_increase)</td></tr><tr><td>`price`</td><td>object</td><td>The [Price](https://support.aerocommerce.com/books/api/page/view-price-list-endpoint#bkmrk-price) object (only present when `type` is *fixed* based)</td></tr><tr><td>`percentage`</td><td>float</td><td>Percentage value (only present when `type` is *percentage* based)</td></tr><tr><td>`for_price`</td><td>string</td><td>Which price the entry affects (e.g., sale\_price, base\_price, rrp, cost\_price)</td></tr></tbody></table>

##### Price

<table border="1" id="bkmrk-name-type-descriptio-2" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td></tr><tr><td>`amount`</td><td>float</td><td>The price **including tax**, in whole units (e.g., `10` = `£10`)</td></tr><tr><td>`currency`</td><td>string</td><td>The currency for the price (e.g., GBP)</td></tr></tbody></table>

##### Customer Group

<table border="1" id="bkmrk-name-type-descriptio-3" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the customer group</td></tr><tr><td>`name`</td><td>string</td><td>The name of the customer group</td></tr><tr><td>`start_at`</td><td>timestamp</td><td>The start at for the customer group</td></tr><tr><td>`end_at`</td><td>timestamp</td><td>The end at for the customer group</td></tr></tbody></table>

#### Example Request

```
GET /api/price-lists/{id}
```

#### Example Response

```json
{
  "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

<table border="1" id="bkmrk-name-type-descriptio" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the price list</td><td>No</td></tr><tr><td>`name`</td><td>string</td><td>The name of the price list</td><td>Yes</td></tr><tr><td>`applies_to`</td><td>string</td><td>The applies to of the price list (everyone, not-customers, customers, groups)</td><td>Yes</td></tr><tr><td>`start_at`</td><td>timestamp</td><td>The start at of the price list</td><td>No</td></tr><tr><td>`end_at`</td><td>timestamp</td><td>The end at of the price list</td><td>No</td></tr><tr><td>`entries`</td><td>array</td><td>An array of [Entry](https://support.aerocommerce.com/books/api/page/create-price-list#bkmrk-entry) objects</td><td>No</td></tr><tr><td>`customer_groups`</td><td>array</td><td>An array of [Customer Group](https://support.aerocommerce.com/books/api/page/create-price-list#bkmrk-customer-group) objects (only required when `applies_to` = "groups")</td><td>No</td></tr></tbody></table>

##### Entry

<table border="1" id="bkmrk-name-type-descriptio-1" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id for the entry</td><td>No</td></tr><tr><td>`for`</td><td>string</td><td>What the entry applies to (e.g., all\_products, all\_products\_unless\_reduced, product, variant, category, tag, manufacturer)</td><td>Yes</td></tr><tr><td>`target`</td><td>string</td><td>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)</td><td>Conditional</td></tr><tr><td>`type`</td><td>string</td><td>Type of the price adjustment (e.g., fixed\_price, fixed\_price\_decrease, fixed\_price\_increase, percentage\_decrease, percentage\_increase)</td><td>Yes</td></tr><tr><td>`price`</td><td>object</td><td>The [Price](https://support.aerocommerce.com/books/api/page/create-price-list#bkmrk-price) object (not required when `type` is *percentage* based)</td><td>Conditional</td></tr><tr><td>`percentage`</td><td>float</td><td>The percentage of the price list entry (only required when `type` is *percentage* based)</td><td>Conditional</td></tr><tr><td>`for_price`</td><td>string</td><td>Which price the entry affects (e.g., sale\_price, base\_price, rrp, cost\_price)</td><td>Yes</td></tr></tbody></table>

##### Price

<table border="1" id="bkmrk-name-type-descriptio-2" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr><td>`amount`</td><td>float</td><td>The price **including tax**, in whole units (e.g., `10` = `£10`)</td><td>Yes</td></tr><tr><td>`currency`</td><td>string</td><td>The currency for the price (e.g., GBP)</td><td>Yes</td></tr></tbody></table>

##### Customer Group

<table border="1" id="bkmrk-name-type-descriptio-3" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the customer group</td><td>Yes</td></tr><tr><td>`start_at`</td><td>timestamp</td><td>The start at for the customer group</td><td>No</td></tr><tr><td>`end_at`</td><td>timestamp</td><td>The end at for the customer group</td><td>No</td></tr></tbody></table>

#### Example Request

```
POST /api/price-lists
```

```json
{
  "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

```json
{
    "priceList": {
        "id": 1
    }
}
```

# Update Price List

#### Structure

##### Price List

<table border="1" id="bkmrk-name-type-descriptio" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr><td>`name`</td><td>string</td><td>The name of the price list</td><td>No</td></tr><tr><td>`applies_to`</td><td>string</td><td>The applies to of the price list (everyone, not-customers, customers, groups)</td><td>No</td></tr><tr><td>`start_at`</td><td>timestamp</td><td>The start at of the price list</td><td>No</td></tr><tr><td>`end_at`</td><td>timestamp</td><td>The end at of the price list</td><td>No</td></tr><tr><td>`customer_groups`</td><td>array</td><td>An array of [Customer Group](https://support.aerocommerce.com/books/api/page/update-price-list/update-price-list#bkmrk-customer-group) objects (only required when `applies_to` = "groups")</td><td>No</td></tr></tbody></table>

##### Customer Group

<table border="1" id="bkmrk-name-type-descriptio-3" style="border-collapse: collapse; width: 100%; height: 737.907px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the customer group</td><td>Yes</td></tr><tr><td>`start_at`</td><td>timestamp</td><td>The start at for the customer group</td><td>No</td></tr><tr><td>`end_at`</td><td>timestamp</td><td>The end at for the customer group</td><td>No</td></tr></tbody></table>

#### Example Request

```
PUT /api/price-lists/{id}
```

```json
{
    "name": "API Test Updated",
    "applies_to": "customers"
}
```

#### Example Response

```json
{
    "priceList": {
        "id": 1
    }
}
```