Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.resellerProducts.badges("PRODUCT_ID", {
badges: [{"label":"Available","color":"green","kind":"status"}],
});
<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->resellerProducts->badges('PRODUCT_ID', [
'badges' => [['label' => 'Available', 'color' => 'green', 'kind' => 'status']],
]);
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.resellerProducts.badges(
"PRODUCT_ID",
badges=[{"label": "Available", "color": "green", "kind": "status"}],
)
curl --request PUT \
--url https://api.shoply.gg/v1/stores/{storeId}/resellers/products/{productId}/badges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"badges": [
{
"label": "Available",
"color": "green",
"kind": "status"
}
]
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/resellers/products/{productId}/badges"
payload := strings.NewReader("{\n \"badges\": [\n {\n \"label\": \"Available\",\n \"color\": \"green\",\n \"kind\": \"status\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.shoply.gg/v1/stores/{storeId}/resellers/products/{productId}/badges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"badges\": [\n {\n \"label\": \"Available\",\n \"color\": \"green\",\n \"kind\": \"status\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/resellers/products/{productId}/badges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"badges\": [\n {\n \"label\": \"Available\",\n \"color\": \"green\",\n \"kind\": \"status\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"7626c760-c6cd-4b38-8344-cfbba0148a80": [
{
"label": "Available",
"color": "green",
"kind": "status"
}
]
},
"meta": {
"panel": {
"enabled": true,
"currency": "USD",
"minTopup": 25
},
"products": [
{
"variantId": "17e8cb5f-acf9-4f64-bf6b-274b0c6b3183",
"productId": "7626c760-c6cd-4b38-8344-cfbba0148a80",
"productName": "Northwind Pro",
"variantName": "1 month",
"image": null,
"delivery": "license_keys",
"stock": 4,
"price": 6.5,
"minQty": 1,
"dailyCap": 100,
"maxDiscount": null,
"enabled": true
}
],
"tiers": [
{
"id": "53272267-b8de-4f7f-9c0e-00f69122b91e",
"name": "Gold",
"discount": 12.5,
"resellers": 0,
"spent30": 0
}
]
}
}{
"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": {}
}Resellers
Set a product's status and labels on the panel
What resellers read beside a product on the panel, never the product’s own badges: one status and labels, as a product’s badges are written. An empty list takes them off. 404 for a product the panel does not sell. Answers every product’s, by its ID.
Needs the resellers.write permission (Change Resellers).
PUT
/
stores
/
{storeId}
/
resellers
/
products
/
{productId}
/
badges
Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.resellerProducts.badges("PRODUCT_ID", {
badges: [{"label":"Available","color":"green","kind":"status"}],
});
<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->resellerProducts->badges('PRODUCT_ID', [
'badges' => [['label' => 'Available', 'color' => 'green', 'kind' => 'status']],
]);
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.resellerProducts.badges(
"PRODUCT_ID",
badges=[{"label": "Available", "color": "green", "kind": "status"}],
)
curl --request PUT \
--url https://api.shoply.gg/v1/stores/{storeId}/resellers/products/{productId}/badges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"badges": [
{
"label": "Available",
"color": "green",
"kind": "status"
}
]
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/resellers/products/{productId}/badges"
payload := strings.NewReader("{\n \"badges\": [\n {\n \"label\": \"Available\",\n \"color\": \"green\",\n \"kind\": \"status\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.shoply.gg/v1/stores/{storeId}/resellers/products/{productId}/badges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"badges\": [\n {\n \"label\": \"Available\",\n \"color\": \"green\",\n \"kind\": \"status\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/resellers/products/{productId}/badges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"badges\": [\n {\n \"label\": \"Available\",\n \"color\": \"green\",\n \"kind\": \"status\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"7626c760-c6cd-4b38-8344-cfbba0148a80": [
{
"label": "Available",
"color": "green",
"kind": "status"
}
]
},
"meta": {
"panel": {
"enabled": true,
"currency": "USD",
"minTopup": 25
},
"products": [
{
"variantId": "17e8cb5f-acf9-4f64-bf6b-274b0c6b3183",
"productId": "7626c760-c6cd-4b38-8344-cfbba0148a80",
"productName": "Northwind Pro",
"variantName": "1 month",
"image": null,
"delivery": "license_keys",
"stock": 4,
"price": 6.5,
"minQty": 1,
"dailyCap": 100,
"maxDiscount": null,
"enabled": true
}
],
"tiers": [
{
"id": "53272267-b8de-4f7f-9c0e-00f69122b91e",
"name": "Gold",
"discount": 12.5,
"resellers": 0,
"spent30": 0
}
]
}
}{
"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
Headers
Path Parameters
Body
application/json

