u
This commit is contained in:
12
API.order.md
12
API.order.md
@@ -104,9 +104,13 @@ Lists the orders of the user's selected company.
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `[opts]` | `object` | Optional pagination options. |
|
||||
| `[opts]` | `object` | Optional pagination and filter options. |
|
||||
| `[opts.offset=0]` | `number` | Number of orders to skip. |
|
||||
| `[opts.limit=20]` | `number` | Number of orders to return. |
|
||||
| `[opts.limit=50]` | `number` | Number of orders to return. |
|
||||
| `[opts.search]` | `string` | Free-text search matching order number, external number, or customer name. |
|
||||
| `[opts.onlyUnpaid=false]` | `boolean` | When true, returns only unpaid orders. |
|
||||
| `[opts.onlyUndelivered=false]` | `boolean` | When true, returns only undelivered orders. |
|
||||
| `[opts.seekMonths]` | `number` | Negative integer for cutoff months ago (e.g. -1). |
|
||||
| `[tx]` | `object` | Optional transaction. |
|
||||
|
||||
**Returns**
|
||||
@@ -116,8 +120,8 @@ Lists the orders of the user's selected company.
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const result = await store.order.list(42, { offset: 0, limit: 20 });
|
||||
// => { orders: [...], total: 100, offset: 0, limit: 20 }
|
||||
const result = await store.order.list(42, { offset: 0, limit: 50, search: '1002', onlyUnpaid: true, onlyUndelivered: true, seekMonths: -1 });
|
||||
// => { orders: [...], total: 10, offset: 0, limit: 50 }
|
||||
|
||||
const orders = await store.order.list(42);
|
||||
// => [{ id, number, type, entityId, externalNumber, date, createdAt, lines: [...] }]
|
||||
|
||||
Reference in New Issue
Block a user