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 orders = await client.orders.list();
console.log(orders.data);{
"success": true,
"status": "<string>",
"message": "<string>",
"data": [
{
"refId": "<string>",
"status": "pending",
"products": [
{
"status": "pending",
"link": "<string>",
"quantity": 123,
"merchant": "<string>",
"host": "<string>",
"selectedOptions": [
"<string>"
],
"selectedShipping": {
"id": "<string>",
"value": "<string>"
}
}
],
"details": {
"hasAccount": true,
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"card": {
"nameOnCard": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"details": {},
"billingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"line2": "<string>"
}
},
"email": "<string>",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"shippingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"line2": "<string>"
},
"settings": {
"collectEmail": true,
"collectAddress": true,
"collectPhone": true
}
},
"result": {
"items": [
{
"productLink": "<string>",
"confirmationNumber": "<string>",
"costs": {
"total": {
"value": 123,
"currency": "USD"
},
"subtotal": {
"value": 123,
"currency": "USD"
},
"tax": {
"value": 123,
"currency": "USD"
},
"shipping": {
"value": 123,
"currency": "USD"
},
"discount": {
"value": 123,
"currency": "USD"
}
},
"shipping": {
"id": "<string>",
"name": "<string>",
"cost": {
"value": 123,
"currency": "USD"
},
"timeEstimate": "<string>",
"minDate": "<string>",
"maxDate": "<string>"
},
"appliedCoupon": {
"code": "<string>",
"savedAmount": {
"value": 123,
"currency": "USD"
}
},
"metadata": {}
}
],
"costs": {
"subtotal": {
"value": 123,
"currency": "USD"
},
"commissionFee": {
"value": 123,
"currency": "USD"
},
"total": {
"value": 123,
"currency": "USD"
}
}
},
"error": {}
}
]
}Fetch a list of orders with optional filtering and pagination.
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 orders = await client.orders.list();
console.log(orders.data);{
"success": true,
"status": "<string>",
"message": "<string>",
"data": [
{
"refId": "<string>",
"status": "pending",
"products": [
{
"status": "pending",
"link": "<string>",
"quantity": 123,
"merchant": "<string>",
"host": "<string>",
"selectedOptions": [
"<string>"
],
"selectedShipping": {
"id": "<string>",
"value": "<string>"
}
}
],
"details": {
"hasAccount": true,
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"card": {
"nameOnCard": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"details": {},
"billingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"line2": "<string>"
}
},
"email": "<string>",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"shippingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"line2": "<string>"
},
"settings": {
"collectEmail": true,
"collectAddress": true,
"collectPhone": true
}
},
"result": {
"items": [
{
"productLink": "<string>",
"confirmationNumber": "<string>",
"costs": {
"total": {
"value": 123,
"currency": "USD"
},
"subtotal": {
"value": 123,
"currency": "USD"
},
"tax": {
"value": 123,
"currency": "USD"
},
"shipping": {
"value": 123,
"currency": "USD"
},
"discount": {
"value": 123,
"currency": "USD"
}
},
"shipping": {
"id": "<string>",
"name": "<string>",
"cost": {
"value": 123,
"currency": "USD"
},
"timeEstimate": "<string>",
"minDate": "<string>",
"maxDate": "<string>"
},
"appliedCoupon": {
"code": "<string>",
"savedAmount": {
"value": 123,
"currency": "USD"
}
},
"metadata": {}
}
],
"costs": {
"subtotal": {
"value": 123,
"currency": "USD"
},
"commissionFee": {
"value": 123,
"currency": "USD"
},
"total": {
"value": 123,
"currency": "USD"
}
}
},
"error": {}
}
]
}Cursor returned from the previous response
"2023-01-01T00:00:00Z"
Limit the number of results
1 <= x <= 10020
Filter orders by status
pending, processing, complete, cancelled "complete"
Filter orders by cart ID
"sa2aEsCz9PRM"
Was this page helpful?