Node.js
import { ShoplyCustomer } from "@shoplygg/node";
const buyer = new ShoplyCustomer({ storeId: "YOUR_STORE_ID", token });
const result = await buyer.subscriptions.cancel("SUBSCRIPTION_ID");<?php
require 'vendor/autoload.php';
$buyer = new Shoply\Customer(['storeId' => 'YOUR_STORE_ID', 'token' => $token]);
$result = $buyer->subscriptions->cancel('SUBSCRIPTION_ID');
import shoply
buyer = shoply.Customer("YOUR_STORE_ID", token=token)
result = buyer.subscriptions.cancel("SUBSCRIPTION_ID")
curl --request POST \
--url https://api.shoply.gg/v1/stores/{storeId}/customer/subscriptions/{subscriptionId}/cancel \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/customer/subscriptions/{subscriptionId}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.shoply.gg/v1/stores/{storeId}/customer/subscriptions/{subscriptionId}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/customer/subscriptions/{subscriptionId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": [
{
"id": "d5b2ae58-5363-4806-bcaf-7fc939e2c948",
"email": "grace@example.com",
"productName": "Northwind Pro",
"variantName": "1 month",
"quantity": 1,
"price": 9.99,
"currency": "USD",
"every": 1,
"unit": "month",
"status": "cancelling",
"periodEnd": "2026-11-29T16:20:19Z",
"graceEnd": null,
"renewalOrderId": null,
"renewalUrl": null,
"firstOrderId": "bc44febe-0f25-4076-92eb-03a5045a57e7",
"endedAt": null,
"revoked": false,
"pausedAt": null,
"resumeAt": null,
"pausedBy": null,
"renewsWith": null,
"autoRenews": false,
"chargeTried": 0,
"chargeNextAt": null,
"createdAt": "2026-10-22T16:20:19Z",
"pausesLeft": 2
}
],
"meta": {
"canCancel": true,
"cancelMode": "end",
"canUndo": true,
"canPause": true,
"pauseDays": 30,
"canChangeCard": true
}
}{
"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": {}
}Customer API
Cancel a subscription
As the store’s setting says: when what was paid for runs out, or at once. Refused with cancel_off where the store does not let buyers cancel. Answers the list again.
Needs the buyer’s token: Authorization: Bearer shoply_ct_..., from Sign in with the code.
It is counted for the buyer’s token: 30 changes in ten minutes.
POST
/
stores
/
{storeId}
/
customer
/
subscriptions
/
{subscriptionId}
/
cancel
Node.js
import { ShoplyCustomer } from "@shoplygg/node";
const buyer = new ShoplyCustomer({ storeId: "YOUR_STORE_ID", token });
const result = await buyer.subscriptions.cancel("SUBSCRIPTION_ID");<?php
require 'vendor/autoload.php';
$buyer = new Shoply\Customer(['storeId' => 'YOUR_STORE_ID', 'token' => $token]);
$result = $buyer->subscriptions->cancel('SUBSCRIPTION_ID');
import shoply
buyer = shoply.Customer("YOUR_STORE_ID", token=token)
result = buyer.subscriptions.cancel("SUBSCRIPTION_ID")
curl --request POST \
--url https://api.shoply.gg/v1/stores/{storeId}/customer/subscriptions/{subscriptionId}/cancel \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/customer/subscriptions/{subscriptionId}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.shoply.gg/v1/stores/{storeId}/customer/subscriptions/{subscriptionId}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/customer/subscriptions/{subscriptionId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": [
{
"id": "d5b2ae58-5363-4806-bcaf-7fc939e2c948",
"email": "grace@example.com",
"productName": "Northwind Pro",
"variantName": "1 month",
"quantity": 1,
"price": 9.99,
"currency": "USD",
"every": 1,
"unit": "month",
"status": "cancelling",
"periodEnd": "2026-11-29T16:20:19Z",
"graceEnd": null,
"renewalOrderId": null,
"renewalUrl": null,
"firstOrderId": "bc44febe-0f25-4076-92eb-03a5045a57e7",
"endedAt": null,
"revoked": false,
"pausedAt": null,
"resumeAt": null,
"pausedBy": null,
"renewsWith": null,
"autoRenews": false,
"chargeTried": 0,
"chargeNextAt": null,
"createdAt": "2026-10-22T16:20:19Z",
"pausesLeft": 2
}
],
"meta": {
"canCancel": true,
"cancelMode": "end",
"canUndo": true,
"canPause": true,
"pauseDays": 30,
"canChangeCard": true
}
}{
"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 buyer's token, from Sign in with the code: Authorization: Bearer shoply_ct_.... It reaches that buyer's own orders at one store, and no route that takes a key.
Path Parameters
The store's ID, from Settings, General in its dashboard. It is not a secret: a page may show it.
One of the buyer's subscriptions, from List subscriptions.

