Contract object

The fields of a contract as the Shop API returns it: the contract, its line items, cycle discounts and pagination.

Subscriptions docs
On this page

Top-level contract fields

FieldTypeDescription
idstringShopify GID for the contract.
statusstringOne of ACTIVE, PAUSED, FAILED, EXPIRED, CANCELLED, STALE.
currencyCodestringISO currency code for the contract.
lastPaymentStatusstringSUCCEEDED or FAILED.
revisionIdstringOpaque identifier for the current revision. Use to detect contract changes.
createdAtstringISO-8601 timestamp.
updatedAtstringISO-8601 timestamp.
deliveryPolicyobject{ interval, intervalCount } — how often deliveries happen.
billingPolicyobject{ interval, intervalCount, maxCycles, minCycles } — billing cadence and limits.
deliveryPriceobject{ amount, currencyCode } — shipping/delivery charge per cycle.
deliveryMethodobjectDelivery method, e.g. SubscriptionDeliveryMethodShipping with an address.
linesCountobject{ count } — total number of line items on the contract.
linesobjectConnection of line items — see below.
discountsobjectConnection of contract-level discount allocations.
customerobject{ id, displayName, defaultEmailAddress.emailAddress }.
ordersobjectConnection of orders generated by this contract.

interval values: DAY, WEEK, MONTH, YEAR.

Line item fields (lines.edges[].node)

FieldTypeDescription
idstringShopify GID for the line.
titlestringProduct title.
variantTitlestringVariant title.
productIdstringShopify product GID.
variantIdstringShopify variant GID.
quantitynumberNumber of units per delivery.
lineDiscountedPriceobject{ amount, currencyCode } — final per-line price after discounts.
pricingPolicyobject{ basePrice, cycleDiscounts[] } — base price and per-cycle adjustments.
discountAllocationsarrayLine-level discount allocations — see the note below.

Inside discountAllocations[].discount, the type field is Shopify's DiscountType — MANUAL, CODE_DISCOUNT or AUTOMATIC_DISCOUNT — describing how the discount was applied. It is not the percentage/fixed-amount distinction. For that, read discount.value ({ percentage } or { amount, appliesOnEachItem }), or pricingPolicy.cycleDiscounts[].adjustmentType.

Cycle discount fields (pricingPolicy.cycleDiscounts[])

FieldTypeDescription
adjustmentTypestringPERCENTAGE, FIXED_AMOUNT, or PRICE.
afterCyclenumberCycle index after which the discount applies (0 = starting with cycle 1).
computedPriceobject{ amount, currencyCode } — resolved price once the discount applies.
adjustmentValueobjectEither { percentage } or { amount, currencyCode }, depending on type.

Pagination (pageInfo)

Connections (lines, orders, top-level list) return pageInfo:

FieldTypeDescription
hasNextPagebooleantrue if more pages exist.
hasPreviousPagebooleantrue if previous pages exist.
endCursorstringCursor for the last item in the current page.
startCursorstringCursor for the first item in the current page.

Can’t find what you need?

Ask the Kaching team about your integration in chat.