Items
Add an item
https://your-business.qaydtech.com/api/v1/items
Adds a product (its stock is tracked) or a service. Its code is made up when not sent, and the usual unit and tax are taken when not named. A barcode is never repeated among items or their units.
Request
Headers
-
Authorizationstring requiredBearer followed by the API key.
Example:
Bearer qayd_… -
Accept-Languagestring optionalen for English error messages. Arabic by default.
Example:
en -
Content-Typestring requiredapplication/json with every request that has a body.
Example:
application/json -
Idempotency-Keystring optionalA unique value so a request sent again creates nothing twice.
Example:
order-10045
Request body application/json
-
typestring requiredThe type: individual or business for a customer; product or service for an item; asset, liability, equity, revenue or expense for an account.
Example:
product -
codestring optionalThe item code: Latin letters and digits up to 30, made up when not sent. In stock levels: the item with this code.
Example:
PRD-001 -
namestring requiredThe name in Arabic, 2 to 150 characters.
Example:
قهوة عربية 500غ -
name_enstring optionalThe name in English.
Example:
Arabic coffee 500g -
descriptionstring optionalDescription, up to 500 characters.
-
unit_idinteger optionalIts own unit from GET /units. Defaults to “piece” for a product and “service” for a service.
Example:
1 -
category_idinteger optionalThe category from GET /item-categories.
Example:
3 -
sale_pricenumber optionalSale price in riyals.
Example:
45.00 -
purchase_pricenumber optionalPurchase price in riyals.
Example:
30.00 -
taxstring optionalTax code from GET /taxes. Defaults to the business’s usual tax.
Example:
standard -
barcodestring optionalThe first barcode: Latin letters, digits and hyphens, 4 to 40. Made up for a product when the business’s settings say so.
Example:
6281000000024 -
barcodesarray[] optionalFurther barcodes of the same item, up to 10.
-
unitsarray[] optionalOther selling units (a box, say), each holding so many of its own unit.
-
unit_idinteger requiredThe unit from GET /units, other than its own.
Example:
2 -
factornumber requiredHow many of its own unit it holds, such as 12 for a box.
Example:
12 -
sale_pricenumber optionalThis unit’s sale price.
Example:
500.00 -
barcodestring optionalThis unit’s barcode.
Example:
6281000000031 -
reorder_levelnumber optionalReorder level: warned when stock reaches it.
Example:
10 -
is_activeboolean optionalfalse to stop it (a customer, an item, a webhook address); true to resume it.
Example:
true -
imagestring optionalA link to the picture, which we download and keep (https, up to 1 MB, PNG/JPG/WebP). Empty takes the picture away. Read it back from GET /items/{id}/image.
Example:
https://cdn.example.sa/products/coffee.jpg
Responses
- 201 Created
- 422 Refused
- Errors · 401 · 403 · 429