Retrieve a list of products.
filter | string The collection items filter requires a special format. Use "," for multiple allowed values. Use ";" for multiple fields. See the filter guide for more options and examples about this format. |
sort | Array of strings The collection items sort field and order (prefix with "-" for descending sort). |
limit | integer [ 0 .. 1000 ] The collection items limit. |
offset | integer >= 0 The collection items offset. |
q | string The partial search of the text fields. |
A list of products was retrieved successfully.
Pagination-Total | integer Total items count. Example: 332 |
Pagination-Limit | integer Items per page limit. Example: 100 |
Pagination-Offset | integer Pagination offset. Example: 2 |
Unauthorized access, invalid credentials were used.
Access forbidden.
// all parameters are optional const firstCollection = await api.products.getAll(); // alternatively you can specify one or more of them const params = {limit: 20, offset: 100, sort: '-createdTime'}; const secondCollection = await api.products.getAll(params); // access the collection items, each item is a Member secondCollection.items.forEach(product => console.log(product.fields.name));
[- {
- "id": "membership",
- "name": "Premium membership",
- "unitLabel": "seat",
- "description": "string",
- "requiresShipping": false,
- "options": [
- "string"
], - "customFields": {
- "foo": "bar"
}, - "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "taxCategoryId": "00000",
- "accountingCode": "4010",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
]