Subscription Actions
Execute a server-authoritative next-order delay
Re-reads the recorded billing attempt, recomputes delayDays 7 or 14 in the shop IANA timezone, re-runs every eligibility guard, and returns a typed outcome. The client never supplies an authoritative target date.
POST
/
subscriptions
/
cp
/
api
/
subscription-actions
/
reschedule-by-days
/
execute
Execute a server-authoritative next-order delay
curl --request POST \
--url https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute \
--header 'Content-Type: application/json' \
--data '
{
"contractId": 123456789,
"delayDays": 7
}
'import requests
url = "https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute"
payload = {
"contractId": 123456789,
"delayDays": 7
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({contractId: 123456789, delayDays: 7})
};
fetch('https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({contractId: 123456789, delayDays: 7})
};
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://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contractId' => 123456789,
'delayDays' => 7
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute"
payload := strings.NewReader("{\n \"contractId\": 123456789,\n \"delayDays\": 7\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contractId\": 123456789,\n \"delayDays\": 7\n}"
response = http.request(request)
puts response.read_body{
"billingAttemptId": 123,
"contractId": 123,
"outcome": "EXECUTED",
"previousBillingDate": "2023-11-07T05:31:56Z",
"reasonCode": "ALLOWED",
"resultingBillingDate": "2023-11-07T05:31:56Z",
"safeCustomerMessage": "<string>"
}{
"billingAttemptId": 123,
"contractId": 123,
"outcome": "EXECUTED",
"previousBillingDate": "2023-11-07T05:31:56Z",
"reasonCode": "ALLOWED",
"resultingBillingDate": "2023-11-07T05:31:56Z",
"safeCustomerMessage": "<string>"
}Body
application/json
Shopify subscription contract ID
Example:
123456789
Server-authoritative delay preset. Only 7 or 14 is accepted.
Available options:
7, 14 Example:
7
Exact upcoming billing attempt ID. Required by notification-originated callers.
Example:
987654321
Response
Typed result with outcome EXECUTED, ALREADY_APPLIED, DECLINED, STALE_CONTEXT, NOT_FOUND, or RETRYABLE_FAILURE and a SubscriptionActionReasonCode
Available options:
EXECUTED, ALREADY_APPLIED, DECLINED, STALE_CONTEXT, NOT_FOUND, RETRYABLE_FAILURE Available options:
ALLOWED, EXECUTED, ALREADY_SKIPPED, ALREADY_RESCHEDULED, INVALID_REQUEST, INVALID_DELAY_DAYS, MISSING_IDEMPOTENCY_KEY, CONTRACT_NOT_FOUND, BILLING_ATTEMPT_NOT_FOUND, BILLING_ATTEMPT_CONTRACT_MISMATCH, NO_UPCOMING_ORDER, STALE_BILLING_ATTEMPT, QUICK_ACTIONS_NOT_ENABLED, INTEGRATIONS_NOT_ENABLED, TWO_WAY_SMS_NOT_ENABLED, PLAN_UPGRADE_REQUIRED, SKIP_NOT_ALLOWED, PREPAID_SKIP_NOT_SUPPORTED, RESCHEDULE_NOT_ALLOWED, MIN_CYCLES_NOT_COMPLETED, ATTRIBUTE_MIN_CYCLES_NOT_COMPLETED, TIME_WINDOW_RESTRICTED, ORDER_IN_PROGRESS, FIXED_BILLING_SCHEDULE, RESTRICTED_DATE, RESTRICTED_DAY_OF_WEEK, MUTATION_DECLINED, MUTATION_FAILED ⌘I
Execute a server-authoritative next-order delay
curl --request POST \
--url https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute \
--header 'Content-Type: application/json' \
--data '
{
"contractId": 123456789,
"delayDays": 7
}
'import requests
url = "https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute"
payload = {
"contractId": 123456789,
"delayDays": 7
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({contractId: 123456789, delayDays: 7})
};
fetch('https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({contractId: 123456789, delayDays: 7})
};
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://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contractId' => 123456789,
'delayDays' => 7
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute"
payload := strings.NewReader("{\n \"contractId\": 123456789,\n \"delayDays\": 7\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://www.myshop.com/apps/subscriptions/cp/api/subscription-actions/reschedule-by-days/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contractId\": 123456789,\n \"delayDays\": 7\n}"
response = http.request(request)
puts response.read_body{
"billingAttemptId": 123,
"contractId": 123,
"outcome": "EXECUTED",
"previousBillingDate": "2023-11-07T05:31:56Z",
"reasonCode": "ALLOWED",
"resultingBillingDate": "2023-11-07T05:31:56Z",
"safeCustomerMessage": "<string>"
}{
"billingAttemptId": 123,
"contractId": 123,
"outcome": "EXECUTED",
"previousBillingDate": "2023-11-07T05:31:56Z",
"reasonCode": "ALLOWED",
"resultingBillingDate": "2023-11-07T05:31:56Z",
"safeCustomerMessage": "<string>"
}