# General

# What are the available endpoints?

#### Orders

<table border="1" id="bkmrk-method-endpoint-perm" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 12.0369%;"></col><col style="width: 37.9035%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td data-col-size="sm" data-end="698" data-start="690">`GET`</td><td data-col-size="sm" data-end="714" data-start="698">`/api/orders`</td><td data-col-size="sm" data-end="731" data-start="714">`orders.index`</td><td data-col-size="sm" data-end="746" data-start="731">List orders</td></tr><tr><td data-col-size="sm" data-end="755" data-start="747">`GET`</td><td data-col-size="sm" data-end="776" data-start="755">`/api/orders/{id}`</td><td data-col-size="sm" data-end="792" data-start="776">`orders.view`</td><td data-col-size="sm" data-end="808" data-start="792">Get an order</td></tr><tr><td data-col-size="sm" data-end="818" data-start="809">`POST`</td><td data-col-size="sm" data-end="834" data-start="818">`/api/orders`</td><td data-col-size="sm" data-end="851" data-start="834">`orders.store`</td><td data-col-size="sm" data-end="870" data-start="851">Create an order</td></tr><tr><td data-col-size="sm" data-end="880" data-start="871">`POST`</td><td data-col-size="sm" data-end="912" data-start="880">`/api/orders/{id}/flags/{id}`</td><td data-col-size="sm" data-end="935" data-start="912">`orders.flags.store`</td><td data-col-size="sm" data-end="952" data-start="935">Attach a flag</td></tr><tr><td data-col-size="sm" data-end="964" data-start="953">`DELETE`</td><td data-col-size="sm" data-end="996" data-start="964">`/api/orders/{id}/flags/{id}`</td><td data-col-size="sm" data-end="1020" data-start="996">`orders.flags.delete`</td><td data-col-size="sm" data-end="1037" data-start="1020">Remove a flag</td></tr><tr><td data-col-size="sm" data-end="1047" data-start="1038">`POST`</td><td data-col-size="sm" data-end="1077" data-start="1047">`/api/orders/{id}/comments`</td><td data-col-size="sm" data-end="1103" data-start="1077">`orders.comments.store`</td><td data-col-size="sm" data-end="1120" data-start="1103">Add a comment</td></tr></tbody></table>

<p class="callout info">You can pass the order `reference` in place of `id`.</p>

<p class="callout info">You can pass the flag `name` in place of the `id`.</p>

#### Fulfillments

<table border="1" id="bkmrk-method-endpoint-perm-1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4416%;"></col><col style="width: 38.4988%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td data-col-size="sm" data-end="1330" data-start="1321">`POST`</td><td data-col-size="sm" data-end="1364" data-start="1330">`/api/orders/{id}/fulfillments`</td><td data-col-size="sm" data-end="1387" data-start="1364">`fulfillments.store`</td><td data-col-size="sm" data-end="1411" data-start="1387">Create a fulfillment</td></tr><tr><td data-col-size="sm" data-end="1423" data-start="1412">`DELETE`</td><td data-col-size="sm" data-end="1462" data-start="1423">`/api/orders/{id}/fulfillments/{id}`</td><td data-col-size="sm" data-end="1486" data-start="1462">`fulfillments.delete`</td><td data-col-size="sm" data-end="1510" data-start="1486">Cancel a fulfillment</td></tr></tbody></table>

<p class="callout info">You can pass the order `reference` in place of `id`.</p>

<p class="callout info">You can pass the fulfillment `reference` in place of `id`.</p>

#### Order Statuses

<table border="1" id="bkmrk-method-endpoint-perm-2" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td class="align-left">`GET`</td><td>`/api/order-statuses`</td><td>`order-statuses.index`</td><td>List order statuses</td></tr><tr><td class="align-left">`GET`</td><td>`/api/order-statuses/{id}`</td><td>`order-statuses.view`</td><td>Get an order status</td></tr></tbody></table>

#### Products

