Guides
Suppliers and dropshipping
Add your products to a merchant's store, keep their price and stock fresh, and ship what customers order.
What your app needs
| You want to | Scope | Where |
|---|---|---|
| Add products and update their content | products:write | POST /products, PATCH /products/{id}/content |
| Set prices | products.prices:write | PATCH /products/{id}/prices |
| Update images | products.media:write | PATCH /products/{id}/media |
| Publish or hide products | products.publish:write | PATCH /products/{id}/status |
| Delete products | products.delete:write | DELETE /products/{id} |
| Change stock | inventory:write | POST /products/{id}/inventory-adjustments |
| Add codes to digital products | inventory.codes:write | POST /products/{id}/codes |
| See orders of your products | orders:read | order.paid |
| Get the recipient's name, phone and address | customers:read | Inside the order |
| Report the shipment | orders.shipment:write | PATCH /orders/{id}/shipment |
Add a product
A new product starts hidden. Send its choices and stock with it:
curl -X POST "https://larm.sa/stores/$STORE_ID/v1/products" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Cotton T-shirt",
"description": "A soft cotton T-shirt.",
"product_kind": "physical",
"price": "79.00",
"physical": { "sku": "TS-100", "weight_grams": 250, "length_cm": 30, "width_cm": 25, "height_cm": 3 },
"options": [{ "name": "Size", "values": ["S", "M"] }],
"variants": [
{ "options": { "Size": "S" }, "sku": "TS-100-S", "quantity": 8 },
{ "options": { "Size": "M" }, "sku": "TS-100-M", "quantity": 6 }
]
}'Then publish it with PATCH /products/{id}/status. A product with no price cannot be published. Sending price also needs products.prices:write, and sending stock also needs inventory:write.
Store the id of each product. To match your catalog later, use GET /products?sku=TS-100.
Keep price and stock fresh
- Price. Read the product, then send its
ETaginIf-Matchwith the new price. A change above 90% is refused withPRICE_CHANGE_TOO_LARGE, to protect the merchant from a wrong feed. - Stock. Send the difference with
POST /products/{id}/inventory-adjustments. The store takes stock off by itself on each sale, andinventory.physical.updatedtells you when it does. - The merchant can edit too. Listen for
product.updatedso your copy stays right.
Ship an order
An order can hold products from several suppliers. On order.paid, keep the items whose product_id or sku is yours, ship them, and report it with PATCH /orders/{id}/shipment. An order has one shipment. When you share an order with others, agree with the merchant who reports it.
Money
The customer pays the merchant, and the amount stays with the merchant in their settlement. Larm does not split a payment between a merchant and a supplier. Bill the merchant under your own agreement.