Price Preferences API Routes

A price preference is used to specify whether tax-inclusiveness is enabled for a context, such as a region or currency code.

These API routes allow admin users to manage whether a region or currency is tax inclusive.

GET /admin/price-preferences#

List Price Preferences

Retrieve a list of price preferences. The price preferences can be filtered by fields such as id. The price preferences 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 -.
idstring | string[]Optional
Filter by a price preference ID.
attributestring | string[]Optional
Filter by a price preference's attribute.
valuestring | string[]Optional
Filter by a price preference's value.
qstringOptional
Search term to apply on the price preference's searchable properties.
$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 count of items.
price_preferencesobject[]
The list of price preferences.
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-preferences#

Create Price Preference

Create a price preference.

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.

Request body (application/json)

attributestring
The name of the attribute the price preference applies on.
Example: currency_code
valuestring
The attribute's value.
Example: usd
is_tax_inclusivebooleanOptional
Whether the price is tax inclusive if the value of the specified attribute matches the specified value.

Request examples

Responses

200 OK

price_preferenceobject
The price preference's details.

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


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

Get a Price Preference

Retrieve a price preference by its ID. You can expand the price preference'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 preference'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_preferenceobject
The price preference's details.

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


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

Update a Price Preference

Update a price preference's details.

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

Path parameters

idstring
The price preference'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)

attributestringOptional
The price preference's attribute.
Example: region_id
valuestringOptional
The price preference's value.
Example: reg_123
is_tax_inclusivebooleanOptional
Whether prices are tax inclusive for this price preference.

Request examples

Responses

200 OK

price_preferenceobject
The price preference's details.

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


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

Delete a Price Preference

Delete a price preference.

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

Path parameters

idstring
The price preference's ID.

Request examples

Responses

200 OK

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

Default: "price_preference"

deletedboolean
Whether the price preference was deleted.

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

Found a problem with this page?Report Issue
Edited Nov 14·Edit this page