Selling cash on delivery
Collections and reviews
Group products into collections (hand-picked or automated by conditions), read the categories products use, and moderate product reviews.
Collections
A collection is either hand-picked (kind: "manual", the products you list in product_ids, in that order) or automated (kind: "smart", every product that matches its rules, joining and leaving as products change). Both are what the Collections page makes.
curl https://api.ordexs.com/v1/collections \
-H "Authorization: Bearer $ORDEXS_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Summer sale","kind":"smart","rules_match":"all",
"rules":[{"field":"tag","op":"eq","value":"summer"},{"field":"compare_at_price","op":"is_set"}]}'A rule is {field, op, value}:
field | Operators |
|---|---|
title, vendor, product_type, category, status | eq, neq, contains, not_contains, starts_with, ends_with, is_set, is_not_set |
tag | eq, neq, contains |
price, compare_at_price, inventory | gt, lt, eq, neq, is_set, is_not_set |
rules_match: "all" needs every rule; "any" needs one. Prices are decimal strings in the store's currency. Try conditions before saving with POST /v1/collections/preview: it returns how many products match and the first 12.
GET /v1/collections/{id}/productslists a collection's products in its own order.PATCHwithproduct_idsreplaces a hand-picked collection's products.POST /v1/collections/reordersets the order collections appear in.POST /v1/collections/{id}/duplicatemakes a draft copy.DELETEremoves the collection; its products stay.
Each product lists the collections it is in as collection_ids.
Categories
A product's category is a single label. GET /v1/categories lists the ones the store uses, with how many products each has. To file a product, set its category with PATCH /v1/products/{id}.
Reviews
Reviews come from customers on the storefront (source: "customer") or are added by the merchant (source: "merchant", for reviews collected elsewhere). A customer's review stays pending until it is published, unless the store publishes reviews automatically (GET/PATCH /v1/review_settings, auto_publish).
GET /v1/reviews?status=pendingis the moderation queue.PATCH /v1/reviews/{id}withstatuspublishedorhidden.POST /v1/reviewsadds one; it is published unless you sendstatus.- The
review.createdwebhook fires for every new review.
