import HenrySDK from '@henrylabs/sdk';
const client = new HenrySDK({
apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted
});
const carts = await client.cart.list();
console.log(carts.data);{
"success": true,
"status": "<string>",
"message": "<string>",
"data": [
{
"cartId": "<string>",
"checkoutUrl": "<string>",
"data": {
"items": [
{
"link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",
"quantity": 1,
"selectedOptions": [
"regular",
"black",
"10-w"
],
"selectedShipping": {
"value": "standard"
},
"coupons": [
"SUMMER26",
"SAVE10"
],
"metadata": {
"creatorSource": "Frank Herbert"
}
}
],
"settings": {
"options": {
"allowPartialPurchase": true,
"collectBuyerEmail": "required",
"collectBuyerAddress": "optional",
"collectBuyerPhone": "off"
},
"commissionFeeFixed": {
"value": 1.99,
"currency": "USD"
},
"commissionFeePercent": 10,
"events": [
{
"type": "order",
"data": [
{
"type": "<string>",
"points": 123
}
],
"conditional": {
"type": "<string>",
"operator": "equals",
"value": "<string>"
}
}
]
},
"tags": {}
},
"metadata": {}
}
]
}List carts with optional filtering by cart ID or tags.
import HenrySDK from '@henrylabs/sdk';
const client = new HenrySDK({
apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted
});
const carts = await client.cart.list();
console.log(carts.data);{
"success": true,
"status": "<string>",
"message": "<string>",
"data": [
{
"cartId": "<string>",
"checkoutUrl": "<string>",
"data": {
"items": [
{
"link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",
"quantity": 1,
"selectedOptions": [
"regular",
"black",
"10-w"
],
"selectedShipping": {
"value": "standard"
},
"coupons": [
"SUMMER26",
"SAVE10"
],
"metadata": {
"creatorSource": "Frank Herbert"
}
}
],
"settings": {
"options": {
"allowPartialPurchase": true,
"collectBuyerEmail": "required",
"collectBuyerAddress": "optional",
"collectBuyerPhone": "off"
},
"commissionFeeFixed": {
"value": 1.99,
"currency": "USD"
},
"commissionFeePercent": 10,
"events": [
{
"type": "order",
"data": [
{
"type": "<string>",
"points": 123
}
],
"conditional": {
"type": "<string>",
"operator": "equals",
"value": "<string>"
}
}
]
},
"tags": {}
},
"metadata": {}
}
]
}Filter by a specific cart ID
"crt_sa2aEsCz9PRM"
Filter carts by key-value tags
Show child attributes
{ "userId": "BennyJ" }Cursor returned from the previous response
"2023-01-01T00:00:00Z"
Limit the number of results
1 <= x <= 10020
Was this page helpful?