An Appstle merchant saw far fewer renewal orders than currently active subscriptions and had billing retries enabled. They needed to identify missing orders. Active contracts today, cycles due this month and billing attempts count different things.
Start with one row for each billing cycle originally due in the period. Attach attempts and resulting orders to distinguish a skipped cycle, a failed attempt later recovered, and a due cycle with no order.
Export cycles or schedules and changes from the subscription app. Keep contract ID, cycle identity, due date and skip status. Set a cutoff and exclude future cycles. A quarterly contract can be active without billing this month.
Match attempts by cycle, including time, result and linked order. A failure followed by success is one cycle with an order. Several failures are still one cycle. For two distinct orders on one cycle, inspect both orders and the intervention history.
Compare one example across the app's billing log, the Shopify order and payment records. Investigate failure codes where attempts failed, or schedule and data coverage where no attempt is found. Recheck for a later success before any manual charge.
Test results
| Sample condition | Observed result |
| Three due cycles and one future cycle | One linked order, one failures-only, one skip |
|---|
| Later success before cutoff | The cycle moves to linked order |
|---|
| Attempt log missing | No attempt found |
|---|
| Two distinct orders on one cycle | Review before taking any billing action |
Reasoning and conditions
The fixture reconciles cycles to orders. A linked order establishes creation; settlement needs payment evidence. The original counts alone cannot classify the difference as failed charges.
Source: Reddit · Merchant questionSource: Subscription billing attemptsSource: Appstle billing failure eventContinue in the workflow: Subscription renewal review
Inspect sample records and query
Run the setup and query in an empty SQLite database. The rows are synthetic.
CREATE TABLE cycle(id TEXT PRIMARY KEY,contract TEXT,due INT,skipped INT);
CREATE TABLE attempt(id TEXT PRIMARY KEY,cycle TEXT,outcome TEXT,linked_order TEXT,at INT);
INSERT INTO cycle VALUES ('a','A',5,0),('b','B',5,0),('c','C',5,1),('d','D',30,0);
INSERT INTO attempt VALUES ('1','a','failed',NULL,5),('2','a','success','order42',6),
('3','b','failed',NULL,5),('4','b','failed',NULL,6);
SELECT c.id,CASE WHEN COUNT(DISTINCT a.linked_order)>1 THEN 'review multiple orders'
WHEN COUNT(DISTINCT a.linked_order)=1 THEN 'order linked' WHEN c.skipped=1 THEN 'recorded skip'
WHEN COUNT(a.id)=0 THEN 'no attempt found' WHEN SUM(a.outcome<>'failed')=0 THEN 'failed attempts only' ELSE 'review attempt' END
FROM cycle c LEFT JOIN attempt a ON c.id=a.cycle AND a.at<=20 WHERE due<=20 GROUP BY c.id ORDER BY c.id;
Download the example record (JSON)
Sources
Reddit · Merchant question
Subscription billing attempts
Appstle billing failure event
Back to the topic questions