|
9 | 9 | - orders:read |
10 | 10 | parameters: |
11 | 11 | - $ref: ../components/parameters/Filter.yaml |
| 12 | + description: |- |
| 13 | + Filters the collection items using space-separated `field:value` pairs. |
| 14 | +
|
| 15 | + **Filterable fields:** `customerName`, `status`, `totalPrice`, `createdAt`, `id` |
| 16 | +
|
| 17 | + **Format:** `field1:value1 field2:value2` |
| 18 | +
|
| 19 | + **Supported operators:** |
| 20 | + - `field:value` - Exact match |
| 21 | + - `field:value1,value2` - Match any of the comma-separated values (OR) |
| 22 | + - Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc. |
| 23 | +
|
| 24 | + **Examples:** |
| 25 | + - `status:placed` - Filter by a single status. |
| 26 | + - `status:placed,completed` - Filter by multiple statuses. |
| 27 | + - `createdAt:30d` - Orders created in the last 30 days. |
| 28 | + - `id:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by a specific order ID. |
| 29 | + - `status:placed createdAt:7d` - Combine multiple filters. |
| 30 | + example: status:placed |
12 | 31 | - $ref: ../components/parameters/Sort.yaml |
| 32 | + description: |- |
| 33 | + Sorts the collection by a single field. Prefix with `-` for descending order |
| 34 | + (for example, `-createdAt`); omit the prefix for ascending order (`createdAt`). |
| 35 | +
|
| 36 | + **Sortable fields:** `customerName`, `status`, `totalPrice`, `createdAt`, `updatedAt`, `id` |
| 37 | + example: '-createdAt' |
13 | 38 | - $ref: ../components/parameters/Limit.yaml |
14 | 39 | - $ref: ../components/parameters/After.yaml |
15 | 40 | - $ref: ../components/parameters/Before.yaml |
16 | 41 | - $ref: ../components/parameters/Search.yaml |
| 42 | + description: |- |
| 43 | + Performs a case-insensitive text search across the searchable fields, returning |
| 44 | + items where any of them contain the search term as a substring. |
| 45 | +
|
| 46 | + **Searchable fields:** `customerName`, `id` |
| 47 | + example: John |
17 | 48 | responses: |
18 | 49 | '200': |
19 | 50 | description: Successful operation. |
|
35 | 66 | summary: Create order |
36 | 67 | description: | |
37 | 68 | Create a new order. |
38 | | - Order items cannot be changed - if they need to be updated, the order should be canceled and a new one placed. |
| 69 | + Order items cannot be changed - if they need to be updated, cancel the order and place a new one. |
39 | 70 | operationId: createOrder |
40 | 71 | security: |
41 | 72 | - OAuth2: |
|
0 commit comments