Billing cycles

Read and adjust when a contract is charged, one cycle at a time: skip, unskip and reschedule.

Subscriptions docs
On this page

Read and adjust when a contract is charged, one cycle at a time.

Get a contract's billing cycles

http
GET /shop-api/contracts/billing-cycles

Permission: Upcoming orders → View billing cycles (contract_billing_cycles:read).

Returns the billing cycles of a single contract, including the cycleIndex that the skip, unskip and reschedule endpoints below take. A billing cycle is the unit a customer is charged on: it has a billing date, a window that date must stay inside, a status, and a skipped flag.

Query parameters

ParameterTypeRequiredDefaultDescription
contractIdstring|numberYes—Shopify GID or numeric ID of the contract.
firstnumberNo10How many cycles to return, 1–10.
fromCycleIndexnumberNo—Start of an explicit cycle range. Must be sent together with toCycleIndex.
toCycleIndexnumberNo—End of that range, inclusive. Must be greater than or equal to fromCycleIndex.

Without a range, the window starts at now in the shop's timezone and runs forward, so only upcoming cycles are returned. Supply the range to see cycles that have already been billed, are already skipped, or whose billing date has passed. A range reaching past the contract's last cycle is refused with 404 rather than truncated, so ask for one you know exists.

Example

bash
curl -G "https://subscriptions.kachingappz.app/shop-api/contracts/billing-cycles" \
  -H "Authorization: Bearer <your-api-token>" \
  --data-urlencode "contractId=123456789" \
  --data-urlencode "first=3"

Response (200)

json
{
  "contractId": "gid://shopify/SubscriptionContract/123456789",
  "subscriptionContractStatus": "ACTIVE",
  "billingCycles": [
    {
      "cycleIndex": 4,
      "billingAttemptExpectedDate": "2026-02-15T10:00:00Z",
      "cycleStartAt": "2026-01-15T00:00:00Z",
      "cycleEndAt": "2026-02-15T00:00:00Z",
      "skipped": false,
      "status": "UNBILLED",
      "subscriptionContractStatus": "ACTIVE",
      "billingAttempts": { "nodes": [] },
      "sourceContract": {
        "deliveryPolicy": { "interval": "MONTH", "intervalCount": 1 },
        "lines": { "nodes": [] }
      }
    }
  ]
}

subscriptionContractStatus is the contract's status; status on each cycle is the cycle's (UNBILLED, BILLED or CANCELLED). A cancelled contract still reports projected UNBILLED cycles, so check the contract's status before reading the list as a schedule.


Skip a billing cycle

http
POST /shop-api/contracts/billing-cycles/skip

Permission: Upcoming orders → Skip billing cycles (contract_billing_cycles:skip).

Skips one upcoming cycle: the customer is not charged and no order is created for it. The schedule is not delayed — every later cycle keeps its own date. To move a delivery rather than drop it, reschedule it instead.

Request body

FieldTypeRequiredDescription
contractIdstring|numberYesShopify GID or numeric ID of the contract.
cycleIndexnumberYesThe cycle to skip, from get billing cycles.

Example

bash
curl -X POST "https://subscriptions.kachingappz.app/shop-api/contracts/billing-cycles/skip" \
  -H "Authorization: Bearer <your-api-token>" \
  -H "Content-Type: application/json" \
  -d '{"contractId":"123456789","cycleIndex":4}'

Response (200)

json
{
  "success": true,
  "cycleIndex": 4,
  "skipped": true,
  "changed": true,
  "billingAttemptExpectedDate": "2026-02-15T10:00:00Z"
}

A cycle that is already skipped is not an error: the response is 200 with "changed": false, and nothing is sent to Shopify. The endpoint is safe to repeat.


Unskip a billing cycle

http
POST /shop-api/contracts/billing-cycles/unskip

Permission: Upcoming orders → Unskip billing cycles (contract_billing_cycles:unskip).

Puts a skipped cycle back on the schedule, so the customer is charged for it again. Same request body as skip.

Example

bash
curl -X POST "https://subscriptions.kachingappz.app/shop-api/contracts/billing-cycles/unskip" \
  -H "Authorization: Bearer <your-api-token>" \
  -H "Content-Type: application/json" \
  -d '{"contractId":"123456789","cycleIndex":4}'

Response (200)

json
{
  "success": true,
  "cycleIndex": 4,
  "skipped": false,
  "changed": true,
  "billingAttemptExpectedDate": "2026-02-15T10:00:00Z"
}

A cycle that is not skipped returns 200 with "changed": false.


Reschedule a billing cycle

http
POST /shop-api/contracts/billing-cycles/reschedule

Permission: Upcoming orders → Reschedule billing cycles (contract_billing_cycles:reschedule).

Moves one cycle's billing date. Only that cycle moves — later cycles keep their dates, so this is a one-off shift rather than a change of cadence. Call it once per cycle to move several.

Request body

FieldTypeRequiredDescription
contractIdstring|numberYesShopify GID or numeric ID of the contract.
cycleIndexnumberYesThe cycle to move.
billingDatestringYesYYYY-MM-DD, or a full ISO 8601 date-time. A bare date is read at the start of that day in the shop's timezone.

billingDate must be later than today in the shop's timezone, and no other cycle of the same contract may already sit on that day.

Example

bash
curl -X POST "https://subscriptions.kachingappz.app/shop-api/contracts/billing-cycles/reschedule" \
  -H "Authorization: Bearer <your-api-token>" \
  -H "Content-Type: application/json" \
  -d '{"contractId":"123456789","cycleIndex":4,"billingDate":"2026-03-02"}'

Response (200)

json
{
  "success": true,
  "cycleIndex": 4,
  "changed": true,
  "billingAttemptExpectedDate": "2026-03-02T00:00:00-05:00"
}

The applied date can differ from the one you asked for. Shopify validates billingDate against the cycle's own window, and derives that window from the previous cycle's current billing date. Month-end anchoring is the usual cause: re-anchoring a monthly contract to the 30th puts February on the 28th, which shortens the window. When the date has to be adjusted, the response carries both:

json
{
  "success": true,
  "cycleIndex": 4,
  "changed": true,
  "billingAttemptExpectedDate": "2026-02-28T00:00:00-05:00",
  "requestedBillingDate": "2026-03-02T00:00:00-05:00"
}

billingAttemptExpectedDate is always the date that took effect — show that one to operators. requestedBillingDate is present only when the two differ.


Notes on billing cycle changes

  • `cycleIndex` is 1-based, and there is no cycle 0. Cycle 1 is the first recurring charge: its window opens when the contract is created and it bills one billing interval later. The signup/checkout order is not a billing cycle, so the *N*th recurring charge is cycle N. Always take the number from get billing cycles rather than computing it.
  • Only `ACTIVE`, `PAUSED` and `FAILED` contracts can be changed (422 otherwise). PAUSED is allowed on purpose: a paused contract still has projected cycles, and the date it would bill on remains meaningful.
  • A cycle that has already been billed cannot be changed (409), and neither can one whose billing is already in progress.
  • Unskip before rescheduling. A skipped cycle has no billing date to move, so a reschedule of one is refused with 409.
  • Skipping and unskipping are safe to repeat; rescheduling is too, since it sets an absolute date rather than shifting by an offset.
  • Scheduled charges follow the change. A charge already queued for a cycle you skip is abandoned, and one queued for a cycle you move is re-queued for the new date — so neither a double charge nor a missed charge results.
  • Every change appears on the contract's timeline in the Kaching admin.

Can’t find what you need?

Ask the Kaching team about your integration in chat.