Remove one-time product from upcoming order
Removes a previously added one-time product (one-off) from a specific upcoming billing attempt. This allows customers or merchants to cancel add-on items before the order is processed.
Key Features:
- Flexible Cancellation: Remove add-ons before order processes
- Targeted Removal: Remove specific variant from specific order
- No Membership Impact: Doesn’t affect recurring items
- Customer Control: Let members manage their add-ons
- Activity Logging: Tracks removal for audit trail
Required Parameters:
- Contract ID: Target membership contract
- Billing Attempt ID: Order to remove item from
- Variant ID: Product variant to remove
How It Works:
- Validates contract exists and belongs to shop
- Finds one-off matching contract, billing attempt, and variant
- Deletes the one-off record
- Returns updated list of remaining one-offs
- Logs removal activity for audit trail
Use Cases:
- Customer changes mind about add-on product
- Remove out-of-stock items from upcoming orders
- Cancel promotional items no longer available
- Customer wants to reduce order total
- Merchant corrects mistakenly added items
- Manage add-ons in customer portal
Business Rules:
- Can only remove from upcoming (unprocessed) orders
- Must match exact contract, billing attempt, and variant
- Returns remaining one-offs after deletion
- Cannot remove from past/completed orders
Authentication: Requires API key authentication via X-API-Key header or api_key parameter
curl --request DELETE \
--url https://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-idimport requests
url = "https://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id';
const options = {method: 'DELETE'};
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://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id"
req, _ := http.NewRequest("DELETE", url, nil)
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://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body[
{
"shop": "my-store.myshopify.com",
"billingAttemptId": 123,
"id": 789,
"subscriptionContractId": 123,
"variantHandle": "<string>",
"variantId": 123
}
]{
"detail": "One-off item not found or already processed",
"errorKey": "not_found",
"status": 400,
"title": "Bad Request"
}[
{
"shop": "my-store.myshopify.com",
"billingAttemptId": 123,
"id": 789,
"subscriptionContractId": 123,
"variantHandle": "<string>",
"variantId": 123
}
][
{
"shop": "my-store.myshopify.com",
"billingAttemptId": 123,
"id": 789,
"subscriptionContractId": 123,
"variantHandle": "<string>",
"variantId": 123
}
][
{
"shop": "my-store.myshopify.com",
"billingAttemptId": 123,
"id": 789,
"subscriptionContractId": 123,
"variantHandle": "<string>",
"variantId": 123
}
]Headers
Query Parameters
API Key (Deprecated - Use Header X-API-Key instead)
Membership contract ID
Billing attempt ID to remove the item from
Product variant ID to remove
Response
One-off product successfully removed, returns updated list of remaining one-offs
Shop domain identifier
"my-store.myshopify.com"
Associated billing attempt ID
Unique identifier of the one-off item
789
Associated subscription contract ID
Product variant handle for the one-off item
Shopify product variant ID of the one-off item
curl --request DELETE \
--url https://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-idimport requests
url = "https://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id';
const options = {method: 'DELETE'};
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://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id"
req, _ := http.NewRequest("DELETE", url, nil)
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://membership-admin.appstle.com/api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body[
{
"shop": "my-store.myshopify.com",
"billingAttemptId": 123,
"id": 789,
"subscriptionContractId": 123,
"variantHandle": "<string>",
"variantId": 123
}
]{
"detail": "One-off item not found or already processed",
"errorKey": "not_found",
"status": 400,
"title": "Bad Request"
}[
{
"shop": "my-store.myshopify.com",
"billingAttemptId": 123,
"id": 789,
"subscriptionContractId": 123,
"variantHandle": "<string>",
"variantId": 123
}
][
{
"shop": "my-store.myshopify.com",
"billingAttemptId": 123,
"id": 789,
"subscriptionContractId": 123,
"variantHandle": "<string>",
"variantId": 123
}
][
{
"shop": "my-store.myshopify.com",
"billingAttemptId": 123,
"id": 789,
"subscriptionContractId": 123,
"variantHandle": "<string>",
"variantId": 123
}
]