Create
curl --request POST \
--url https://{defaultHost}/v1/upsells \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"upsell": {
"fee_description": "Awesome Upsell",
"step": "declined",
"amount_off": 500,
"price": "0296a929-2a8e-4d08-afd3-a4b6eaa41878",
"upsell_funnel": "c3b9352b-d82e-44e9-8ca3-cba704a586db"
}
}
'import requests
url = "https://{defaultHost}/v1/upsells"
payload = { "upsell": {
"fee_description": "Awesome Upsell",
"step": "declined",
"amount_off": 500,
"price": "0296a929-2a8e-4d08-afd3-a4b6eaa41878",
"upsell_funnel": "c3b9352b-d82e-44e9-8ca3-cba704a586db"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
upsell: {
fee_description: 'Awesome Upsell',
step: 'declined',
amount_off: 500,
price: '0296a929-2a8e-4d08-afd3-a4b6eaa41878',
upsell_funnel: 'c3b9352b-d82e-44e9-8ca3-cba704a586db'
}
})
};
fetch('https://{defaultHost}/v1/upsells', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/v1/upsells",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'upsell' => [
'fee_description' => 'Awesome Upsell',
'step' => 'declined',
'amount_off' => 500,
'price' => '0296a929-2a8e-4d08-afd3-a4b6eaa41878',
'upsell_funnel' => 'c3b9352b-d82e-44e9-8ca3-cba704a586db'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/upsells"
payload := strings.NewReader("{\n \"upsell\": {\n \"fee_description\": \"Awesome Upsell\",\n \"step\": \"declined\",\n \"amount_off\": 500,\n \"price\": \"0296a929-2a8e-4d08-afd3-a4b6eaa41878\",\n \"upsell_funnel\": \"c3b9352b-d82e-44e9-8ca3-cba704a586db\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/upsells")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"upsell\": {\n \"fee_description\": \"Awesome Upsell\",\n \"step\": \"declined\",\n \"amount_off\": 500,\n \"price\": \"0296a929-2a8e-4d08-afd3-a4b6eaa41878\",\n \"upsell_funnel\": \"c3b9352b-d82e-44e9-8ca3-cba704a586db\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/upsells")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"upsell\": {\n \"fee_description\": \"Awesome Upsell\",\n \"step\": \"declined\",\n \"amount_off\": 500,\n \"price\": \"0296a929-2a8e-4d08-afd3-a4b6eaa41878\",\n \"upsell_funnel\": \"c3b9352b-d82e-44e9-8ca3-cba704a586db\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "e3e65a55-70b0-4a46-b79e-407f408fcf90",
"object": "upsell",
"amount_off": 500,
"duplicate_purchase_behavior": "allow",
"fee_description": "Awesome Upsell",
"metadata": {},
"percent_off": null,
"replacement_behavior": "none",
"step": "declined",
"price": "0296a929-2a8e-4d08-afd3-a4b6eaa41878",
"upsell_funnel": "c3b9352b-d82e-44e9-8ca3-cba704a586db",
"discarded_at": null,
"created_at": 1793797019,
"updated_at": 1793797019
}Upsells
Create
Creates a new upsell.
POST
/
v1
/
upsells
Create
curl --request POST \
--url https://{defaultHost}/v1/upsells \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"upsell": {
"fee_description": "Awesome Upsell",
"step": "declined",
"amount_off": 500,
"price": "0296a929-2a8e-4d08-afd3-a4b6eaa41878",
"upsell_funnel": "c3b9352b-d82e-44e9-8ca3-cba704a586db"
}
}
'import requests
url = "https://{defaultHost}/v1/upsells"
payload = { "upsell": {
"fee_description": "Awesome Upsell",
"step": "declined",
"amount_off": 500,
"price": "0296a929-2a8e-4d08-afd3-a4b6eaa41878",
"upsell_funnel": "c3b9352b-d82e-44e9-8ca3-cba704a586db"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
upsell: {
fee_description: 'Awesome Upsell',
step: 'declined',
amount_off: 500,
price: '0296a929-2a8e-4d08-afd3-a4b6eaa41878',
upsell_funnel: 'c3b9352b-d82e-44e9-8ca3-cba704a586db'
}
})
};
fetch('https://{defaultHost}/v1/upsells', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/v1/upsells",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'upsell' => [
'fee_description' => 'Awesome Upsell',
'step' => 'declined',
'amount_off' => 500,
'price' => '0296a929-2a8e-4d08-afd3-a4b6eaa41878',
'upsell_funnel' => 'c3b9352b-d82e-44e9-8ca3-cba704a586db'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/upsells"
payload := strings.NewReader("{\n \"upsell\": {\n \"fee_description\": \"Awesome Upsell\",\n \"step\": \"declined\",\n \"amount_off\": 500,\n \"price\": \"0296a929-2a8e-4d08-afd3-a4b6eaa41878\",\n \"upsell_funnel\": \"c3b9352b-d82e-44e9-8ca3-cba704a586db\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/upsells")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"upsell\": {\n \"fee_description\": \"Awesome Upsell\",\n \"step\": \"declined\",\n \"amount_off\": 500,\n \"price\": \"0296a929-2a8e-4d08-afd3-a4b6eaa41878\",\n \"upsell_funnel\": \"c3b9352b-d82e-44e9-8ca3-cba704a586db\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/upsells")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"upsell\": {\n \"fee_description\": \"Awesome Upsell\",\n \"step\": \"declined\",\n \"amount_off\": 500,\n \"price\": \"0296a929-2a8e-4d08-afd3-a4b6eaa41878\",\n \"upsell_funnel\": \"c3b9352b-d82e-44e9-8ca3-cba704a586db\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "e3e65a55-70b0-4a46-b79e-407f408fcf90",
"object": "upsell",
"amount_off": 500,
"duplicate_purchase_behavior": "allow",
"fee_description": "Awesome Upsell",
"metadata": {},
"percent_off": null,
"replacement_behavior": "none",
"step": "declined",
"price": "0296a929-2a8e-4d08-afd3-a4b6eaa41878",
"upsell_funnel": "c3b9352b-d82e-44e9-8ca3-cba704a586db",
"discarded_at": null,
"created_at": 1793797019,
"updated_at": 1793797019
}Authorizations
Response
200 - application/json
Success
Was this page helpful?