Add Product
curl --request POST \
--url https://api.your-domain.com/example/zaymo/upsells/add-product \
--header 'Content-Type: application/json' \
--header 'X-Zaymo-API-Key: <api-key>' \
--data '
{
"email": "jsmith@example.com",
"product_id": "<string>"
}
'import requests
url = "https://api.your-domain.com/example/zaymo/upsells/add-product"
payload = {
"email": "jsmith@example.com",
"product_id": "<string>"
}
headers = {
"X-Zaymo-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Zaymo-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'jsmith@example.com', product_id: '<string>'})
};
fetch('https://api.your-domain.com/example/zaymo/upsells/add-product', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Upsells
Add Product
Add a product to a customer’s order directly from email. This endpoint processes a customer’s product selection from the email upsell widget.
POST
/
zaymo
/
upsells
/
add-product
Add Product
curl --request POST \
--url https://api.your-domain.com/example/zaymo/upsells/add-product \
--header 'Content-Type: application/json' \
--header 'X-Zaymo-API-Key: <api-key>' \
--data '
{
"email": "jsmith@example.com",
"product_id": "<string>"
}
'import requests
url = "https://api.your-domain.com/example/zaymo/upsells/add-product"
payload = {
"email": "jsmith@example.com",
"product_id": "<string>"
}
headers = {
"X-Zaymo-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Zaymo-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'jsmith@example.com', product_id: '<string>'})
};
fetch('https://api.your-domain.com/example/zaymo/upsells/add-product', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Zaymo will authenticate requests using the API key you provide
Body
application/json
Product and customer information for adding to order
The email address of the customer
The unique identifier for the selected product (from the get products endpoint)
The quantity of the product to add to the order
Required range:
x >= 1Optional discount code to apply to the product/subscription.
If true, the product will only be added to the next subscription billing cycle. Default is false.
Response
Product successfully added to order
Indicates if the request was successful
Example:
true
Was this page helpful?