Price Lists API Routes

A price list is a group of prices applied if the specified conditions and rules are satisfied.

Price lists are useful for sales or special prices for special conditions, such as applying prices for a set of customers.

These API routes allow admin users to manage price lists.

GET /admin/price-lists#

List Price Lists

Retrieve a list of price lists. The price lists can be filtered by fields such as id. The price lists can also be sorted or paginated.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.
offsetnumberOptional
The number of items to skip when retrieving a list.
limitnumberOptional
Limit the number of items returned in the list.
orderstringOptional
The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.
qstringOptional
Search term to filter the price list's searchable properties.
idstring | string[]Optional
Filter by a price list ID.
starts_atobjectOptional
Filter by a price list's start date. Accepts the filter operators.
ends_atobjectOptional
Filter by the price list's end date. Accepts the filter operators.
status("active")[] | ("draft")[]Optional
Filter by the price list's status.
rules_countnumber[]Optional
Filter by the price list's rules count.
$andobject[]Optional
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
$orobject[]Optional
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
with_deletedbooleanOptional
Whether to include deleted records in the result.

Request examples

Responses

200 OK

limitnumber
The maximum number of items returned.
offsetnumber
The number of items skipped before retrieving the returned items.
countnumber
The total number of items.
price_listsobject[]
The list of price lists.
estimate_countnumberOptional
The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate.

400, 401, 404, 409, 422, 500: an error response is returned.


POST /admin/price-lists#

Create Price List

Create a price list.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.
qstringOptional
Apply a search query to the price list's searchable properties.
idstring | string[]Optional
Filter by a specific price list ID.
starts_atobjectOptional
Filter by a price list's start date. Accepts the filter operators.
ends_atobjectOptional
Filter by a price list's end date. Accepts the filter operators.
status("draft")[] | ("active")[]Optional
Filter by price list statuses.
rules_countnumber[]Optional
Filter by multiple price list rules count.
limitnumberOptional
Limit the number of items returned in the list.
offsetnumberOptional
The number of items to skip when retrieving a list.
orderstringOptional
The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.
with_deletedbooleanOptional
The price list's with deleted.
$andobject[]Optional
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
$orobject[]Optional
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.

Request body (application/json)

titlestring
The price list's title.
descriptionstring
The price list's description.
starts_atstringOptional
The date and time the price list starts at.
ends_atstringOptional
The date and time the price list ends at.
status"active" | "draft"Optional
The price list's status.
type"sale" | "override"Optional
The price list's type.
rulesobjectOptional
The price list's rules.
pricesobject[]Optional
The price list's prices.
metadataobjectOptional
Key-value pairs of custom data.

Request examples

Responses

200 OK

price_listobject
The price list's details.

400, 401, 404, 409, 422, 500: an error response is returned.

Emitted events

  • price-list.created: Emitted when price lists are created.

GET /admin/price-lists/{id}#

Get a Price List

Retrieve a price list by its ID. You can expand the price list's relations or select the fields that should be returned.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The price list's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Request examples

Responses

200 OK

price_listobject
The price list's details.

400, 401, 404, 409, 422, 500: an error response is returned.


POST /admin/price-lists/{id}#

Update a Price List

Update a price list's details.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The price list's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Request body (application/json)

titlestringOptional
The price list's title.
descriptionstringOptional
The price list's description.
starts_atstringOptional
The date the price list starts.
ends_atstringOptional
The date the price list ends.
status"active" | "draft"Optional
The price list's status.
type"sale" | "override"Optional
The price list's type.
rulesobjectOptional
The price list's rules.
metadataobjectOptional
Key-value pairs of custom data.

Request examples

Responses

200 OK

price_listobject
The price list's details.

400, 401, 404, 409, 422, 500: an error response is returned.

Emitted events

  • price-list.updated: Emitted when price lists are updated.

DELETE /admin/price-lists/{id}#

Delete a Price List

Delete a price list.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The price list's ID.

Request examples

Responses

200 OK

idstring
The price list's ID.
objectstring
The name of the deleted object.

Default: "price_list"

deletedboolean
Whether the price list was deleted.

400, 401, 404, 409, 422, 500: an error response is returned.

Emitted events

  • price-list.deleted: Emitted when price lists are deleted.

GET /admin/price-lists/{id}/prices#

List Prices for a Price List

Retrieve a list of prices in a price list. The prices can be filtered by fields like FILTER FIELDS. The prices can also be paginated.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The price list's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. If a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.

Request examples

Responses

200 OK

limitnumber
The maximum number of prices to return.
offsetnumber
The number of items skipped before retrieving the prices.
countnumber
The maximum number of prices available.
estimate_countnumberOptional
The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate.
pricesobject[]
The list of prices associated with the price list.

400, 401, 404, 409, 422, 500: an error response is returned.


POST /admin/price-lists/{id}/prices/batch#

Manage Prices in Price List

Manage the prices of a price list to create, update, or delete them.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The price list's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. If a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.

Request body (application/json)

createobject[]Optional
The prices to create.
updateobject[]Optional
The prices to update.
deletestring[]Optional
The prices to delete.

Request examples

Responses

200 OK

createdobject[]
The created prices.
updatedobject[]
The updated prices.
deletedobject
The details of the deleted prices.

400, 401, 404, 409, 422, 500: an error response is returned.

Emitted events

  • price-list.prices_added: Emitted when prices are added to a price list.
  • price-list.prices_updated: Emitted when prices in a price list are updated.
  • price-list.prices_removed: Emitted when prices are removed from a price list.

POST /admin/price-lists/{id}/products#

Remove Products from Price List

Remove products from a price list.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The price list's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Request body (application/json)

removestring[]Optional
The products to remove from the price list.

Request examples

Responses

200 OK

price_listobject
The price list's details.

400, 401, 404, 409, 422, 500: an error response is returned.

Emitted events

  • price-list.prices_added: Emitted when prices are added to a price list.
  • price-list.prices_updated: Emitted when prices in a price list are updated.
  • price-list.prices_removed: Emitted when prices are removed from a price list.
Found a problem with this page?Report Issue
Edited Nov 14·Edit this page