Orders
8 routes. Paths are relative to https://api.intersink.com/v1.
- GET/ordersMy orders (as buyer), paged
- POST/ordersPlace an order in the token's channel
- GET/orders/{id}Find one
- PATCH/orders/{id}/cancelBuyer cancels a pending / processing order
- PATCH/orders/{id}/statusSeller moves an order along the state machine
- GET/orders/{id}/trackTrack
- GET/orders/sellerOrders received by a channel I manage / my business
- GET/orders/seller/customersCustomers of a channel I manage (from its orders)
My orders (as buyer), paged
GET/orders
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| status | string, query | One of: "pending", "processing", "shipped", "delivered", "cancelled". |
| sort | string, query | One of: "date_created", "-date_created", "total", "-total". |
| page | number, query | Minimum 1, maximum 10000. |
| limit | number, query | Minimum 1, maximum 100. |
Response
200. The payload in data is not described in the spec yet.
Place an order in the token's channel
POST/orders
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| Idempotency-Key | string, header | Optional client-generated key (8-128 chars, [A-Za-z0-9_-]). A retry with the same key and body replays the first response (Idempotent-Replayed: true); 409 while the first is in flight; 422 if the body differs. |
Request body application/json
| Field | Type | Description |
|---|---|---|
| itemsrequired | object[] | |
| items[].product_idrequired | string | product.id (uuid) |
| items[].quantityrequired | number | Minimum 1, maximum 100. |
| firstname | string | At most 100 characters. |
| lastname | string | At most 100 characters. |
| string | At most 255 characters. | |
| mobile | string | At most 30 characters. |
| payment_method | string | One of: "COD". At most 50 characters. |
| address_id | string | One of the caller's own personal addresses (ship-to) |
| note | string | At most 1000 characters. |
| coupon_code | string | A store coupon code; the discount is computed server-side At most 40 characters. |
Response
201. The payload in data is of type object.
Find one
GET/orders/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | string, path |
Response
200. The payload in data is of type object.
Buyer cancels a pending / processing order
PATCH/orders/{id}/cancel
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | string, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| reason | string | At most 1000 characters. |
Response
200. The payload in data is not described in the spec yet.
Seller moves an order along the state machine
PATCH/orders/{id}/status
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | string, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| statusrequired | string | One of: "pending", "processing", "shipped", "delivered", "cancelled". |
| comment | string | At most 1000 characters. |
| notify | boolean | Notify the buyer |
Response
200. The payload in data is not described in the spec yet.
Track
GET/orders/{id}/track
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | string, path |
Response
200. The payload in data is not described in the spec yet.
Orders received by a channel I manage / my business
GET/orders/seller
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| status | string, query | One of: "pending", "processing", "shipped", "delivered", "cancelled". |
| sort | string, query | One of: "date_created", "-date_created", "total", "-total". |
| page | number, query | Minimum 1, maximum 10000. |
| limit | number, query | Minimum 1, maximum 100. |
| channel_id | string, query | Seller channel (defaults to the token's channel) |
Response
200. The payload in data is not described in the spec yet.
Customers of a channel I manage (from its orders)
GET/orders/seller/customers
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channel_id | string, query | Seller channel (defaults to the token's channel) |
| q | string, query | Search name, email or mobile At most 100 characters. |
| page | number, query | Minimum 1. |
| limit | number, query | Minimum 1, maximum 100. |
Response
200. The payload in data is not described in the spec yet.