Types > Subscription
Commerce APITypesSubscription
Subscription

Description

Topic: Subscriptions

Fields

billing_address: SubscriptionParam!

Which billing address to use


billing_address_id: String!

Custom billing address identifier


created_at: String!

The date and time when the subscription was created

Example: "2014-09-04T12:23:34Z"

Timestamp (RFC 3339)


custom_billing_address: Address

Custom billing address for subscription


custom_shipping_address: Address

Custom shipping address for subscription


customer: Customer

Customer this subscription belongs to

Expandable

Permission bit: "customers.read"


error: SubscriptionError!

Error state of the subscription

Example: ok


error_count: Int!

How many errors happened as a result of retry attempts

Example: 3


error_meta: [KeyValue!]!

Additional information about last error in unspecified format


id: String!

Unique subscription identifier. See also: Unique Identifiers

Example: "ss_EQzGqWoY"


last_order: Order

Last order this subscription created

Expandable

Permission bit: "orders.read"


next_at: String!

When this subscription is due to update

Example: "2014-09-04T12:23:34Z"

Timestamp (RFC 3339)


next_offset: Int!

Seconds offset from "next_at" to accommodate for the business logic. Negative for pre-paid subscriptions, because scheduled fulfillment is created ahead of time. Positive for subscriptions in error state, this is a retry logic.

Example: 3600


origin_order: Order

Order this subscription originates from

Expandable

Permission bit: "orders.read"


payment_source: SubscriptionParam!

Which payment source to use


payment_source_id: String!

Custom shipping address identifier


pending_order: Order

The order awaiting payment confirmation when state is "pending_payment"

Expandable

Permission bit: "orders.read"


quantity: Int!

The number of items customer subscribed to

Example: 0


shipping_address: SubscriptionParam!

Which shipping address to use


shipping_address_id: String!

Custom shipping address identifier


state: SubscriptionState!

State of the subscription


subscription_plan: SubscriptionPlan!

A subscription plan customer picked for this subscription


tick_count: Int!

How many successful ticks (billing and fulfillment events) happened for this subscription

Example: 5


variant: ProductVariant

Product variant the customer subscribed to

Expandable

Permission bit: "product_variants.read"


Used By

Mutations

subscriptionsCancel, subscriptionsEdit, subscriptionsPause, subscriptionsResume, subscriptionsSkipNext

Queries

subscriptions

Types

Order, OrderLineItem, ScheduledFulfillment, SubscriptionExpandableItems, SubscriptionPage, SubscriptionSearchResult, UnifiedSearchResult

Preview (typescript)

Loading module