Skip to main content
Anchor to SubscriptionBillingAttempt

SubscriptionBillingAttempt

object

Requires read_own_subscription_contracts access scope.

A record of an execution of the subscription billing process. Billing attempts use idempotency keys to avoid duplicate order creation.

When a billing attempt completes successfully, it creates an Order. The attempt includes associated payment transactions and any errors that occur during billing. If 3D Secure authentication is required, the nextActionUrl field provides the redirect URL for customer verification.

•DateTime

The date and time when the billing attempt was completed.

•DateTime!
non-null

The date and time when the billing attempt was created.

•ID!
non-null

A globally-unique ID.

•String!
non-null

A unique key generated by the client to avoid duplicate payments.

•URL

The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow.

•Order

The result of this billing attempt if completed successfully.

•DateTime

The date and time used to calculate fulfillment intervals for a billing attempt that successfully completed after the current anchor date. To prevent fulfillment from being pushed to the next anchor date, this field can override the billing attempt date.

•String

The reference shared between retried payment attempts.

•String

The reference shared between payment attempts with similar payment details.

•SubscriptionBillingAttemptProcessingError

Error information from processing the billing attempt.

•Boolean!
non-null

Whether the billing attempt is still processing.

Anchor to respectInventoryPolicyrespectInventoryPolicy
•Boolean!
non-null

Whether the billing attempt respects the merchant's inventory policy.

Anchor to subscriptionContractsubscriptionContract
•SubscriptionContract!
non-null

The subscription contract.

•OrderTransactionConnection!
non-null

The transactions created by the billing attempt.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.


Deprecated fields

•SubscriptionBillingAttemptErrorCode
Deprecated
•String
Deprecated

Was this section helpful?

•query

Returns a SubscriptionBillingAttempt resource by ID.

Arguments

•ID!
required

The ID of the SubscriptionBillingAttempt to return.


•query

Returns subscription billing attempts on a store.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•SubscriptionBillingAttemptsSortKeys
Default:CREATED_AT

Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.

•String

A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.

Anchor to created_at
•time
Anchor to error_code
•string
Anchor to error_message
•string
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234


Was this section helpful?

•mutation

Creates a billing attempt to charge for a SubscriptionContract. The mutation processes either the payment for the current billing cycle or for a specific cycle, if selected.

The mutation creates an Order when successful. Failed billing attempts include a processingError field with error details.


Tip

Use the idempotencyKey to ensure the billing attempt executes only once, preventing duplicate charges if the request is retried.


You can target a specific billing cycle using the billingCycleSelector to bill past or future cycles. The originTime parameter adjusts fulfillment scheduling for attempts completed after the expected billing date.

Learn more about creating billing attempts.

Arguments

Anchor to subscriptionContractIdsubscriptionContractId
•ID!
required

The ID of the subscription contract.

Anchor to subscriptionBillingAttemptInputsubscriptionBillingAttemptInput
•SubscriptionBillingAttemptInput!
required

The information to apply as a billing attempt.


•mutation

Creates a new subscription billing attempt for a specified billing cycle. This is the alternative mutation for subscriptionBillingAttemptCreate. For more information, refer to Create a subscription contract.

Arguments

Anchor to subscriptionContractIdsubscriptionContractId
•ID!
required

The ID of the subscription contract.

Anchor to billingCycleSelectorbillingCycleSelector
•SubscriptionBillingCycleSelector!
required

Select the specific billing cycle to be billed. If the selected billing cycle's billingAttemptExpectedDate is in the past, the originTime of the billing attempt will be set to this date. However, if the billingAttemptExpectedDate is in the future, the originTime will be the current time.

•SubscriptionBillingAttemptInventoryPolicy
Default:PRODUCT_VARIANT_INVENTORY_POLICY

The behaviour to use when updating inventory.



Was this section helpful?

•interface

Was this section helpful?