<table border="1" id="bkmrk-method-endpoint-perm-3" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td align="center" class="align-left" style="height: 29.7969px;">`GET`</td><td style="height: 29.7969px;">`/api/products`</td><td style="height: 29.7969px;">`products.index`</td><td style="height: 29.7969px;">List products</td></tr><tr><td class="align-left" style="height: 29.7969px;">`GET`</td><td style="height: 29.7969px;">`/api/products/search`</td><td style="height: 29.7969px;">`products.search`</td><td style="height: 29.7969px;">Search products</td></tr><tr><td class="align-left" style="height: 29.7969px;">`GET`</td><td style="height: 29.7969px;">`/api/products/{id}`</td><td style="height: 29.7969px;">`products.view`</td><td style="height: 29.7969px;">Get a product</td></tr><tr><td class="align-left" style="height: 29.7969px;">`POST`</td><td style="height: 29.7969px;">`/api/products`</td><td style="height: 29.7969px;">`products.store`</td><td style="height: 29.7969px;">Create a product</td></tr><tr><td class="align-left" style="height: 29.7969px;">`PUT`</td><td style="height: 29.7969px;">`/api/products/{id}`</td><td style="height: 29.7969px;">`products.update`</td><td style="height: 29.7969px;">Update a product</td></tr></tbody></table>

<p class="callout info">You can pass the product `model` in place of `id`.</p>

<p class="callout info">The `search` route allows for filtering at document level rather than eloquent level.</p>

#### Variants

<table border="1" id="bkmrk-method-endpoint-perm-4" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`POST`</td><td>`/api/products/{id}/variants`</td><td>`variants.store`</td><td>Create a variant</td></tr><tr><td>`PUT`</td><td>`/api/products/{id}/variants/{id}`</td><td>`variants.update`</td><td>Update a variant</td></tr></tbody></table>

<p class="callout info">You can pass the product `model` in place of `id`.</p>

<p class="callout info">You can pass the variant `sku` in place of `id`.</p>

#### Manufacturers

<table border="1" id="bkmrk-method-endpoint-perm-5" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/manufacturers`</td><td>`manufacturers.index`</td><td>List manufacturers</td></tr><tr><td>`GET`</td><td>`/api/manufacturers/{id}`</td><td>`manufacturers.view`</td><td>Get a manufacturer</td></tr><tr><td>`POST`</td><td>`/api/manufacturers`</td><td>`manufacturers.store`</td><td>Create a manufacturer</td></tr><tr><td>`PUT`</td><td>`/api/manufacturers/{id}`</td><td>`manufacturers.update`</td><td>Update a manufacturer</td></tr><tr><td>`DELETE`</td><td>`/api/manufacturers/{id}`</td><td>`manufacturers.delete`</td><td>Delete a manufacturer</td></tr></tbody></table>

<p class="callout info">You can pass the manufacturer `name` in place of `id`.</p>

#### Attribute Groups

<table border="1" id="bkmrk-method-endpoint-perm-6" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/attribute-groups`</td><td>`attribute-groups.index`</td><td>List attribute groups</td></tr><tr><td>`GET`</td><td>`/api/attribute-groups/{id}`</td><td>`attribute-groups.view`</td><td>Get an attribute group</td></tr><tr><td>`POST`</td><td>`/api/attribute-groups`</td><td>`attribute-groups.store`</td><td>Create an attribute group</td></tr><tr><td>`PUT`</td><td>`/api/attribute-groups/{id}`</td><td>`attribute-groups.update`</td><td>Update an attribute group</td></tr><tr><td>`DELETE`</td><td>`/api/attribute-groups/{id}`</td><td>`attribute-groups.delete`</td><td>Delete an attribute group</td></tr></tbody></table>

<p class="callout info">You can pass the attribute group `name` in place of `id`.</p>

#### Attributes

<table border="1" id="bkmrk-method-endpoint-perm-7" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`POST`</td><td>`/api/attribute-groups/{id}/attributes`</td><td>`attributes.store`</td><td>Create an attribute</td></tr><tr><td>`PUT`</td><td>`/api/attribute-groups/{id}/attributes/{id}`</td><td>`attributes.update`</td><td>Update an attribute</td></tr><tr><td>`DELETE`</td><td>`/api/attribute-groups/{id}/attributes/{id}`</td><td>`attributes.delete`</td><td>Delete an attribute</td></tr></tbody></table>

<p class="callout info">You can pass the attribute group `name` in place of `id`.</p>

<p class="callout info">You can pass the attribute `name` in place of `id`.</p>

#### Categories

