Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.upsells.setEnabled("UPSELL_ID", {
enabled: true,
});<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->upsells->setEnabled('UPSELL_ID', [
'enabled' => true,
]);
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.upsells.setEnabled("UPSELL_ID", enabled=True)
curl --request PATCH \
--url https://api.shoply.gg/v1/stores/{storeId}/upsells/{upsellId}/enabled \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/upsells/{upsellId}/enabled"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.shoply.gg/v1/stores/{storeId}/upsells/{upsellId}/enabled")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/upsells/{upsellId}/enabled")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"id": "606a408d-8ce9-43d9-9950-231f89f4c901",
"kind": "addon",
"name": "Priority Setup",
"enabled": false,
"sells": "extra",
"productId": null,
"variantId": null,
"productName": null,
"productImage": null,
"variantLabel": null,
"variantPrice": null,
"price": 5.99,
"cost": null,
"message": "We will be in touch within a day to set it up.",
"offered": "optional",
"charged": "order",
"trigger": "product",
"minSubtotal": null,
"discountType": "none",
"discountValue": 0,
"words": "",
"startsAt": null,
"endsAt": null,
"firstOrders": false,
"hideOwned": false,
"targets": [
{
"type": "product",
"id": "f463e265-097a-4235-bc2f-5239b19a9874",
"name": "Northwind Pro"
}
],
"shown": 0,
"taken": 0,
"revenue": 0,
"dateCreated": "2026-10-22T16:20:18Z",
"updatedAt": "2026-10-22T16:20:18.734Z"
}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Upsells
Switch an upsell on or off
Changes whether the upsell is offered, without sending the rest of it.
Needs the upsells.write permission (Change Upsells).
PATCH
/
stores
/
{storeId}
/
upsells
/
{upsellId}
/
enabled
Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.upsells.setEnabled("UPSELL_ID", {
enabled: true,
});<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->upsells->setEnabled('UPSELL_ID', [
'enabled' => true,
]);
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.upsells.setEnabled("UPSELL_ID", enabled=True)
curl --request PATCH \
--url https://api.shoply.gg/v1/stores/{storeId}/upsells/{upsellId}/enabled \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/upsells/{upsellId}/enabled"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.shoply.gg/v1/stores/{storeId}/upsells/{upsellId}/enabled")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/upsells/{upsellId}/enabled")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"id": "606a408d-8ce9-43d9-9950-231f89f4c901",
"kind": "addon",
"name": "Priority Setup",
"enabled": false,
"sells": "extra",
"productId": null,
"variantId": null,
"productName": null,
"productImage": null,
"variantLabel": null,
"variantPrice": null,
"price": 5.99,
"cost": null,
"message": "We will be in touch within a day to set it up.",
"offered": "optional",
"charged": "order",
"trigger": "product",
"minSubtotal": null,
"discountType": "none",
"discountValue": 0,
"words": "",
"startsAt": null,
"endsAt": null,
"firstOrders": false,
"hideOwned": false,
"targets": [
{
"type": "product",
"id": "f463e265-097a-4235-bc2f-5239b19a9874",
"name": "Northwind Pro"
}
],
"shown": 0,
"taken": 0,
"revenue": 0,
"dateCreated": "2026-10-22T16:20:18Z",
"updatedAt": "2026-10-22T16:20:18.734Z"
}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Authorizations
A secret API key, made under Developers in the dashboard: Authorization: Bearer shoply_sk_...
Headers
A word of your own for this one change, up to 180 letters, digits, dots, dashes, underscores and colons. Sent again with the same key, the request is not carried out twice: the first answer comes back, with Idempotent-Replay: true.
Path Parameters
The store's ID. A key reaches the store it was made in: GET /key answers which.
The upsell.
Body
application/json
Whether it is offered.

