@henrylabs/mcp 1.4.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth.d.mts.map +1 -1
- package/auth.d.ts.map +1 -1
- package/code-tool-types.d.mts.map +1 -1
- package/code-tool-types.d.ts.map +1 -1
- package/code-tool-worker.mjs.map +1 -1
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts.map +1 -1
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts +2 -2
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +2 -2
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.mjs.map +1 -1
- package/http.d.mts.map +1 -1
- package/http.d.ts.map +1 -1
- package/http.mjs.map +1 -1
- package/index.mjs.map +1 -1
- package/instructions.mjs.map +1 -1
- package/local-docs-search.d.mts.map +1 -1
- package/local-docs-search.d.ts.map +1 -1
- package/local-docs-search.js +130 -122
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +130 -122
- package/local-docs-search.mjs.map +1 -1
- package/logger.d.mts.map +1 -1
- package/logger.d.ts.map +1 -1
- package/logger.mjs.map +1 -1
- package/methods.d.mts.map +1 -1
- package/methods.d.ts.map +1 -1
- package/options.mjs.map +1 -1
- package/package.json +2 -2
- package/server.d.mts.map +1 -1
- package/server.d.ts.map +1 -1
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/server.mjs.map +1 -1
- package/src/local-docs-search.ts +134 -125
- package/src/server.ts +1 -1
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts.map +1 -1
- package/stdio.mjs.map +1 -1
- package/types.d.mts.map +1 -1
- package/types.d.ts.map +1 -1
package/src/local-docs-search.ts
CHANGED
|
@@ -60,24 +60,24 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
60
60
|
stainlessPath: '(resource) products > (method) search',
|
|
61
61
|
qualified: 'client.products.search',
|
|
62
62
|
params: [
|
|
63
|
-
"{ filters: { query: string; type: 'text'; country?: string; price?: { currency?: string; max?: number; min?: number; }; sortBy?: 'price-low-to-high' | 'price-high-to-low'; } | { imageUrl: string; type: 'image'; country?: string; }; type: 'global'; cursor?: number; limit?: number; mode?: 'async' | 'sync'; } | { filters: { merchant: string; }; type: 'merchant'; cursor?: number; limit?: number; mode?: 'async' | 'sync'; query?: string; };",
|
|
63
|
+
"{ filters: { query: string; type: 'text'; country?: string; price?: { currency?: string; max?: number; min?: number; }; sortBy?: 'price-low-to-high' | 'price-high-to-low'; } | { imageUrl: string; type: 'image'; country?: string; }; type: 'global'; cursor?: number; limit?: number; mode?: 'async' | 'sync'; skipCache?: boolean; } | { filters: { merchant: string; country?: string; }; type: 'merchant'; cursor?: number; limit?: number; mode?: 'async' | 'sync'; query?: string; skipCache?: boolean; };",
|
|
64
64
|
],
|
|
65
65
|
response:
|
|
66
|
-
"{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; sku?: string; }[]; }; }",
|
|
66
|
+
"{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; reviews?: object; sku?: string; }[]; }; }",
|
|
67
67
|
perLanguage: {
|
|
68
|
-
|
|
68
|
+
typescript: {
|
|
69
|
+
method: 'client.products.search',
|
|
69
70
|
example:
|
|
70
|
-
'
|
|
71
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.search({\n filters: {\n type: 'text',\n query: 'Air Max Shoes',\n country: 'US',\n price: {\n min: 1,\n max: 100,\n currency: 'USD',\n },\n sortBy: 'price-low-to-high',\n },\n type: 'global',\n limit: 40,\n mode: 'async',\n});\n\nconsole.log(response.refId);",
|
|
71
72
|
},
|
|
72
73
|
python: {
|
|
73
74
|
method: 'products.search',
|
|
74
75
|
example:
|
|
75
76
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.products.search(\n filters={\n "type": "text",\n "query": "Air Max Shoes",\n "country": "US",\n "price": {\n "min": 1,\n "max": 100,\n "currency": "USD",\n },\n "sort_by": "price-low-to-high",\n },\n type="global",\n cursor=0,\n limit=40,\n mode="async",\n)\nprint(response.ref_id)',
|
|
76
77
|
},
|
|
77
|
-
|
|
78
|
-
method: 'client.products.search',
|
|
78
|
+
http: {
|
|
79
79
|
example:
|
|
80
|
-
|
|
80
|
+
'curl https://api.henrylabs.ai/v1/product/search \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "filters": {\n "query": "Air Max Shoes",\n "type": "text"\n },\n "type": "global",\n "cursor": 0,\n "limit": 20,\n "skipCache": false\n }\'',
|
|
81
81
|
},
|
|
82
82
|
},
|
|
83
83
|
},
|
|
@@ -91,23 +91,23 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
91
91
|
qualified: 'client.products.pollSearch',
|
|
92
92
|
params: ['refId: string;'],
|
|
93
93
|
response:
|
|
94
|
-
"{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; sku?: string; }[]; }; }",
|
|
94
|
+
"{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; reviews?: object; sku?: string; }[]; }; }",
|
|
95
95
|
markdown:
|
|
96
|
-
"## poll_search\n\n`client.products.pollSearch(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/product/search/status`\n\nCheck the status of a product search retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; sku?: string; }[]; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: { value: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; images?: object[]; label?: string; link?: string; nextOption?: object; }[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; sku?: string; }[]; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.products.pollSearch({ refId: 'prs-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
96
|
+
"## poll_search\n\n`client.products.pollSearch(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/product/search/status`\n\nCheck the status of a product search retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: object[]; options?: object | object; originalPrice?: object; price?: object; reviews?: object; sku?: string; }[]; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { pagination: { nextCursor: number; previousCursor: number; }; products: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: { value: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; images?: object[]; label?: string; link?: string; nextOption?: object; }[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; reviews?: { count?: number; criticRatings?: { name: string; rating: string; link?: string; }[]; histogram?: { count: number; stars: number; }[]; insights?: { snippets: string[]; title: string; }[]; rating?: number; userReviews?: { text: string; author?: string; date?: string; images?: string[]; rating?: number; source?: string; title?: string; }[]; }; sku?: string; }[]; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.products.pollSearch({ refId: 'prs-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
97
97
|
perLanguage: {
|
|
98
|
-
|
|
98
|
+
typescript: {
|
|
99
|
+
method: 'client.products.pollSearch',
|
|
99
100
|
example:
|
|
100
|
-
'
|
|
101
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.pollSearch({ refId: 'prs-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response.refId);",
|
|
101
102
|
},
|
|
102
103
|
python: {
|
|
103
104
|
method: 'products.poll_search',
|
|
104
105
|
example:
|
|
105
106
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.products.poll_search(\n ref_id="prs-ref_3fa85f64-5717-4562-b3fc",\n)\nprint(response.ref_id)',
|
|
106
107
|
},
|
|
107
|
-
|
|
108
|
-
method: 'client.products.pollSearch',
|
|
108
|
+
http: {
|
|
109
109
|
example:
|
|
110
|
-
|
|
110
|
+
'curl https://api.henrylabs.ai/v1/product/search/status \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
111
111
|
},
|
|
112
112
|
},
|
|
113
113
|
},
|
|
@@ -120,25 +120,31 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
120
120
|
'Fetch detailed information about a product from a given URL. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.',
|
|
121
121
|
stainlessPath: '(resource) products > (method) details',
|
|
122
122
|
qualified: 'client.products.details',
|
|
123
|
-
params: [
|
|
123
|
+
params: [
|
|
124
|
+
'link: string;',
|
|
125
|
+
'country?: string;',
|
|
126
|
+
"mode?: 'async' | 'sync';",
|
|
127
|
+
'selectedOptions?: string[];',
|
|
128
|
+
'skipCache?: boolean;',
|
|
129
|
+
],
|
|
124
130
|
response:
|
|
125
|
-
"{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; sku?: string; }; }",
|
|
131
|
+
"{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; reviews?: { count?: number; criticRatings?: object[]; histogram?: object[]; insights?: object[]; rating?: number; userReviews?: object[]; }; sections?: { body: string; title: string; }[]; sku?: string; }; }",
|
|
126
132
|
markdown:
|
|
127
|
-
"## details\n\n`client.products.details(link: string, country?: string, mode?: 'async' | 'sync', selectedOptions?: string[]): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**post** `/product/details`\n\nFetch detailed information about a product from a given URL. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.\n\n### Parameters\n\n- `link: string`\n Direct product URL\n\n- `country?: string`\n Country code for the product's location\n\n- `mode?: 'async' | 'sync'`\n Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.\n\n- `selectedOptions?: string[]`\n An ordered array of option values to select for the product. Will be selected in the order listed.\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; sku?: string; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: { value: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; images?: { url: string; isFeatured?: boolean; }[]; label?: string; link?: string; nextOption?: object; }[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; sku?: string; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.products.details({ link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' });\n\nconsole.log(response);\n```",
|
|
133
|
+
"## details\n\n`client.products.details(link: string, country?: string, mode?: 'async' | 'sync', selectedOptions?: string[], skipCache?: boolean): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**post** `/product/details`\n\nFetch detailed information about a product from a given URL. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.\n\n### Parameters\n\n- `link: string`\n Direct product URL\n\n- `country?: string`\n Country code for the product's location\n\n- `mode?: 'async' | 'sync'`\n Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.\n\n- `selectedOptions?: string[]`\n An ordered array of option values to select for the product. Will be selected in the order listed.\n\n- `skipCache?: boolean`\n When true, bypass any cached product details and force a fresh fetch. Fresh results still repopulate the cache.\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; reviews?: { count?: number; criticRatings?: object[]; histogram?: object[]; insights?: object[]; rating?: number; userReviews?: object[]; }; sections?: { body: string; title: string; }[]; sku?: string; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: { value: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; images?: { url: string; isFeatured?: boolean; }[]; label?: string; link?: string; nextOption?: object; }[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; reviews?: { count?: number; criticRatings?: { name: string; rating: string; link?: string; }[]; histogram?: { count: number; stars: number; }[]; insights?: { snippets: string[]; title: string; }[]; rating?: number; userReviews?: { text: string; author?: string; date?: string; images?: string[]; rating?: number; source?: string; title?: string; }[]; }; sections?: { body: string; title: string; }[]; sku?: string; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.products.details({ link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' });\n\nconsole.log(response);\n```",
|
|
128
134
|
perLanguage: {
|
|
129
|
-
|
|
135
|
+
typescript: {
|
|
136
|
+
method: 'client.products.details',
|
|
130
137
|
example:
|
|
131
|
-
'
|
|
138
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.details({\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n country: 'US',\n mode: 'async',\n});\n\nconsole.log(response.refId);",
|
|
132
139
|
},
|
|
133
140
|
python: {
|
|
134
141
|
method: 'products.details',
|
|
135
142
|
example:
|
|
136
143
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.products.details(\n link="https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n country="US",\n mode="async",\n)\nprint(response.ref_id)',
|
|
137
144
|
},
|
|
138
|
-
|
|
139
|
-
method: 'client.products.details',
|
|
145
|
+
http: {
|
|
140
146
|
example:
|
|
141
|
-
|
|
147
|
+
'curl https://api.henrylabs.ai/v1/product/details \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "country": "US",\n "mode": "async",\n "selectedOptions": [\n "regular",\n "black",\n "10-w"\n ],\n "skipCache": false\n }\'',
|
|
142
148
|
},
|
|
143
149
|
},
|
|
144
150
|
},
|
|
@@ -152,23 +158,23 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
152
158
|
qualified: 'client.products.pollDetails',
|
|
153
159
|
params: ['refId: string;'],
|
|
154
160
|
response:
|
|
155
|
-
"{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; sku?: string; }; }",
|
|
161
|
+
"{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; reviews?: { count?: number; criticRatings?: object[]; histogram?: object[]; insights?: object[]; rating?: number; userReviews?: object[]; }; sections?: { body: string; title: string; }[]; sku?: string; }; }",
|
|
156
162
|
markdown:
|
|
157
|
-
"## poll_details\n\n`client.products.pollDetails(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/product/details/status`\n\nCheck the status of a product details retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; sku?: string; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: { value: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; images?: { url: string; isFeatured?: boolean; }[]; label?: string; link?: string; nextOption?: object; }[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; sku?: string; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.products.pollDetails({ refId: 'prd-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
163
|
+
"## poll_details\n\n`client.products.pollDetails(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/product/details/status`\n\nCheck the status of a product details retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: object[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; reviews?: { count?: number; criticRatings?: object[]; histogram?: object[]; insights?: object[]; rating?: number; userReviews?: object[]; }; sections?: { body: string; title: string; }[]; sku?: string; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { host: string; link: string; merchant: string; name: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; description?: string; images?: { url: string; isFeatured?: boolean; }[]; options?: { status: 'found'; values: { value: string; availability?: 'in_stock' | 'limited_stock' | 'out_of_stock' | 'preorder' | 'backorder'; images?: { url: string; isFeatured?: boolean; }[]; label?: string; link?: string; nextOption?: object; }[]; label?: string; } | { message: string; status: 'unknown'; }; originalPrice?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; price?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; reviews?: { count?: number; criticRatings?: { name: string; rating: string; link?: string; }[]; histogram?: { count: number; stars: number; }[]; insights?: { snippets: string[]; title: string; }[]; rating?: number; userReviews?: { text: string; author?: string; date?: string; images?: string[]; rating?: number; source?: string; title?: string; }[]; }; sections?: { body: string; title: string; }[]; sku?: string; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.products.pollDetails({ refId: 'prd-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
158
164
|
perLanguage: {
|
|
159
|
-
|
|
165
|
+
typescript: {
|
|
166
|
+
method: 'client.products.pollDetails',
|
|
160
167
|
example:
|
|
161
|
-
'
|
|
168
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.pollDetails({ refId: 'prd-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response.refId);",
|
|
162
169
|
},
|
|
163
170
|
python: {
|
|
164
171
|
method: 'products.poll_details',
|
|
165
172
|
example:
|
|
166
173
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.products.poll_details(\n ref_id="prd-ref_3fa85f64-5717-4562-b3fc",\n)\nprint(response.ref_id)',
|
|
167
174
|
},
|
|
168
|
-
|
|
169
|
-
method: 'client.products.pollDetails',
|
|
175
|
+
http: {
|
|
170
176
|
example:
|
|
171
|
-
|
|
177
|
+
'curl https://api.henrylabs.ai/v1/product/details/status \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
172
178
|
},
|
|
173
179
|
},
|
|
174
180
|
},
|
|
@@ -181,28 +187,28 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
181
187
|
stainlessPath: '(resource) cart > (method) create',
|
|
182
188
|
qualified: 'client.cart.create',
|
|
183
189
|
params: [
|
|
184
|
-
'items: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[];',
|
|
185
|
-
"settings?: { commissionFeeFixed?: { value: number; currency?: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; }; commissionFeePercent?: number; events?: { data: { points: number; type: 'give_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; points: number; type: 'give_points_per_spent'; } | { points: number; type: 'remove_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; points: number; type: 'remove_points_per_spent'; } | { tierUUID: string; type: 'give_tier'; } | { type: 'remove_tier'; } | { type: 'send_webhook'; webhookUUID: string; } | { type: 'send_email'; }[]; type: string; conditional?: { operator: 'equals' | 'not_equals'; type: 'tier'; value: string; } | { operator: string; type: 'points'; value: number; }; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; };",
|
|
190
|
+
'items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[];',
|
|
191
|
+
"settings?: { commissionFeeFixed?: { value: number; currency?: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; }; commissionFeePercent?: number; events?: { data: { points: number; type: 'give_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; points: number; type: 'give_points_per_spent'; } | { points: number; type: 'remove_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; points: number; type: 'remove_points_per_spent'; } | { tierUUID: string; type: 'give_tier'; } | { type: 'remove_tier'; } | { type: 'send_webhook'; webhookUUID: string; } | { type: 'send_email'; }[]; type: string; conditional?: { operator: 'equals' | 'not_equals'; type: 'tier'; value: string; } | { operator: string; type: 'points'; value: number; }; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; };",
|
|
186
192
|
'tags?: object;',
|
|
187
193
|
],
|
|
188
194
|
response:
|
|
189
195
|
'{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
190
196
|
markdown:
|
|
191
|
-
"## create\n\n`client.cart.create(items: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[], settings?: { commissionFeeFixed?: { value: number; currency?: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }, tags?: object): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart`\n\nCreate a cart with one or more items and get a checkout URL\n\n### Parameters\n\n- `items: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]`\n Items to include in the cart\n\n- `settings?: { commissionFeeFixed?: { value: number; currency?: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; }; commissionFeePercent?: number; events?: { data: { points: number; type: 'give_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; points: number; type: 'give_points_per_spent'; } | { points: number; type: 'remove_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; points: number; type: 'remove_points_per_spent'; } | { tierUUID: string; type: 'give_tier'; } | { type: 'remove_tier'; } | { type: 'send_webhook'; webhookUUID: string; } | { type: 'send_email'; }[]; type: string; conditional?: { operator: 'equals' | 'not_equals'; type: 'tier'; value: string; } | { operator: string; type: 'points'; value: number; }; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }`\n - `commissionFeeFixed?: { value: number; currency?: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; }`\n - `commissionFeePercent?: number`\n Commission percentage (0–100)\n - `events?: { data: { points: number; type: 'give_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; points: number; type: 'give_points_per_spent'; } | { points: number; type: 'remove_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; points: number; type: 'remove_points_per_spent'; } | { tierUUID: string; type: 'give_tier'; } | { type: 'remove_tier'; } | { type: 'send_webhook'; webhookUUID: string; } | { type: 'send_email'; }[]; type: string; conditional?: { operator: 'equals' | 'not_equals'; type: 'tier'; value: string; } | { operator: string; type: 'points'; value: number; }; }[]`\n List of events to trigger during checkout\n - `options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }`\n\n- `tags?: object`\n Key-value tags to associate with the cart\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst cart = await client.cart.create({ items: [{ link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' }] });\n\nconsole.log(cart);\n```",
|
|
197
|
+
"## create\n\n`client.cart.create(items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[], settings?: { commissionFeeFixed?: { value: number; currency?: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }, tags?: object): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart`\n\nCreate a cart with one or more items and get a checkout URL\n\n### Parameters\n\n- `items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]`\n Items to include in the cart\n\n- `settings?: { commissionFeeFixed?: { value: number; currency?: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; }; commissionFeePercent?: number; events?: { data: { points: number; type: 'give_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; points: number; type: 'give_points_per_spent'; } | { points: number; type: 'remove_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; points: number; type: 'remove_points_per_spent'; } | { tierUUID: string; type: 'give_tier'; } | { type: 'remove_tier'; } | { type: 'send_webhook'; webhookUUID: string; } | { type: 'send_email'; }[]; type: string; conditional?: { operator: 'equals' | 'not_equals'; type: 'tier'; value: string; } | { operator: string; type: 'points'; value: number; }; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }`\n - `commissionFeeFixed?: { value: number; currency?: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; }`\n - `commissionFeePercent?: number`\n Commission percentage (0–100)\n - `events?: { data: { points: number; type: 'give_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; points: number; type: 'give_points_per_spent'; } | { points: number; type: 'remove_points_fixed'; } | { perAmount: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; points: number; type: 'remove_points_per_spent'; } | { tierUUID: string; type: 'give_tier'; } | { type: 'remove_tier'; } | { type: 'send_webhook'; webhookUUID: string; } | { type: 'send_email'; }[]; type: string; conditional?: { operator: 'equals' | 'not_equals'; type: 'tier'; value: string; } | { operator: string; type: 'points'; value: number; }; }[]`\n List of events to trigger during checkout\n - `options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }`\n\n- `tags?: object`\n Key-value tags to associate with the cart\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst cart = await client.cart.create({ items: [{ link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' }] });\n\nconsole.log(cart);\n```",
|
|
192
198
|
perLanguage: {
|
|
193
|
-
|
|
199
|
+
typescript: {
|
|
200
|
+
method: 'client.cart.create',
|
|
194
201
|
example:
|
|
195
|
-
'
|
|
202
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst cart = await client.cart.create({\n items: [\n {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n affiliateProductLink:\n 'https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205',\n quantity: 2,\n selectedOptions: ['regular', 'black', '10-w'],\n metadata: { creatorSource: 'Frank Herbert' },\n },\n ],\n settings: {\n options: {\n allowPartialPurchase: true,\n collectBuyerEmail: 'required',\n collectBuyerAddress: 'optional',\n collectBuyerPhone: 'off',\n },\n commissionFeeFixed: { value: 1.99, currency: 'USD' },\n commissionFeePercent: 10,\n events: [],\n },\n});\n\nconsole.log(cart.data);",
|
|
196
203
|
},
|
|
197
204
|
python: {
|
|
198
205
|
method: 'cart.create',
|
|
199
206
|
example:
|
|
200
|
-
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\ncart = client.cart.create(\n items=[{\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "quantity": 2,\n "selected_options": ["regular", "black", "10-w"],\n "metadata": {\n "creatorSource": "Frank Herbert"\n },\n }],\n settings={\n "options": {\n "allow_partial_purchase": True,\n "collect_buyer_email": "required",\n "collect_buyer_address": "optional",\n "collect_buyer_phone": "off",\n },\n "commission_fee_fixed": {\n "value": 1.99,\n "currency": "USD",\n },\n "commission_fee_percent": 10,\n "events": [],\n },\n)\nprint(cart.data)',
|
|
207
|
+
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\ncart = client.cart.create(\n items=[{\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliate_product_link": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "quantity": 2,\n "selected_options": ["regular", "black", "10-w"],\n "metadata": {\n "creatorSource": "Frank Herbert"\n },\n }],\n settings={\n "options": {\n "allow_partial_purchase": True,\n "collect_buyer_email": "required",\n "collect_buyer_address": "optional",\n "collect_buyer_phone": "off",\n },\n "commission_fee_fixed": {\n "value": 1.99,\n "currency": "USD",\n },\n "commission_fee_percent": 10,\n "events": [],\n },\n)\nprint(cart.data)',
|
|
201
208
|
},
|
|
202
|
-
|
|
203
|
-
method: 'client.cart.create',
|
|
209
|
+
http: {
|
|
204
210
|
example:
|
|
205
|
-
|
|
211
|
+
'curl https://api.henrylabs.ai/v1/cart \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "items": [\n {\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliateProductLink": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "metadata": {\n "creatorSource": "bar"\n },\n "quantity": 2,\n "selectedOptions": [\n "regular",\n "black",\n "10-w"\n ]\n }\n ],\n "settings": {\n "commissionFeeFixed": {\n "value": 1.99,\n "currency": "USD"\n },\n "commissionFeePercent": 10,\n "events": [\n {\n "data": [\n {\n "points": 0,\n "type": "give_points_fixed"\n }\n ],\n "type": "order"\n }\n ],\n "options": {\n "allowPartialPurchase": true,\n "collectBuyerAddress": "optional",\n "collectBuyerEmail": "required",\n "collectBuyerPhone": "off"\n }\n },\n "tags": {\n "region": "us-ny"\n }\n }\'',
|
|
206
212
|
},
|
|
207
213
|
},
|
|
208
214
|
},
|
|
@@ -218,20 +224,20 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
218
224
|
response:
|
|
219
225
|
'{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }[]; message: string; status: string; success: boolean; }',
|
|
220
226
|
markdown:
|
|
221
|
-
"## list\n\n`client.cart.list(cartId?: string, cursor?: string, limit?: number, tags?: object): { data: object[]; message: string; status: string; success: boolean; }`\n\n**get** `/cart`\n\nList carts with optional filtering by cart ID or tags.\n\n### Parameters\n\n- `cartId?: string`\n Filter by a specific cart ID\n\n- `cursor?: string`\n Cursor returned from the previous response\n\n- `limit?: number`\n Limit the number of results\n\n- `tags?: object`\n Filter carts by key-value tags\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }[]; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }[]`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst carts = await client.cart.list();\n\nconsole.log(carts);\n```",
|
|
227
|
+
"## list\n\n`client.cart.list(cartId?: string, cursor?: string, limit?: number, tags?: object): { data: object[]; message: string; status: string; success: boolean; }`\n\n**get** `/cart`\n\nList carts with optional filtering by cart ID or tags.\n\n### Parameters\n\n- `cartId?: string`\n Filter by a specific cart ID\n\n- `cursor?: string`\n Cursor returned from the previous response\n\n- `limit?: number`\n Limit the number of results\n\n- `tags?: object`\n Filter carts by key-value tags\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }[]; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }[]`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst carts = await client.cart.list();\n\nconsole.log(carts);\n```",
|
|
222
228
|
perLanguage: {
|
|
223
|
-
|
|
224
|
-
|
|
229
|
+
typescript: {
|
|
230
|
+
method: 'client.cart.list',
|
|
231
|
+
example:
|
|
232
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst carts = await client.cart.list();\n\nconsole.log(carts.data);",
|
|
225
233
|
},
|
|
226
234
|
python: {
|
|
227
235
|
method: 'cart.list',
|
|
228
236
|
example:
|
|
229
237
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\ncarts = client.cart.list()\nprint(carts.data)',
|
|
230
238
|
},
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
example:
|
|
234
|
-
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst carts = await client.cart.list();\n\nconsole.log(carts.data);",
|
|
239
|
+
http: {
|
|
240
|
+
example: 'curl https://api.henrylabs.ai/v1/cart \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
235
241
|
},
|
|
236
242
|
},
|
|
237
243
|
},
|
|
@@ -246,26 +252,26 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
246
252
|
qualified: 'client.cart.fetch',
|
|
247
253
|
params: [
|
|
248
254
|
'cartId: string;',
|
|
249
|
-
'buyer?: { email?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: string; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string;
|
|
255
|
+
'buyer?: { email?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: string; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; };',
|
|
250
256
|
],
|
|
251
257
|
response:
|
|
252
258
|
'{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
253
259
|
markdown:
|
|
254
|
-
"## fetch\n\n`client.cart.fetch(cartId: string, buyer?: { email?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: string; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string;
|
|
260
|
+
"## fetch\n\n`client.cart.fetch(cartId: string, buyer?: { email?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: string; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string; phone?: object; }; }): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart/{cartId}`\n\nFetch a single cart by ID and optionally prefill buyer details in the returned checkout URL.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `buyer?: { email?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: string; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n Optional buyer details to prefill at checkout. When provided, the returned checkoutUrl will include these as query params.\n - `email?: string`\n Buyer's email to prefill at checkout\n - `name?: { firstName: string; lastName: string; middleName?: string; }`\n Buyer's name to prefill at checkout\n - `phone?: string`\n Buyer's phone number (E.164 format) to prefill at checkout\n - `shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; line2?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }`\n Buyer's shipping address to prefill at checkout\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.fetch('crt_sa2aEsCz9PRM');\n\nconsole.log(response);\n```",
|
|
255
261
|
perLanguage: {
|
|
256
|
-
|
|
262
|
+
typescript: {
|
|
263
|
+
method: 'client.cart.fetch',
|
|
257
264
|
example:
|
|
258
|
-
'
|
|
265
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.fetch('crt_sa2aEsCz9PRM', {\n buyer: {\n name: { firstName: 'John', lastName: 'Doe' },\n email: 'john@example.com',\n phone: '+15551234567',\n shippingAddress: {\n line1: '123 Main St',\n city: 'New York',\n province: 'NY',\n postalCode: '10001',\n countryCode: 'US',\n },\n },\n});\n\nconsole.log(response.data);",
|
|
259
266
|
},
|
|
260
267
|
python: {
|
|
261
268
|
method: 'cart.fetch',
|
|
262
269
|
example:
|
|
263
|
-
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.fetch(\n cart_id="crt_sa2aEsCz9PRM",\n buyer={\n "name": {\n "first_name": "John",\n "last_name": "Doe",\n },\n "email": "john@example.com",\n "phone": "+15551234567",\n "shipping_address": {\n "
|
|
270
|
+
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.fetch(\n cart_id="crt_sa2aEsCz9PRM",\n buyer={\n "name": {\n "first_name": "John",\n "last_name": "Doe",\n },\n "email": "john@example.com",\n "phone": "+15551234567",\n "shipping_address": {\n "line1": "123 Main St",\n "city": "New York",\n "province": "NY",\n "postal_code": "10001",\n "country_code": "US",\n },\n },\n)\nprint(response.data)',
|
|
264
271
|
},
|
|
265
|
-
|
|
266
|
-
method: 'client.cart.fetch',
|
|
272
|
+
http: {
|
|
267
273
|
example:
|
|
268
|
-
|
|
274
|
+
'curl https://api.henrylabs.ai/v1/cart/$CART_ID \\\n -X POST \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
269
275
|
},
|
|
270
276
|
},
|
|
271
277
|
},
|
|
@@ -281,21 +287,21 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
281
287
|
response:
|
|
282
288
|
'{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
283
289
|
markdown:
|
|
284
|
-
"## delete\n\n`client.cart.delete(cartId: string): { data: object; message: string; status: string; success: boolean; }`\n\n**delete** `/cart/{cartId}`\n\nDelete a cart by its unique identifier\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst cart = await client.cart.delete('crt_sa2aEsCz9PRM');\n\nconsole.log(cart);\n```",
|
|
290
|
+
"## delete\n\n`client.cart.delete(cartId: string): { data: object; message: string; status: string; success: boolean; }`\n\n**delete** `/cart/{cartId}`\n\nDelete a cart by its unique identifier\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst cart = await client.cart.delete('crt_sa2aEsCz9PRM');\n\nconsole.log(cart);\n```",
|
|
285
291
|
perLanguage: {
|
|
286
|
-
|
|
292
|
+
typescript: {
|
|
293
|
+
method: 'client.cart.delete',
|
|
287
294
|
example:
|
|
288
|
-
'
|
|
295
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst cart = await client.cart.delete('crt_sa2aEsCz9PRM');\n\nconsole.log(cart.data);",
|
|
289
296
|
},
|
|
290
297
|
python: {
|
|
291
298
|
method: 'cart.delete',
|
|
292
299
|
example:
|
|
293
300
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\ncart = client.cart.delete(\n "crt_sa2aEsCz9PRM",\n)\nprint(cart.data)',
|
|
294
301
|
},
|
|
295
|
-
|
|
296
|
-
method: 'client.cart.delete',
|
|
302
|
+
http: {
|
|
297
303
|
example:
|
|
298
|
-
|
|
304
|
+
'curl https://api.henrylabs.ai/v1/cart/$CART_ID \\\n -X DELETE \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
299
305
|
},
|
|
300
306
|
},
|
|
301
307
|
},
|
|
@@ -309,26 +315,26 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
309
315
|
qualified: 'client.cart.item.add',
|
|
310
316
|
params: [
|
|
311
317
|
'cartId: string;',
|
|
312
|
-
'item: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; };',
|
|
318
|
+
'item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; };',
|
|
313
319
|
],
|
|
314
320
|
response:
|
|
315
321
|
'{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
316
322
|
markdown:
|
|
317
|
-
"## add\n\n`client.cart.item.add(cartId: string, item: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart/{cartId}/item`\n\nAdd an item to an existing cart.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `item: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }`\n Item to add to the cart (can be object or stringified JSON)\n - `link: string`\n Direct product URL\n - `coupons?: string[]`\n List of coupon codes applied to this cart item\n - `metadata?: object`\n Misc metadata associated with this cart item\n - `quantity?: number`\n Quantity of this item\n - `selectedOptions?: string[]`\n An ordered array of option values to select for the product. Will be selected in the order listed.\n - `selectedShipping?: { id?: string; value?: string; }`\n Shipping option selected for this cart item\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.item.add('crt_sa2aEsCz9PRM', { item: { link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' } });\n\nconsole.log(response);\n```",
|
|
323
|
+
"## add\n\n`client.cart.item.add(cartId: string, item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart/{cartId}/item`\n\nAdd an item to an existing cart.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }`\n Item to add to the cart (can be object or stringified JSON)\n - `link: string`\n Direct product URL\n - `affiliateProductLink?: string`\n Optional affiliate or redirect URL used for fulfillment. If omitted, link is used.\n - `coupons?: string[]`\n List of coupon codes applied to this cart item\n - `metadata?: object`\n Misc metadata associated with this cart item\n - `quantity?: number`\n Quantity of this item\n - `selectedOptions?: string[]`\n An ordered array of option values to select for the product. Will be selected in the order listed.\n - `selectedShipping?: { id?: string; value?: string; }`\n Shipping option selected for this cart item\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.item.add('crt_sa2aEsCz9PRM', { item: { link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' } });\n\nconsole.log(response);\n```",
|
|
318
324
|
perLanguage: {
|
|
319
|
-
|
|
325
|
+
typescript: {
|
|
326
|
+
method: 'client.cart.item.add',
|
|
320
327
|
example:
|
|
321
|
-
'
|
|
328
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.item.add('crt_sa2aEsCz9PRM', {\n item: {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n affiliateProductLink:\n 'https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205',\n quantity: 1,\n selectedOptions: ['regular', 'black', '10-w'],\n metadata: { creatorSource: 'Frank Herbert' },\n },\n});\n\nconsole.log(response.data);",
|
|
322
329
|
},
|
|
323
330
|
python: {
|
|
324
331
|
method: 'cart.item.add',
|
|
325
332
|
example:
|
|
326
|
-
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.item.add(\n cart_id="crt_sa2aEsCz9PRM",\n item={\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "quantity": 1,\n "selected_options": ["regular", "black", "10-w"],\n "metadata": {\n "creatorSource": "Frank Herbert"\n },\n },\n)\nprint(response.data)',
|
|
333
|
+
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.item.add(\n cart_id="crt_sa2aEsCz9PRM",\n item={\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliate_product_link": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "quantity": 1,\n "selected_options": ["regular", "black", "10-w"],\n "metadata": {\n "creatorSource": "Frank Herbert"\n },\n },\n)\nprint(response.data)',
|
|
327
334
|
},
|
|
328
|
-
|
|
329
|
-
method: 'client.cart.item.add',
|
|
335
|
+
http: {
|
|
330
336
|
example:
|
|
331
|
-
|
|
337
|
+
'curl https://api.henrylabs.ai/v1/cart/$CART_ID/item \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "item": {\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliateProductLink": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "metadata": {\n "creatorSource": "bar"\n },\n "quantity": 1,\n "selectedOptions": [\n "regular",\n "black",\n "10-w"\n ]\n }\n }\'',
|
|
332
338
|
},
|
|
333
339
|
},
|
|
334
340
|
},
|
|
@@ -342,26 +348,26 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
342
348
|
qualified: 'client.cart.item.update',
|
|
343
349
|
params: [
|
|
344
350
|
'cartId: string;',
|
|
345
|
-
'item: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; };',
|
|
351
|
+
'item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; };',
|
|
346
352
|
],
|
|
347
353
|
response:
|
|
348
354
|
'{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
349
355
|
markdown:
|
|
350
|
-
"## update\n\n`client.cart.item.update(cartId: string, item: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }): { data: object; message: string; status: string; success: boolean; }`\n\n**put** `/cart/{cartId}/item`\n\nUpdate an item in an existing cart.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `item: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }`\n Item to update (can be object or stringified JSON)\n - `link: string`\n Direct product URL\n - `coupons?: string[]`\n List of coupon codes applied to this cart item\n - `metadata?: object`\n Misc metadata associated with this cart item\n - `quantity?: number`\n Quantity of this item\n - `selectedOptions?: string[]`\n An ordered array of option values to select for the product. Will be selected in the order listed.\n - `selectedShipping?: { id?: string; value?: string; }`\n Shipping option selected for this cart item\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst item = await client.cart.item.update('crt_sa2aEsCz9PRM', { item: { link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' } });\n\nconsole.log(item);\n```",
|
|
356
|
+
"## update\n\n`client.cart.item.update(cartId: string, item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }): { data: object; message: string; status: string; success: boolean; }`\n\n**put** `/cart/{cartId}/item`\n\nUpdate an item in an existing cart.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `item: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }`\n Item to update (can be object or stringified JSON)\n - `link: string`\n Direct product URL\n - `affiliateProductLink?: string`\n Optional affiliate or redirect URL used for fulfillment. If omitted, link is used.\n - `coupons?: string[]`\n List of coupon codes applied to this cart item\n - `metadata?: object`\n Misc metadata associated with this cart item\n - `quantity?: number`\n Quantity of this item\n - `selectedOptions?: string[]`\n An ordered array of option values to select for the product. Will be selected in the order listed.\n - `selectedShipping?: { id?: string; value?: string; }`\n Shipping option selected for this cart item\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst item = await client.cart.item.update('crt_sa2aEsCz9PRM', { item: { link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' } });\n\nconsole.log(item);\n```",
|
|
351
357
|
perLanguage: {
|
|
352
|
-
|
|
358
|
+
typescript: {
|
|
359
|
+
method: 'client.cart.item.update',
|
|
353
360
|
example:
|
|
354
|
-
'
|
|
361
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst item = await client.cart.item.update('crt_sa2aEsCz9PRM', {\n item: {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n affiliateProductLink:\n 'https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205',\n quantity: 1,\n selectedOptions: ['regular', 'black', '10-w'],\n metadata: { creatorSource: 'Frank Herbert' },\n },\n});\n\nconsole.log(item.data);",
|
|
355
362
|
},
|
|
356
363
|
python: {
|
|
357
364
|
method: 'cart.item.update',
|
|
358
365
|
example:
|
|
359
|
-
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nitem = client.cart.item.update(\n cart_id="crt_sa2aEsCz9PRM",\n item={\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "quantity": 1,\n "selected_options": ["regular", "black", "10-w"],\n "metadata": {\n "creatorSource": "Frank Herbert"\n },\n },\n)\nprint(item.data)',
|
|
366
|
+
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nitem = client.cart.item.update(\n cart_id="crt_sa2aEsCz9PRM",\n item={\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliate_product_link": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "quantity": 1,\n "selected_options": ["regular", "black", "10-w"],\n "metadata": {\n "creatorSource": "Frank Herbert"\n },\n },\n)\nprint(item.data)',
|
|
360
367
|
},
|
|
361
|
-
|
|
362
|
-
method: 'client.cart.item.update',
|
|
368
|
+
http: {
|
|
363
369
|
example:
|
|
364
|
-
|
|
370
|
+
'curl https://api.henrylabs.ai/v1/cart/$CART_ID/item \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "item": {\n "link": "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n "affiliateProductLink": "https://partner.example.com/click?url=https%3A%2F%2Fwww.nike.com%2Fu%2Fcustom-nike-ja-3-by-you-10002205",\n "metadata": {\n "creatorSource": "bar"\n },\n "quantity": 1,\n "selectedOptions": [\n "regular",\n "black",\n "10-w"\n ]\n }\n }\'',
|
|
365
371
|
},
|
|
366
372
|
},
|
|
367
373
|
},
|
|
@@ -377,21 +383,21 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
377
383
|
response:
|
|
378
384
|
'{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }',
|
|
379
385
|
markdown:
|
|
380
|
-
"## remove\n\n`client.cart.item.remove(cartId: string, link: string): { data: object; message: string; status: string; success: boolean; }`\n\n**delete** `/cart/{cartId}/item`\n\nRemove an item from a cart by its unique identifier\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `link: string`\n Direct product URL\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst item = await client.cart.item.remove('crt_sa2aEsCz9PRM', { link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' });\n\nconsole.log(item);\n```",
|
|
386
|
+
"## remove\n\n`client.cart.item.remove(cartId: string, link: string): { data: object; message: string; status: string; success: boolean; }`\n\n**delete** `/cart/{cartId}/item`\n\nRemove an item from a cart by its unique identifier\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `link: string`\n Direct product URL\n\n### Returns\n\n- `{ data: { cartId: string; checkoutUrl: string; data: { items: object[]; settings?: object; tags?: object; }; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { cartId: string; checkoutUrl: string; data: { items: { link: string; affiliateProductLink?: string; coupons?: string[]; metadata?: object; quantity?: number; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; settings?: { commissionFeeFixed?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; commissionFeePercent?: number; events?: { data: object | object | object | object | object | object | object | object[]; type: string; conditional?: object | object; }[]; options?: { allowPartialPurchase?: boolean; collectBuyerAddress?: 'off' | 'required' | 'optional'; collectBuyerEmail?: 'off' | 'required' | 'optional'; collectBuyerPhone?: 'off' | 'required' | 'optional'; }; }; tags?: object; }; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst item = await client.cart.item.remove('crt_sa2aEsCz9PRM', { link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205' });\n\nconsole.log(item);\n```",
|
|
381
387
|
perLanguage: {
|
|
382
|
-
|
|
388
|
+
typescript: {
|
|
389
|
+
method: 'client.cart.item.remove',
|
|
383
390
|
example:
|
|
384
|
-
'
|
|
391
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst item = await client.cart.item.remove('crt_sa2aEsCz9PRM', {\n link: 'https://www.nike.com/u/custom-nike-ja-3-by-you-10002205',\n});\n\nconsole.log(item.data);",
|
|
385
392
|
},
|
|
386
393
|
python: {
|
|
387
394
|
method: 'cart.item.remove',
|
|
388
395
|
example:
|
|
389
396
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nitem = client.cart.item.remove(\n cart_id="crt_sa2aEsCz9PRM",\n link="https://www.nike.com/u/custom-nike-ja-3-by-you-10002205",\n)\nprint(item.data)',
|
|
390
397
|
},
|
|
391
|
-
|
|
392
|
-
method: 'client.cart.item.remove',
|
|
398
|
+
http: {
|
|
393
399
|
example:
|
|
394
|
-
|
|
400
|
+
'curl https://api.henrylabs.ai/v1/cart/$CART_ID/item \\\n -X DELETE \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
395
401
|
},
|
|
396
402
|
},
|
|
397
403
|
},
|
|
@@ -410,25 +416,26 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
410
416
|
'coupons?: string[];',
|
|
411
417
|
'metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; };',
|
|
412
418
|
"mode?: 'async' | 'sync';",
|
|
419
|
+
'overrideProducts?: object;',
|
|
413
420
|
],
|
|
414
421
|
response:
|
|
415
422
|
"{ data: { jobs: { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }[]; metadata?: object; }; message: string; status: string; success: boolean; }",
|
|
416
423
|
markdown:
|
|
417
|
-
"## details\n\n`client.cart.checkout.details(cartId: string, buyer: { shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }, coupons?: string[], metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }, mode?: 'async' | 'sync'): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart/{cartId}/details`\n\nRetrieve detailed information about a cart. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `buyer: { shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n - `shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }`\n Shipping address for the cart\n\n- `coupons?: string[]`\n List of coupon codes applied to the cart\n\n- `metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }`\n Additional metadata for the request\n - `botAuth?: { forterToken?: string; }`\n Bot authentication credentials\n - `userData?: { ipAddress?: string; userAgent?: string; }`\n User identity and device information\n\n- `mode?: 'async' | 'sync'`\n Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.\n\n### Returns\n\n- `{ data: { jobs: { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }[]; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { jobs: { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; }; }[]; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.details('crt_sa2aEsCz9PRM', { buyer: { shippingAddress: {\n city: 'Anytown',\n countryCode: 'US',\n line1: '123 Main St',\n postalCode: '12345',\n province: 'CA',\n} } });\n\nconsole.log(response);\n```",
|
|
424
|
+
"## details\n\n`client.cart.checkout.details(cartId: string, buyer: { shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }, coupons?: string[], metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }, mode?: 'async' | 'sync', overrideProducts?: object): { data: object; message: string; status: string; success: boolean; }`\n\n**post** `/cart/{cartId}/details`\n\nRetrieve detailed information about a cart. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `buyer: { shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n - `shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }`\n Shipping address for the cart\n\n- `coupons?: string[]`\n List of coupon codes applied to the cart\n\n- `metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }`\n Additional metadata for the request\n - `botAuth?: { forterToken?: string; }`\n Bot authentication credentials\n - `userData?: { ipAddress?: string; userAgent?: string; }`\n User identity and device information\n\n- `mode?: 'async' | 'sync'`\n Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.\n\n- `overrideProducts?: object`\n Per-product overrides keyed by product URL. Items with quantity null or 0 are excluded.\n\n### Returns\n\n- `{ data: { jobs: { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }[]; metadata?: object; }; message: string; status: string; success: boolean; }`\n\n - `data: { jobs: { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; data?: { costs: object; shippingOptions: object[]; coupons?: object[]; }; }; }[]; metadata?: object; }`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.details('crt_sa2aEsCz9PRM', { buyer: { shippingAddress: {\n city: 'Anytown',\n countryCode: 'US',\n line1: '123 Main St',\n postalCode: '12345',\n province: 'CA',\n} } });\n\nconsole.log(response);\n```",
|
|
418
425
|
perLanguage: {
|
|
419
|
-
|
|
426
|
+
typescript: {
|
|
427
|
+
method: 'client.cart.checkout.details',
|
|
420
428
|
example:
|
|
421
|
-
'
|
|
429
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.details('crt_sa2aEsCz9PRM', {\n buyer: {\n shippingAddress: {\n line1: '123 Main St',\n line2: 'Apt 4B',\n city: 'Anytown',\n province: 'CA',\n postalCode: '12345',\n countryCode: 'US',\n },\n },\n coupons: ['SUMMER21', 'FREESHIP'],\n mode: 'async',\n});\n\nconsole.log(response.data);",
|
|
422
430
|
},
|
|
423
431
|
python: {
|
|
424
432
|
method: 'cart.checkout.details',
|
|
425
433
|
example:
|
|
426
434
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.checkout.details(\n cart_id="crt_sa2aEsCz9PRM",\n buyer={\n "shipping_address": {\n "line1": "123 Main St",\n "line2": "Apt 4B",\n "city": "Anytown",\n "province": "CA",\n "postal_code": "12345",\n "country_code": "US",\n }\n },\n coupons=["SUMMER21", "FREESHIP"],\n mode="async",\n)\nprint(response.data)',
|
|
427
435
|
},
|
|
428
|
-
|
|
429
|
-
method: 'client.cart.checkout.details',
|
|
436
|
+
http: {
|
|
430
437
|
example:
|
|
431
|
-
|
|
438
|
+
'curl https://api.henrylabs.ai/v1/cart/$CART_ID/details \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "buyer": {\n "shippingAddress": {\n "city": "Anytown",\n "countryCode": "US",\n "line1": "123 Main St",\n "postalCode": "12345",\n "province": "CA",\n "line2": "Apt 4B"\n }\n },\n "coupons": [\n "SUMMER21",\n "FREESHIP"\n ],\n "mode": "async",\n "overrideProducts": {\n "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205": {\n "quantity": 2\n }\n }\n }\'',
|
|
432
439
|
},
|
|
433
440
|
},
|
|
434
441
|
},
|
|
@@ -442,23 +449,23 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
442
449
|
qualified: 'client.cart.checkout.pollDetails',
|
|
443
450
|
params: ['refId: string;'],
|
|
444
451
|
response:
|
|
445
|
-
"{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; }; }",
|
|
452
|
+
"{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; data?: { costs: object; shippingOptions: object[]; coupons?: object[]; }; }; }",
|
|
446
453
|
markdown:
|
|
447
|
-
"## poll_details\n\n`client.cart.checkout.pollDetails(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/cart/checkout/status`\n\nCheck the status of a cart details retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { items: { costs: { subtotal: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; total: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; discount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; shipping?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; tax?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; }; shippingOptions: { id: string; cost: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }[]; coupons?: { available: boolean; code: string; savedAmount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; }[]; }[]; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.pollDetails({ refId: 'ckd-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
454
|
+
"## poll_details\n\n`client.cart.checkout.pollDetails(refId: string): { refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: object; }`\n\n**get** `/cart/checkout/status`\n\nCheck the status of a cart details retrieval job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ refId: string; status: 'pending' | 'processing' | 'complete' | 'failed'; error?: object; result?: { items: { costs: object; shippingOptions: object[]; coupons?: object[]; }[]; data?: { costs: object; shippingOptions: object[]; coupons?: object[]; }; }; }`\n\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'failed'`\n - `error?: object`\n - `result?: { items: { costs: { subtotal: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; total: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; discount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; shipping?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; tax?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; }; shippingOptions: { id: string; cost: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }[]; coupons?: { available: boolean; code: string; savedAmount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; }[]; }[]; data?: { costs: { subtotal: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; total: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; discount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; shipping?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; tax?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; }; shippingOptions: { id: string; cost: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }[]; coupons?: { available: boolean; code: string; savedAmount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; }[]; }; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.pollDetails({ refId: 'ckd-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
448
455
|
perLanguage: {
|
|
449
|
-
|
|
456
|
+
typescript: {
|
|
457
|
+
method: 'client.cart.checkout.pollDetails',
|
|
450
458
|
example:
|
|
451
|
-
'
|
|
459
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.pollDetails({\n refId: 'ckd-ref_3fa85f64-5717-4562-b3fc',\n});\n\nconsole.log(response.refId);",
|
|
452
460
|
},
|
|
453
461
|
python: {
|
|
454
462
|
method: 'cart.checkout.poll_details',
|
|
455
463
|
example:
|
|
456
464
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.checkout.poll_details(\n ref_id="ckd-ref_3fa85f64-5717-4562-b3fc",\n)\nprint(response.ref_id)',
|
|
457
465
|
},
|
|
458
|
-
|
|
459
|
-
method: 'client.cart.checkout.pollDetails',
|
|
466
|
+
http: {
|
|
460
467
|
example:
|
|
461
|
-
|
|
468
|
+
'curl https://api.henrylabs.ai/v1/cart/checkout/status \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
462
469
|
},
|
|
463
470
|
},
|
|
464
471
|
},
|
|
@@ -480,23 +487,23 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
480
487
|
'settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; };',
|
|
481
488
|
],
|
|
482
489
|
response:
|
|
483
|
-
"{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }",
|
|
490
|
+
"{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; quantity: number; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }",
|
|
484
491
|
markdown:
|
|
485
|
-
"## purchase\n\n`client.cart.checkout.purchase(cartId: string, buyer: { card: { details: object; billingAddress?: object; nameOnCard?: object; }; email: string; name: { firstName: string; lastName: string; middleName?: string; }; shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; phone?: string; }, metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }, mode?: 'async' | 'sync', overrideProducts?: object, settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }): { details: object; products: object[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: object; }`\n\n**post** `/cart/{cartId}/purchase`\n\nInitiate the purchase process for a cart. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `buyer: { card: { details: { cardToken: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; nameOnCard?: { firstName: string; lastName: string; middleName?: string; }; }; email: string; name: { firstName: string; lastName: string; middleName?: string; }; shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; phone?: string; }`\n - `card: { details: { cardToken: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; nameOnCard?: { firstName: string; lastName: string; middleName?: string; }; }`\n - `email: string`\n Buyer's email address\n - `name: { firstName: string; lastName: string; middleName?: string; }`\n Buyer's full name\n - `shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }`\n Shipping address for the cart\n - `phone?: string`\n Buyer's phone number\n\n- `metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }`\n Additional metadata for the request\n - `botAuth?: { forterToken?: string; }`\n Bot authentication credentials\n - `userData?: { ipAddress?: string; userAgent?: string; }`\n User identity and device information\n\n- `mode?: 'async' | 'sync'`\n Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.\n\n- `overrideProducts?: object`\n
|
|
492
|
+
"## purchase\n\n`client.cart.checkout.purchase(cartId: string, buyer: { card: { details: object; billingAddress?: object; nameOnCard?: object; }; email: string; name: { firstName: string; lastName: string; middleName?: string; }; shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; phone?: string; }, metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }, mode?: 'async' | 'sync', overrideProducts?: object, settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }): { details: object; products: object[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: object; }`\n\n**post** `/cart/{cartId}/purchase`\n\nInitiate the purchase process for a cart. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.\n\n### Parameters\n\n- `cartId: string`\n Unique identifier for the cart\n\n- `buyer: { card: { details: { cardToken: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; nameOnCard?: { firstName: string; lastName: string; middleName?: string; }; }; email: string; name: { firstName: string; lastName: string; middleName?: string; }; shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; phone?: string; }`\n - `card: { details: { cardToken: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; nameOnCard?: { firstName: string; lastName: string; middleName?: string; }; }`\n - `email: string`\n Buyer's email address\n - `name: { firstName: string; lastName: string; middleName?: string; }`\n Buyer's full name\n - `shippingAddress: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }`\n Shipping address for the cart\n - `phone?: string`\n Buyer's phone number\n\n- `metadata?: { botAuth?: { forterToken?: string; }; userData?: { ipAddress?: string; userAgent?: string; }; }`\n Additional metadata for the request\n - `botAuth?: { forterToken?: string; }`\n Bot authentication credentials\n - `userData?: { ipAddress?: string; userAgent?: string; }`\n User identity and device information\n\n- `mode?: 'async' | 'sync'`\n Response mode. Use sync to wait up to 30 seconds for the backing worker flow to complete.\n\n- `overrideProducts?: object`\n Per-product overrides keyed by product URL. Items with quantity null or 0 are excluded.\n\n- `settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }`\n Settings for what information to collect\n - `collectAddress?: boolean`\n Whether to collect the buyer's shipping address\n - `collectEmail?: boolean`\n Whether to collect the buyer's email address\n - `collectPhone?: boolean`\n Whether to collect the buyer's phone number\n\n### Returns\n\n- `{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; quantity: number; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }`\n\n - `details: { card: { details: object; nameOnCard: { firstName: string; lastName: string; middleName?: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n - `products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]`\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'cancelled'`\n - `error?: object`\n - `result?: { costs: { commissionFee: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; subtotal: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; total: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; }; items: { confirmationNumber: string; costs: { total: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; discount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; shipping?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; subtotal?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; tax?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; }; productLink: string; quantity: number; appliedCoupon?: { code: string; savedAmount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; }; metadata?: object; shipping?: { id: string; cost: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }; }[]; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.purchase('crt_sa2aEsCz9PRM', { buyer: {\n card: { details: { cardToken: 'card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof' } },\n email: 'johnadoe@example.com',\n name: { firstName: 'John', lastName: 'Doe' },\n shippingAddress: {\n city: 'Anytown',\n countryCode: 'US',\n line1: '123 Main St',\n postalCode: '12345',\n province: 'CA',\n},\n} });\n\nconsole.log(response);\n```",
|
|
486
493
|
perLanguage: {
|
|
487
|
-
|
|
494
|
+
typescript: {
|
|
495
|
+
method: 'client.cart.checkout.purchase',
|
|
488
496
|
example:
|
|
489
|
-
'
|
|
497
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.purchase('crt_sa2aEsCz9PRM', {\n buyer: {\n name: {\n firstName: 'John',\n middleName: 'A.',\n lastName: 'Doe',\n },\n email: 'johnadoe@example.com',\n phone: '+1234567890',\n shippingAddress: {\n line1: '123 Main St',\n line2: 'Apt 4B',\n city: 'Anytown',\n province: 'CA',\n postalCode: '12345',\n countryCode: 'US',\n },\n card: {\n nameOnCard: {\n firstName: 'John',\n middleName: 'A.',\n lastName: 'Doe',\n },\n details: { cardToken: 'card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof' },\n billingAddress: {\n line1: '123 Main St',\n line2: 'Apt 4B',\n city: 'Anytown',\n province: 'CA',\n postalCode: '12345',\n countryCode: 'US',\n },\n },\n },\n mode: 'async',\n});\n\nconsole.log(response.details);",
|
|
490
498
|
},
|
|
491
499
|
python: {
|
|
492
500
|
method: 'cart.checkout.purchase',
|
|
493
501
|
example:
|
|
494
502
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.checkout.purchase(\n cart_id="crt_sa2aEsCz9PRM",\n buyer={\n "name": {\n "first_name": "John",\n "middle_name": "A.",\n "last_name": "Doe",\n },\n "email": "johnadoe@example.com",\n "phone": "+1234567890",\n "shipping_address": {\n "line1": "123 Main St",\n "line2": "Apt 4B",\n "city": "Anytown",\n "province": "CA",\n "postal_code": "12345",\n "country_code": "US",\n },\n "card": {\n "name_on_card": {\n "first_name": "John",\n "middle_name": "A.",\n "last_name": "Doe",\n },\n "details": {\n "card_token": "card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof"\n },\n "billing_address": {\n "line1": "123 Main St",\n "line2": "Apt 4B",\n "city": "Anytown",\n "province": "CA",\n "postal_code": "12345",\n "country_code": "US",\n },\n },\n },\n mode="async",\n)\nprint(response.details)',
|
|
495
503
|
},
|
|
496
|
-
|
|
497
|
-
method: 'client.cart.checkout.purchase',
|
|
504
|
+
http: {
|
|
498
505
|
example:
|
|
499
|
-
|
|
506
|
+
'curl https://api.henrylabs.ai/v1/cart/$CART_ID/purchase \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $HENRY_SDK_API_KEY" \\\n -d \'{\n "buyer": {\n "card": {\n "details": {\n "cardToken": "card_live_SimDpKU9cmU7tvdUXHzOeLudtgfadQVnbof"\n },\n "billingAddress": {\n "city": "Anytown",\n "countryCode": "US",\n "line1": "123 Main St",\n "postalCode": "12345",\n "province": "CA",\n "line2": "Apt 4B"\n },\n "nameOnCard": {\n "firstName": "John",\n "lastName": "Doe",\n "middleName": "A."\n }\n },\n "email": "johnadoe@example.com",\n "name": {\n "firstName": "John",\n "lastName": "Doe",\n "middleName": "A."\n },\n "shippingAddress": {\n "city": "Anytown",\n "countryCode": "US",\n "line1": "123 Main St",\n "postalCode": "12345",\n "province": "CA",\n "line2": "Apt 4B"\n },\n "phone": "+1234567890"\n },\n "mode": "async",\n "overrideProducts": {\n "https://www.nike.com/u/custom-nike-ja-3-by-you-10002205": {\n "quantity": 2\n }\n }\n }\'',
|
|
500
507
|
},
|
|
501
508
|
},
|
|
502
509
|
},
|
|
@@ -510,23 +517,23 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
510
517
|
qualified: 'client.cart.checkout.pollPurchase',
|
|
511
518
|
params: ['refId: string;'],
|
|
512
519
|
response:
|
|
513
|
-
"{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }",
|
|
520
|
+
"{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; quantity: number; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }",
|
|
514
521
|
markdown:
|
|
515
|
-
"## poll_purchase\n\n`client.cart.checkout.pollPurchase(refId: string): { details: object; products: object[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: object; }`\n\n**get** `/cart/purchase/status`\n\nCheck the status of a cart purchase job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }`\n\n - `details: { card: { details: object; nameOnCard: { firstName: string; lastName: string; middleName?: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n - `products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]`\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'cancelled'`\n - `error?: object`\n - `result?: { costs: { commissionFee: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; subtotal: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; total: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; }; items: { confirmationNumber: string; costs: { total: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; discount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; shipping?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; subtotal?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; tax?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; }; productLink: string; appliedCoupon?: { code: string; savedAmount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; }; metadata?: object; shipping?: { id: string; cost: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }; }[]; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.pollPurchase({ refId: 'ckp-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
522
|
+
"## poll_purchase\n\n`client.cart.checkout.pollPurchase(refId: string): { details: object; products: object[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: object; }`\n\n**get** `/cart/purchase/status`\n\nCheck the status of a cart purchase job and get results when ready.\n\n### Parameters\n\n- `refId: string`\n Reference ID used for checking status\n\n### Returns\n\n- `{ details: { card: { details: object; nameOnCard: object; billingAddress?: object; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: object; subtotal: object; total: object; }; items: { confirmationNumber: string; costs: object; productLink: string; quantity: number; appliedCoupon?: object; metadata?: object; shipping?: object; }[]; }; }`\n\n - `details: { card: { details: object; nameOnCard: { firstName: string; lastName: string; middleName?: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }`\n - `products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]`\n - `refId: string`\n - `status: 'pending' | 'processing' | 'complete' | 'cancelled'`\n - `error?: object`\n - `result?: { costs: { commissionFee: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; subtotal: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; total: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; }; items: { confirmationNumber: string; costs: { total: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; discount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; shipping?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; subtotal?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; tax?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; }; productLink: string; quantity: number; appliedCoupon?: { code: string; savedAmount?: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; }; metadata?: object; shipping?: { id: string; cost: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }; }[]; }`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst response = await client.cart.checkout.pollPurchase({ refId: 'ckp-ref_3fa85f64-5717-4562-b3fc' });\n\nconsole.log(response);\n```",
|
|
516
523
|
perLanguage: {
|
|
517
|
-
|
|
524
|
+
typescript: {
|
|
525
|
+
method: 'client.cart.checkout.pollPurchase',
|
|
518
526
|
example:
|
|
519
|
-
'
|
|
527
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cart.checkout.pollPurchase({\n refId: 'ckp-ref_3fa85f64-5717-4562-b3fc',\n});\n\nconsole.log(response.details);",
|
|
520
528
|
},
|
|
521
529
|
python: {
|
|
522
530
|
method: 'cart.checkout.poll_purchase',
|
|
523
531
|
example:
|
|
524
532
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cart.checkout.poll_purchase(\n ref_id="ckp-ref_3fa85f64-5717-4562-b3fc",\n)\nprint(response.details)',
|
|
525
533
|
},
|
|
526
|
-
|
|
527
|
-
method: 'client.cart.checkout.pollPurchase',
|
|
534
|
+
http: {
|
|
528
535
|
example:
|
|
529
|
-
|
|
536
|
+
'curl https://api.henrylabs.ai/v1/cart/purchase/status \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
530
537
|
},
|
|
531
538
|
},
|
|
532
539
|
},
|
|
@@ -545,22 +552,22 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
545
552
|
"status?: 'pending' | 'processing' | 'complete' | 'cancelled';",
|
|
546
553
|
],
|
|
547
554
|
response:
|
|
548
|
-
"{ data: { details: { card: object; hasAccount: boolean; name: object; email?: string; phone?: object; settings?: object; shippingAddress?: object; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; selectedOptions?: string[]; selectedShipping?: object; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: object; items: object[]; }; }[]; message: string; status: string; success: boolean; }",
|
|
555
|
+
"{ data: { details: { card: object; hasAccount: boolean; name: object; email?: string; phone?: object; settings?: object; shippingAddress?: object; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: object; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: object; items: object[]; }; }[]; message: string; status: string; success: boolean; }",
|
|
549
556
|
markdown:
|
|
550
|
-
"## list\n\n`client.orders.list(cartId?: string, cursor?: string, limit?: number, status?: 'pending' | 'processing' | 'complete' | 'cancelled'): { data: object[]; message: string; status: string; success: boolean; }`\n\n**get** `/orders`\n\nFetch a list of orders with optional filtering and pagination.\n\n### Parameters\n\n- `cartId?: string`\n Filter orders by cart ID\n\n- `cursor?: string`\n Cursor returned from the previous response\n\n- `limit?: number`\n Limit the number of results\n\n- `status?: 'pending' | 'processing' | 'complete' | 'cancelled'`\n Filter orders by status\n\n### Returns\n\n- `{ data: { details: { card: object; hasAccount: boolean; name: object; email?: string; phone?: object; settings?: object; shippingAddress?: object; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; selectedOptions?: string[]; selectedShipping?: object; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: object; items: object[]; }; }[]; message: string; status: string; success: boolean; }`\n\n - `data: { details: { card: { details: object; nameOnCard: { firstName: string; lastName: string; middleName?: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; subtotal: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; total: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR'; value: number; }; }; items: { confirmationNumber: string; costs: { total: object; discount?: object; shipping?: object; subtotal?: object; tax?: object; }; productLink: string; appliedCoupon?: { code: string; savedAmount?: object; }; metadata?: object; shipping?: { id: string; cost: object; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }; }[]; }; }[]`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst orders = await client.orders.list();\n\nconsole.log(orders);\n```",
|
|
557
|
+
"## list\n\n`client.orders.list(cartId?: string, cursor?: string, limit?: number, status?: 'pending' | 'processing' | 'complete' | 'cancelled'): { data: object[]; message: string; status: string; success: boolean; }`\n\n**get** `/orders`\n\nFetch a list of orders with optional filtering and pagination.\n\n### Parameters\n\n- `cartId?: string`\n Filter orders by cart ID\n\n- `cursor?: string`\n Cursor returned from the previous response\n\n- `limit?: number`\n Limit the number of results\n\n- `status?: 'pending' | 'processing' | 'complete' | 'cancelled'`\n Filter orders by status\n\n### Returns\n\n- `{ data: { details: { card: object; hasAccount: boolean; name: object; email?: string; phone?: object; settings?: object; shippingAddress?: object; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: object; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: object; items: object[]; }; }[]; message: string; status: string; success: boolean; }`\n\n - `data: { details: { card: { details: object; nameOnCard: { firstName: string; lastName: string; middleName?: string; }; billingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: object; phone?: object; }; }; hasAccount: boolean; name: { firstName: string; lastName: string; middleName?: string; }; email?: string; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; settings?: { collectAddress?: boolean; collectEmail?: boolean; collectPhone?: boolean; }; shippingAddress?: { city: string; countryCode: string; line1: string; postalCode: string; province: string; email?: string; line2?: string; name?: { firstName: string; lastName: string; middleName?: string; }; phone?: { countryCode: string; e164: string; nationalNumber: string; country?: string; }; }; }; products: { host: string; link: string; merchant: string; quantity: number; status: 'pending' | 'processing' | 'complete' | 'failed'; affiliateProductLink?: string; selectedOptions?: string[]; selectedShipping?: { id?: string; value?: string; }; }[]; refId: string; status: 'pending' | 'processing' | 'complete' | 'cancelled'; error?: object; result?: { costs: { commissionFee: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; subtotal: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; total: { currency: 'USD' | 'EUR' | 'AUD' | 'SGD' | 'TWD' | 'GBP' | 'CAD' | 'MXN' | 'NPR' | 'INR'; value: number; }; }; items: { confirmationNumber: string; costs: { total: object; discount?: object; shipping?: object; subtotal?: object; tax?: object; }; productLink: string; quantity: number; appliedCoupon?: { code: string; savedAmount?: object; }; metadata?: object; shipping?: { id: string; cost: object; name: string; maxDate?: string; minDate?: string; timeEstimate?: string; }; }[]; }; }[]`\n - `message: string`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst orders = await client.orders.list();\n\nconsole.log(orders);\n```",
|
|
551
558
|
perLanguage: {
|
|
552
|
-
|
|
553
|
-
|
|
559
|
+
typescript: {
|
|
560
|
+
method: 'client.orders.list',
|
|
561
|
+
example:
|
|
562
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst orders = await client.orders.list();\n\nconsole.log(orders.data);",
|
|
554
563
|
},
|
|
555
564
|
python: {
|
|
556
565
|
method: 'orders.list',
|
|
557
566
|
example:
|
|
558
567
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\norders = client.orders.list()\nprint(orders.data)',
|
|
559
568
|
},
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
example:
|
|
563
|
-
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst orders = await client.orders.list();\n\nconsole.log(orders.data);",
|
|
569
|
+
http: {
|
|
570
|
+
example: 'curl https://api.henrylabs.ai/v1/orders \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
564
571
|
},
|
|
565
572
|
},
|
|
566
573
|
},
|
|
@@ -569,33 +576,35 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
569
576
|
endpoint: '/merchants',
|
|
570
577
|
httpMethod: 'get',
|
|
571
578
|
summary: 'Merchants List',
|
|
572
|
-
description:
|
|
579
|
+
description:
|
|
580
|
+
'Fetch a paginated list of merchants with their lifetime success rates (checkout, checkoutDetails, productDetails, productSearch), coverage status, and checkout latency. Rates are computed over real traffic only; a rate is null (N/A) when there are no attempts yet.',
|
|
573
581
|
stainlessPath: '(resource) merchants > (method) list',
|
|
574
582
|
qualified: 'client.merchants.list',
|
|
575
583
|
params: [
|
|
576
584
|
'categories?: string[];',
|
|
585
|
+
"coverageStatus?: 'supported' | 'testing' | 'unsupported';",
|
|
577
586
|
'cursor?: string;',
|
|
578
587
|
'host?: string;',
|
|
579
588
|
'limit?: number;',
|
|
580
589
|
'name?: string;',
|
|
581
590
|
],
|
|
582
591
|
response:
|
|
583
|
-
|
|
592
|
+
"{ data: { categories: string[]; coverageStatus: 'supported' | 'testing' | 'unsupported'; description: string; host: string; latencyMs: { checkout: object; checkoutDetails: object; productDetails: object; productSearch: object; }; logo: { urls: object[]; }; name: string; rates: { checkout: object; checkoutDetails: object; productDetails: object; productSearch: object; }; website: { urls: object[]; }; }[]; message: string; pagination: { nextCursor: string; }; status: string; success: boolean; }",
|
|
584
593
|
markdown:
|
|
585
|
-
"## list\n\n`client.merchants.list(categories?: string[], cursor?: string, host?: string, limit?: number, name?: string): { data: object[]; message: string; status: string; success: boolean; }`\n\n**get** `/merchants`\n\nFetch a list of merchants with
|
|
594
|
+
"## list\n\n`client.merchants.list(categories?: string[], coverageStatus?: 'supported' | 'testing' | 'unsupported', cursor?: string, host?: string, limit?: number, name?: string): { data: object[]; message: string; pagination: object; status: string; success: boolean; }`\n\n**get** `/merchants`\n\nFetch a paginated list of merchants with their lifetime success rates (checkout, checkoutDetails, productDetails, productSearch), coverage status, and checkout latency. Rates are computed over real traffic only; a rate is null (N/A) when there are no attempts yet.\n\n### Parameters\n\n- `categories?: string[]`\n\n- `coverageStatus?: 'supported' | 'testing' | 'unsupported'`\n Filter merchants by coverage status (supported, testing, or unsupported).\n\n- `cursor?: string`\n Opaque cursor returned from the previous response; pass back to fetch the next page.\n\n- `host?: string`\n Filter merchants by host\n\n- `limit?: number`\n Limit the number of results\n\n- `name?: string`\n Filter merchants by name (partial match)\n\n### Returns\n\n- `{ data: { categories: string[]; coverageStatus: 'supported' | 'testing' | 'unsupported'; description: string; host: string; latencyMs: { checkout: object; checkoutDetails: object; productDetails: object; productSearch: object; }; logo: { urls: object[]; }; name: string; rates: { checkout: object; checkoutDetails: object; productDetails: object; productSearch: object; }; website: { urls: object[]; }; }[]; message: string; pagination: { nextCursor: string; }; status: string; success: boolean; }`\n\n - `data: { categories: string[]; coverageStatus: 'supported' | 'testing' | 'unsupported'; description: string; host: string; latencyMs: { checkout: { p50: number; p95: number; }; checkoutDetails: { p50: number; p95: number; }; productDetails: { p50: number; p95: number; }; productSearch: { p50: number; p95: number; }; }; logo: { urls: { value: string; }[]; }; name: string; rates: { checkout: { attempted: number; rate: number; succeeded: number; }; checkoutDetails: { attempted: number; rate: number; succeeded: number; }; productDetails: { attempted: number; rate: number; succeeded: number; }; productSearch: { attempted: number; rate: number; succeeded: number; }; }; website: { urls: { value: string; type?: 'landing' | 'checkout'; }[]; }; }[]`\n - `message: string`\n - `pagination: { nextCursor: string; }`\n - `status: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK();\n\nconst merchants = await client.merchants.list();\n\nconsole.log(merchants);\n```",
|
|
586
595
|
perLanguage: {
|
|
587
|
-
|
|
588
|
-
|
|
596
|
+
typescript: {
|
|
597
|
+
method: 'client.merchants.list',
|
|
598
|
+
example:
|
|
599
|
+
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst merchants = await client.merchants.list();\n\nconsole.log(merchants.data);",
|
|
589
600
|
},
|
|
590
601
|
python: {
|
|
591
602
|
method: 'merchants.list',
|
|
592
603
|
example:
|
|
593
604
|
'import os\nfrom henry_sdk import HenrySDK\n\nclient = HenrySDK(\n api_key=os.environ.get("HENRY_SDK_API_KEY"), # This is the default and can be omitted\n)\nmerchants = client.merchants.list()\nprint(merchants.data)',
|
|
594
605
|
},
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
example:
|
|
598
|
-
"import HenrySDK from '@henrylabs/sdk';\n\nconst client = new HenrySDK({\n apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted\n});\n\nconst merchants = await client.merchants.list();\n\nconsole.log(merchants.data);",
|
|
606
|
+
http: {
|
|
607
|
+
example: 'curl https://api.henrylabs.ai/v1/merchants \\\n -H "x-api-key: $HENRY_SDK_API_KEY"',
|
|
599
608
|
},
|
|
600
609
|
},
|
|
601
610
|
},
|