Skip to content

Adding products

PUT
/v2/supplier-order/add-item
curl --request PUT \
--url 'https://api-admin.billz.ai/v2/supplier-order/add-item?Billz-Response-Channel=HTTP' \
--header 'Authorization: Bearer <token>' \
--header 'Billz-Response-Channel: HTTP' \
--header 'Content-Type: application/json' \
--header 'platform-id: 7d4a4c38-dd84-4902-b744-0488b80a4c01' \
--data '{ "ordered_measurement_value": 1, "product_id": "aba9d9ad-5d37-4836-81a4-9a60648d087e", "retail_price": 110000, "supplier_order_id": "e8f19b80-6b2c-41ec-ad0f-0f4fe60aa191", "supply_price": 1 }'

Asynchronous method. To receive the result synchronously over HTTP, pass the Billz-Response-Channel: HTTP header — otherwise the response will be 200 {"message": "<correlation_id>"}. Maximum wait is 600 seconds, after which 408 with error.code = TIMEOUT is returned. > ⚠️ A synchronous successful response is unreachable. With the Billz-Response-Channel: HTTP header the request ends with 408 TIMEOUT after 600 seconds, although the operation is performed. The result must be checked with a separate read request.

Error codes: 400 — input validation error; 404 — object not found; 408 — timed out waiting for the asynchronous result; 401, 403, 429, 500 — shared by all methods. Body formats and semantics: Response codes and errors.

platform-id
string
default: 7d4a4c38-dd84-4902-b744-0488b80a4c01

Platform identifier. A static value is used for integrations.

Billz-Response-Channel
string
Allowed values: HTTP

HTTP — wait for the event processing result and return it in the HTTP response. Without the header the method returns only the correlation_id of the published event.

Billz-Response-Channel
string
Allowed values: HTTP

Same as the Billz-Response-Channel header — for clients that cannot send a custom header. If both are passed, the header applies.

Media typeapplication/json
object
supplier_order_id
required
string
product_id
required
string
ordered_measurement_value
required

From 0 to 10^15, otherwise 400

number format: double
retail_price
number format: double
supply_price
number format: double
wholesale_price

Wholesale price

number format: double
company_id
string
Example
{
"ordered_measurement_value": 1,
"product_id": "aba9d9ad-5d37-4836-81a4-9a60648d087e",
"retail_price": 110000,
"supplier_order_id": "e8f19b80-6b2c-41ec-ad0f-0f4fe60aa191",
"supply_price": 1
}

Event accepted: {"message": "<correlation_id>"}. With the Billz-Response-Channel: HTTP header there is no success response — the request ends with 408 even though the operation is performed; only errors arrive synchronously.

Media typeapplication/json

Response of an asynchronous method without the Billz-Response-Channel header — the event has been published.

object
message

Correlation_id of the published event

string format: uuid
Examplegenerated
{
"message": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}