Preview the next part number
curl --request POST \
--url https://api.poelis.com/v1/public/products/{product_id}/part-number-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input_values": [
"<string>"
]
}
'import requests
url = "https://api.poelis.com/v1/public/products/{product_id}/part-number-preview"
payload = { "input_values": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input_values: ['<string>']})
};
fetch('https://api.poelis.com/v1/public/products/{product_id}/part-number-preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"part_number": "<string>"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}{
"error": "forbidden",
"message": "Access denied"
}{
"error": "not_found",
"message": "Not found"
}{
"error": "validation_error",
"message": "Invalid data format",
"details": {
"errors": [
{
"loc": [
"body",
"field_name"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}
}{
"error": "rate_limit_exceeded",
"message": "Too many requests"
}Products
Preview the next part number
Return the next part number for the rule configured on this product in the app. This call does not assign the number.
Flow
- Call this endpoint. Send
{}when the rule has no input segments. When it does, sendinput_valuesin segment order, for example["MECH"]. - Assign the returned
part_numberon product or item update, item create, orPOST /v1/public/items/bulk.
When the product has a counter rule, any other value returns 422
(PART_NUMBER_NOT_NEXT). The body includes expected_part_number. Call this
endpoint again and assign that value. A string that does not match the format
returns 422 (PART_NUMBER_FORMAT_MISMATCH) with expected_format.
part_number is null when the product has no counter rule, or when input_values
are missing or invalid. You can then omit part_number or send any unique string.
POST
/
v1
/
public
/
products
/
{product_id}
/
part-number-preview
Preview the next part number
curl --request POST \
--url https://api.poelis.com/v1/public/products/{product_id}/part-number-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input_values": [
"<string>"
]
}
'import requests
url = "https://api.poelis.com/v1/public/products/{product_id}/part-number-preview"
payload = { "input_values": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input_values: ['<string>']})
};
fetch('https://api.poelis.com/v1/public/products/{product_id}/part-number-preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"part_number": "<string>"
}{
"error": "unauthorized",
"message": "Invalid or missing API key"
}{
"error": "forbidden",
"message": "Access denied"
}{
"error": "not_found",
"message": "Not found"
}{
"error": "validation_error",
"message": "Invalid data format",
"details": {
"errors": [
{
"loc": [
"body",
"field_name"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}
}{
"error": "rate_limit_exceeded",
"message": "Too many requests"
}Body
application/json