<table border="1" id="bkmrk-method-endpoint-perm-8" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/categories`</td><td>`categories.index`</td><td>List categories</td></tr><tr><td>`GET`</td><td>`/api/categories/{id}`</td><td>`categories.view`</td><td>Get a category</td></tr><tr><td>`POST`</td><td>`/api/categories`</td><td>`categories.store`</td><td>Create a category</td></tr><tr><td>`PUT`</td><td>`/api/categories/{id}`</td><td>`categories.update`</td><td>Update a category</td></tr><tr><td>`DELETE`</td><td>`/api/categories/{id}`</td><td>`categories.delete`</td><td>Delete a category</td></tr></tbody></table>

<p class="callout info">You can pass the category `name` or `breadcrumb` in place of `id`.</p>

#### Tag Groups

<table border="1" id="bkmrk-method-endpoint-perm-9" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/tag-groups`</td><td>`tag-groups.index`</td><td>List tag groups</td></tr><tr><td>`GET`</td><td>`/api/tag-groups/{id}`</td><td>`tag-groups.view`</td><td>Get a tag group</td></tr><tr><td>`POST`</td><td>`/api/tag-groups`</td><td>`tag-groups.store`</td><td>Create a tag group</td></tr><tr><td>`PUT`</td><td>`/api/tag-groups/{id}`</td><td>`tag-groups.update`</td><td>Update a tag group</td></tr><tr><td>`DELETE`</td><td>`/api/tag-groups/{id}`</td><td>`tag-groups.delete`</td><td>Delete a tag group</td></tr></tbody></table>

<p class="callout info">You can pass the tag group `name` in place of `id`.</p>

#### Tags

<table border="1" id="bkmrk-method-endpoint-perm-10" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`POST`</td><td>`/api/tag-groups/{id}/tags`</td><td>`tags.store`</td><td>Create a tag</td></tr><tr><td>`PUT`</td><td>`/api/tag-groups/{id}/tags/{id}`</td><td>`tags.update`</td><td>Update a tag</td></tr><tr><td>`DELETE`</td><td>`/api/tag-groups/{id}/tags/{id}`</td><td>`tags.delete`</td><td>Delete a tag</td></tr></tbody></table>

<p class="callout info">You can pass the tag group `name` in place of `id`.</p>

<p class="callout info">You can pass the tag `name` in place of `id`.</p>

#### Collections

<table border="1" id="bkmrk-method-endpoint-perm-11" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/collections`</td><td>`collections.index`</td><td>List collections</td></tr><tr><td>`GET`</td><td>`/api/collections/{id}`</td><td>`collections.view`</td><td>Get a collection</td></tr><tr><td>`POST`</td><td>`/api/collections`</td><td>`collections.store`</td><td>Create a collection</td></tr><tr><td>`PUT`</td><td>`/api/collections/{id}`</td><td>`collections.update`</td><td>Update a collection</td></tr><tr><td>`DELETE`</td><td>`/api/collections/{id}`</td><td>`collections.delete`</td><td>Delete a collection</td></tr></tbody></table>

<p class="callout info">You can pass the collection `name` in place of `id`.</p>

#### Customers

<table border="1" id="bkmrk-method-endpoint-perm-12" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/customers`</td><td>`customers.index`</td><td>List customers</td></tr><tr><td>`GET`</td><td>`/api/customers/{id}`</td><td>`customers.view`</td><td>Get a customer</td></tr><tr><td>`POST`</td><td>`/api/customers`</td><td>`customers.store`</td><td>Create a customer</td></tr><tr><td>`PUT`</td><td>`/api/customers/{id}`</td><td>`customers.update`</td><td>Update a customer</td></tr></tbody></table>

#### Addresses

<table border="1" id="bkmrk-method-endpoint-perm-13" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`POST`</td><td>`/api/customers/{id}/addresses`</td><td>`addresses.store`</td><td>Create an address</td></tr><tr><td>`PUT`</td><td>`/api/customers/{id}/addresses/{id}`</td><td>`addresses.update`</td><td>Update an address</td></tr><tr><td>`DELETE`</td><td>`/api/customers/{id}/addresses/{id}`</td><td>`addresses.delete`</td><td>Delete an address</td></tr></tbody></table>

#### Payment Methods

<table border="1" id="bkmrk-method-endpoint-perm-14" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/payment-methods`</td><td>`payment-methods.index`</td><td>List payment methods</td></tr><tr><td>`GET`</td><td>`/api/payment-methods/{id}`</td><td>`payment-methods.view`</td><td>Get a payment method</td></tr></tbody></table>

#### Shipping Methods

<table border="1" id="bkmrk-method-endpoint-perm-15" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/shipping-methods`</td><td>`shipping-methods.index`</td><td>List shipping methods</td></tr><tr><td>`GET`</td><td>`/api/shipping-methods/{id}`</td><td>`shipping-methods.view`</td><td>Get a shipping method</td></tr></tbody></table>

#### Locations

