Subscription Contracts
Remove discount from subscription
Removes a specific discount from a subscription contract based on the discount ID. This will affect the pricing of all future orders generated by the subscription.
Key Features:
- Removes any type of discount: automatic, manual, or code-based
- Uses Shopify’s draft system for safe removal
- Immediate effect on future order pricing
- Cannot be undone - discount must be re-applied if needed
- Activity log tracks removed discounts
Finding Discount IDs: Discount IDs can be found in the subscription contract’s discount collection:
- Query the subscription contract to see
discounts.edges[].node.id - Format:
gid://shopify/SubscriptionManualDiscount/123456 - Each discount has a unique ID regardless of type
Types of Discounts:
- Manual Discounts: Applied via API (percentage, fixed, price)
- Code Discounts: Applied using discount codes
- Automatic Discounts: Applied by Shopify based on rules
- Build-a-Box Discounts: Volume-based discounts
- Selling Plan Discounts: Built into the subscription plan
Impact on Pricing: When a discount is removed:
- Future orders use full price (no discount)
- Existing orders are not affected
- Other discounts remain active
- Shipping prices may be recalculated
- Customer sees updated pricing immediately
Common Use Cases:
- End promotional period discounts
- Remove expired or invalid discount codes
- Clear discounts before applying new ones
- Customer service adjustments
- Correct pricing errors
Important Notes:
- The store’s Appstle plan must include contract price changes. API access alone isn’t enough, and scoped partner tokens need it too. Stores that choose a paid plan today get it, and the Free plan doesn’t include it. A store that chose its plan earlier, or is on a custom plan, may not have it: support@appstle.com can check. Without it, the call returns
400witherrorKeypermissionDeniedand the messageUserGeneratedError:Upgrade your plan to modify contract price. - Cannot remove selling plan built-in discounts
- No customer notification sent (consider sending separately)
- Cannot selectively remove - removes entire discount
- Build-a-Box discounts may auto-reapply based on quantity
- Some discounts may be required by business rules
Post-Removal Considerations:
- Customer may notice price increase on next order
- May affect customer retention if unexpected
- Consider grace periods or notifications
- Document reason for removal in your system
Authentication: Requires valid X-API-Key header
PUT
/
api
/
external
/
v2
/
subscription-contracts-remove-discount
Remove discount from subscription
curl --request PUT \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount';
const options = {method: 'PUT', headers: {'X-API-Key': '<x-api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"customer": {
"email": "customer@example.com",
"id": "gid://shopify/Customer/987654321"
},
"deliveryPrice": {
"amount": "5.99",
"currencyCode": "USD"
},
"discounts": {
"edges": []
},
"id": "gid://shopify/SubscriptionContract/123456789",
"lines": {
"edges": [
{
"node": {
"currentPrice": {
"amount": "39.99",
"currencyCode": "USD"
},
"id": "gid://shopify/SubscriptionLine/111111",
"pricingPolicy": {
"basePrice": {
"amount": "39.99",
"currencyCode": "USD"
}
},
"quantity": 2,
"title": "Premium Coffee - Monthly Supply",
"variantId": "gid://shopify/ProductVariant/42549172011164"
}
}
]
},
"nextBillingDate": "2024-04-01T00:00:00Z",
"status": "ACTIVE"
}Query Parameters
Response
Discount successfully removed
⌘I
Remove discount from subscription
curl --request PUT \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount';
const options = {method: 'PUT', headers: {'X-API-Key': '<x-api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-contracts-remove-discount")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"customer": {
"email": "customer@example.com",
"id": "gid://shopify/Customer/987654321"
},
"deliveryPrice": {
"amount": "5.99",
"currencyCode": "USD"
},
"discounts": {
"edges": []
},
"id": "gid://shopify/SubscriptionContract/123456789",
"lines": {
"edges": [
{
"node": {
"currentPrice": {
"amount": "39.99",
"currencyCode": "USD"
},
"id": "gid://shopify/SubscriptionLine/111111",
"pricingPolicy": {
"basePrice": {
"amount": "39.99",
"currencyCode": "USD"
}
},
"quantity": 2,
"title": "Premium Coffee - Monthly Supply",
"variantId": "gid://shopify/ProductVariant/42549172011164"
}
}
]
},
"nextBillingDate": "2024-04-01T00:00:00Z",
"status": "ACTIVE"
}