curl --request POST \
--url https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"name": "<string>",
"stockable_id": "<string>",
"stockable_unit_id": "<string>",
"price": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"vat_price_behavior": "<string>",
"tax_settings": [
"<unknown>"
],
"tax_configuration": {}
}
]{
"message": "<string>",
"errors": {}
}Add prices to an item
Adds named selling prices, per unit of sale, to an item, with its tax settings.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/stockables/{stockable}/prices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"name": "<string>",
"stockable_id": "<string>",
"stockable_unit_id": "<string>",
"price": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"vat_price_behavior": "<string>",
"tax_settings": [
"<unknown>"
],
"tax_configuration": {}
}
]{
"message": "<string>",
"errors": {}
}variant_prices.create, bundle_prices.create
Conditions
- The permission depends on the type of item: variant_prices.create or bundle_prices.create.
- prices is required with at least one entry; each entry needs a name, a price and a stockable_unit_id.
- Each price is a decimal in major units, at least 0, with at most currency_exponent decimals.
- Each unit must belong to the item and be active.
- Within the company, a name can be used only once per unit (compared in lower case), including inside the same request.
- Within the company, a price amount can be used only once per item, including inside the same request and across units.
- The tax setup of the item must allow the price to be calculated: unknown tax identifiers, inapplicable VAT behavior or an incalculable amount refuse the call, and nothing is saved.
- Tax settings must reference distinct tax identifiers.
- Stores prices as minor units for the caller’s company.
- Stores the explicit tax inclusion settings of each price, with the VAT behavior as a setting on the item’s VAT tax, for the company’s current fiscal profile.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the sellable item (stockable): the stockable record of a product variant or of a bundle, not the variant or bundle identifier itself.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: vat_price_behavior, tax_settings, tax_configuration, id, name, stockable_id, stockable_unit_id, price, created_at, updated_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: .
Response
Resource (only with response=resource).
Identifier of the price (27-character KSUID string).
Name of the price, for example retail; stored in lower case and unique per unit for the company.
Identifier of the item the price belongs to.
Identifier of the unit of sale the price applies to.
Selling price in major units (stored internally in minor units and divided by 10 to the power currency_exponent).
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
inclusive when the price includes VAT, exclusive when VAT is added on top. exclusive when no VAT setting is stored for the price.
Explicit tax inclusion settings of the price: a list of objects with tax_id and inclusion_policy (inclusive or exclusive). Taxes without a setting use their default inclusion policy.
Resolved tax calculation context of the price (tax_resolution, rounding_favor, taxes, inapplicable_tax_settings, calculation_error); fixed tax amounts in major units. Only present when the request sends include_tax_configuration=true.