<table border="1" id="bkmrk-method-endpoint-perm-16" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/locations`</td><td>`locations.index`</td><td>List locations</td></tr><tr><td>`GET`</td><td>`/api/locations/{id}`</td><td>`locations.view`</td><td>Get a location</td></tr><tr><td>`POST`</td><td>`/api/locations`</td><td>`locations.store`</td><td>Create a location</td></tr><tr><td>`PUT`</td><td>`/api/locations/{id}`</td><td>`locations.update`</td><td>Update a location</td></tr></tbody></table>

<p class="callout info">You can pass the location `name` in place of `id`.</p>

#### Flags

<table border="1" id="bkmrk-method-endpoint-perm-17" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/flags`</td><td>`flags.index`</td><td>List flags</td></tr><tr><td>`GET`</td><td>`/api/flags/{id}`</td><td>`flags.view`</td><td>Get a flag</td></tr><tr><td>`POST`</td><td>`/api/flags`</td><td>`flags.store`</td><td>Create a flag</td></tr><tr><td>`PUT`</td><td>`/api/flags/{id}`</td><td>`flags.update`</td><td>Update a flag</td></tr><tr><td>`DELETE`</td><td>`/api/flags/{id}`</td><td>`flags.delete`</td><td>Delete a flag</td></tr></tbody></table>

<p class="callout info">You can pass the flag `name` in place of `id`.</p>

#### Price Lists

<table border="1" id="bkmrk-method-endpoint-perm-18" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/price-lists`</td><td>`price-lists.index`</td><td>List price lists</td></tr><tr><td>`GET`</td><td>`/api/price-lists/{id}`</td><td>`price-lists.view`</td><td>Get a price list</td></tr><tr><td>`POST`</td><td>`/api/price-lists`</td><td>`price-lists.store`</td><td>Create a price list</td></tr><tr><td>`PUT`</td><td>`/api/price-lists/{id}`</td><td>`price-lists.update`</td><td>Update a price list</td></tr></tbody></table>

#### Price List Entries

<table border="1" id="bkmrk-method-endpoint-perm-19" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`POST`</td><td>`/api/price-lists/{id}/entries`</td><td>`price-list-entries.store`</td><td>Create a price list entry</td></tr><tr><td>`PUT`</td><td>`/api/price-lists/{id}/entries/{id}`</td><td>`price-list-entries.update`</td><td>Update a price list entry</td></tr></tbody></table>

#### Specification Groups

<table border="1" id="bkmrk-method-endpoint-perm-20" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/specification-groups`</td><td>`specification-groups.index`</td><td>List specification groups</td></tr><tr><td>`GET`</td><td>`/api/specification-groups/{id}`</td><td>`specification-groups.view`</td><td>Get a specification group</td></tr><tr><td>`POST`</td><td>`/api/specification-groups`</td><td>`specification-groups.store`</td><td>Create a specification group</td></tr><tr><td>`PUT`</td><td>`/api/specification-groups/{id}`</td><td>`specification-groups.update`</td><td>Update a specification group</td></tr></tbody></table>

<p class="callout warning">Must have installed `aerocargo/specifications` for these endpoints to work.</p>

#### Upsell Groups

<table border="1" id="bkmrk-method-endpoint-perm-21" style="border-collapse: collapse; width: 100%; height: 27.7969px;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 27.7969px;"><td style="height: 27.7969px;">**Method**</td><td style="height: 27.7969px;">**Endpoint**</td><td style="height: 27.7969px;">**Permission**</td><td style="height: 27.7969px;">**Description**</td></tr><tr><td style="height: 29.7969px;">`GET`</td><td style="height: 29.7969px;">`/api/upsell-groups`</td><td style="height: 29.7969px;">`upsell-groups.index`</td><td style="height: 29.7969px;">List upsell groups</td></tr><tr><td style="height: 29.7969px;">`GET`</td><td style="height: 29.7969px;">`/api/upsell-groups/{key}`</td><td style="height: 29.7969px;">`upsell-groups.view`</td><td style="height: 29.7969px;">Get an upsell group</td></tr><tr><td style="height: 29.7969px;">`POST`</td><td style="height: 29.7969px;">`/api/upsell-groups`</td><td style="height: 29.7969px;">`upsell-groups.store`</td><td style="height: 29.7969px;">Create an upsell group</td></tr><tr><td style="height: 29.7969px;">`PUT`</td><td style="height: 29.7969px;">`/api/upsell-groups/{key}`</td><td style="height: 29.7969px;">`upsell-groups.update`</td><td style="height: 29.7969px;">Update an upsell group</td></tr></tbody></table>

<p class="callout warning">Must have installed `aerocargo/upsells` for these endpoints to work.</p>

#### Listing Collection Groups

<table border="1" id="bkmrk-method-endpoint-perm-22" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`GET`</td><td>`/api/listing-collection-groups`</td><td>`listing-collection-groups.index`</td><td>List listing collection groups</td></tr><tr><td>`GET`</td><td>`/api/listing-collection-groups/{key}`</td><td>`listing-collection-groups.view`</td><td>Get a listing collection group</td></tr><tr><td>`POST`</td><td>`/api/listing-collection-groups`</td><td>`listing-collection-groups.store`</td><td>Create a listing collection group</td></tr><tr><td>`PUT`</td><td>`/api/listing-collection-groups/{key}`</td><td>`listing-collection-groups.update`</td><td>Update a listing collection group</td></tr></tbody></table>

<p class="callout warning">Must have installed `aerocargo/listing-collections` for these endpoints to work.</p>

#### Stock

<table border="1" id="bkmrk-method-endpoint-perm-23" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 11.4422%;"></col><col style="width: 38.4982%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Method**</td><td>**Endpoint**</td><td>**Permission**</td><td>**Description**</td></tr><tr><td>`POST`</td><td>`/api/stock`</td><td>`stock.update`</td><td>Bulk update variant stock</td></tr></tbody></table>

# What conventions does the API use?

#### Attribute Conventions

- Keys generally match the attribute name on their respective models.
- **Exception:** Attributes ending in "\_code" should omit the suffix when passed to the API, e.g. `currency_code` =&gt; `currency`

#### Relationship Conventions

- Nested data should use a **snake\_case** version of the relationship method name where present, e.g.: `shippingMethod` =&gt; `shipping_method`

#### Price Conventions

- Prices retrieved from the API are mostly in the currency's smallest unit, e.g. `1000` = `10 GBP`
- Prices should generally be provided in the currency’s standard unit, e.g. `10` = `10 GBP` (unless otherwise stated)
- Prices should generally be passed as an object, e.g.:  
      
    ```
    {
        "price": {
            "amount": 400, // Excluding tax
            "tax": 80
        }
    }
    ```
    
    **Exception:** Some endpoints support passing a single tax-inclusive value:
    
    ```
    {
        "price": 480 // Including tax
    }
    ```
    
    See the relevant endpoint docs to see if this is supported for an endpoint

#### Date Conventions

- Dates must be **Carbon-parseable**, supported formats include: 
    - 2023-09-01T09:29:41.000000Z
    - 2023-09-01 09:29:41
    - 2023-09-01 (defaults to midnight if no time is provided)

#### Pagination Conventions

<table border="1" id="bkmrk-parameter-descriptio" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr><td>**Parameter**  
</td><td>**Description**  
</td><td>**Example**  
</td></tr><tr><td>`page`</td><td>The page number (default: 1)</td><td>`?page=2`</td></tr><tr><td>`per_page`</td><td>The number of results per page (default: 24, max: 96)</td><td>`?per_page=48`</td></tr><tr><td>`ids`</td><td>Comma-separated list of IDs to fetch</td><td>`?ids=1,2,5`</td></tr><tr><td>`min_updated_at`</td><td>The min updated at for a product</td><td>`?min_updated_at=2023-08-30%2010:35:05`</td></tr><tr><td>`max_updated_at`</td><td>The max updated at for a product</td><td>`?max_updated_at=2023-08-30%2010:35:05`</td></tr></tbody></table>

<p class="callout info">The `min_updated_at` and `max_updated_at` parameters are only supported by index endpoints.</p>

Responses follow Laravel's pagination format, e.g.:

```
{
    "current_page": 1,
    "data": [
        //...
    ],
    "first_page_url": "http://aero.test/api/products?page=1",
    "from": 1,
    "last_page": 2,
    "last_page_url": "http://aero.test/api/products?page=2",
    "next_page_url": "http://aero.test/api/products?page=2",
    "path": "http://aero.test/api/products",
    "per_page": 24,
    "prev_page_url": null,
    "to": 24,
    "total": 29
}
```

#### Scope Conventions

- Index endpoints support a scope parameter, which is a comma-separated list of scopes.
- Supported scopes are endpoint-specific and documented in endpoint-specific example docs.

#### Image Factory Conventions

<table border="1" id="bkmrk-parameter-descriptio-1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr><td>**Parameter**  
</td><td>**Description**  
</td><td>**Example**  
</td></tr><tr><td>`image_factory_width`</td><td>Output image width</td><td>`?image_factory_width=200`</td></tr><tr><td>`image_factory_height`</td><td>Output image height</td><td>`?image_factory_height=200`</td></tr><tr><td>`image_factory_options`</td><td>Comma-seperated options</td><td>`?image_factory_options=flip,greyscale`</td></tr></tbody></table>

<p class="callout info">If any of these query parameters are present in the GET requests, Image Factory will be applied.</p>

# What responses does the API return?

<table border="1" id="bkmrk-code-scenario-200-su" style="border-collapse: collapse; width: 100%; height: 29.7969px;"><colgroup><col style="width: 50.0596%;"></col><col style="width: 50.0596%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Code**  
</td><td style="height: 29.7969px;">**Scenario**  
</td></tr><tr><td>`200 Success`</td><td>The request was processed successfully.</td></tr><tr><td>`201 Created`  
</td><td>One (or multiple) resources were created.</td></tr><tr><td>`400 Bad Request`   
</td><td>Cannot process request due to client error.</td></tr><tr><td>`401 Unauthorised`  
</td><td>Invalid bearer token provided.</td></tr><tr><td>`404 Not Found`  
</td><td>Endpoint not found.</td></tr><tr><td>`422 Unprocessable Content`  
</td><td>Payload failed validation.</td></tr><tr><td>`500 Internal Server Error`  
</td><td>  
</td></tr></tbody></table>

#### Examples

##### `200 Success`

```
GET /api/orders/{id}
```

```json
{
    "reference": "ABC123",
    "email": "acme@aerocommerce.com",
    "subtotal": {
        "amount": 84166.67,
        "tax": 16833.33
    },
    "shipping": {
        "amount": 83.33,
        "tax": 16.67
    },
    "discount": {
        "amount": 8416.67,
        "tax": 1683.33
    },
    "surcharge": {
        "amount": 0,
        "tax": 0
    },
    "ordered_at": "2023-09-01T09:29:41.000000Z",
    "deliver_on": null,
    "currency": "GBP",
    "status": {
        "id": 3,
        "name": "Successful",
        "state": "successful"
    },
    "customer": {
        "id": 1,
        "name": "Acme",
        "email": "acme@aerocommerce.com"
    },
    "shipping_method": {
        "id": 1,
        "name": "Standard"
    },
    "billing_address": {
        "id": 1,
        "first_name": "Aero",
        "last_name": "Commerce",
        "company": "Aero Commerce",
        "mobile": null,
        "phone": null,
        "line_1": "28-32 Albert Rd",
        "line_2": null,
        "city": "Middlesbrough",
        "zone": null,
        "postcode": "TS1 1QD",
        "reference": null,
        "country": "GB",
        "eori_number": null
    },
    "shipping_address": {
        "id": 1,
        "first_name": "Aero",
        "last_name": "Commerce",
        "company": "Aero Commerce",
        "mobile": null,
        "phone": null,
        "line_1": "28-32 Albert Rd",
        "line_2": null,
        "city": "Middlesbrough",
        "zone": null,
        "postcode": "TS1 1QD",
        "reference": null,
        "country": "GB",
        "eori_number": null
    },
    "items": [
        {
            "id": 1,
            "name": "Test",
            "sku": "TEST-S",
            "product_id": 4,
            "variant_id": 14,
            "shippable": true,
            "quantity": 2,
            "price": {
                "amount": 42083.33,
                "tax": 8416.67
            },
            "discount": {
                "amount": 8416.67,
                "tax": 1683.33
            },
            "full_price": {
                "amount": 42083.33,
                "tax": 8416.67
            },
            "weight": 0,
            "volume": 0
        }
    ]
}
```

##### `201 Created`

```
POS /api/orders
```

```json
{
    "order": {
        "id": 15
    }
}
```

##### `400 Bad Request`

```
GET /api/orders/{id}
```

```json
{
    "message": "Missing order ID"
}
```

##### `401 Unauthorised`

```
GET /api/orders/{id}
```

```json
{
    "message": "Unauthorized: Bearer token missing."
}
```

##### `404 Not Found`

```
GET /api/orders/{id}
```

```json
{
    "message": "The requested order with ID {id} could not be found."
}
```

##### `422 Unprocessable Content`

```
POST /api/orders
```

```json
{
    "message": "The given data was invalid.",
    "errors": {
        "currency": ["The currency field is required."]
    }
}
```

##### `500 Internal Server Error`

```json
{
    "message": "Exception message..."
}
```