# SubscriptionContract - admin-graphql - OBJECT
Version: 2025-01

## Description
Represents a Subscription Contract.

### Access Scopes
the `read_own_subscription_contracts` or `write_own_subscription_contracts` scope.


## Fields
* [app](/docs/api/admin-graphql/2025-01/objects/App): App - The subscription app that the subscription contract is registered to.
* [appAdminUrl](/docs/api/admin-graphql/2025-01/scalars/URL): URL - The URL of the subscription contract page on the subscription app.
* [billingPolicy](/docs/api/admin-graphql/2025-01/objects/SubscriptionBillingPolicy): SubscriptionBillingPolicy! - The billing policy associated with the subscription contract.
* [createdAt](/docs/api/admin-graphql/2025-01/scalars/DateTime): DateTime! - The date and time when the subscription contract was created.
* [currencyCode](/docs/api/admin-graphql/2025-01/enums/CurrencyCode): CurrencyCode! - The currency that's used for the subscription contract.
* [customAttributes](/docs/api/admin-graphql/2025-01/objects/Attribute): Attribute! - A list of the custom attributes to be added to the generated orders.
* [customer](/docs/api/admin-graphql/2025-01/objects/Customer): Customer - The customer to whom the subscription contract belongs.
* [customerPaymentMethod](/docs/api/admin-graphql/2025-01/objects/CustomerPaymentMethod): CustomerPaymentMethod - The customer payment method that's used for the subscription contract.
* [deliveryMethod](/docs/api/admin-graphql/2025-01/unions/SubscriptionDeliveryMethod): SubscriptionDeliveryMethod - The delivery method for each billing of the subscription contract.
* [deliveryPolicy](/docs/api/admin-graphql/2025-01/objects/SubscriptionDeliveryPolicy): SubscriptionDeliveryPolicy! - The delivery policy associated with the subscription contract.
* [deliveryPrice](/docs/api/admin-graphql/2025-01/objects/MoneyV2): MoneyV2! - The delivery price for each billing of the subscription contract.
* [id](/docs/api/admin-graphql/2025-01/scalars/ID): ID! - A globally-unique ID.
* [lastBillingAttemptErrorType](/docs/api/admin-graphql/2025-01/enums/SubscriptionContractLastBillingErrorType): SubscriptionContractLastBillingErrorType - The last billing error type of the contract.
* [lastPaymentStatus](/docs/api/admin-graphql/2025-01/enums/SubscriptionContractLastPaymentStatus): SubscriptionContractLastPaymentStatus - The current status of the last payment.
* [lineCount](/docs/api/admin-graphql/2025-01/scalars/Int): Int! - The number of lines associated with the subscription contract.
* [linesCount](/docs/api/admin-graphql/2025-01/objects/Count): Count - The number of lines associated with the subscription contract.
* [nextBillingDate](/docs/api/admin-graphql/2025-01/scalars/DateTime): DateTime - The next billing date for the subscription contract. This field is managed by the apps.
        Alternatively you can utilize our
        [Billing Cycles APIs](https://shopify.dev/docs/apps/selling-strategies/subscriptions/billing-cycles),
        which provide auto-computed billing dates and additional functionalities.
* [note](/docs/api/admin-graphql/2025-01/scalars/String): String - The note field that will be applied to the generated orders.
* [originOrder](/docs/api/admin-graphql/2025-01/objects/Order): Order - The order from which this contract originated.
* [revisionId](/docs/api/admin-graphql/2025-01/scalars/UnsignedInt64): UnsignedInt64! - The revision id of the contract.
* [status](/docs/api/admin-graphql/2025-01/enums/SubscriptionContractSubscriptionStatus): SubscriptionContractSubscriptionStatus! - The current status of the subscription contract.
* [updatedAt](/docs/api/admin-graphql/2025-01/scalars/DateTime): DateTime! - The date and time when the subscription contract was updated.

## Connections
* [billingAttempts](/docs/api/admin-graphql/2025-01/connections/SubscriptionBillingAttemptConnection): SubscriptionBillingAttemptConnection!
* [discounts](/docs/api/admin-graphql/2025-01/connections/SubscriptionManualDiscountConnection): SubscriptionManualDiscountConnection!
* [lines](/docs/api/admin-graphql/2025-01/connections/SubscriptionLineConnection): SubscriptionLineConnection!
* [orders](/docs/api/admin-graphql/2025-01/connections/OrderConnection): OrderConnection!



## Related queries
* [subscriptionContract](/docs/api/admin-graphql/2025-01/queries/subscriptionContract) Returns a Subscription Contract resource by ID.
* [subscriptionContracts](/docs/api/admin-graphql/2025-01/queries/subscriptionContracts) List Subscription Contracts.

## Related mutations
* [subscriptionContractActivate](/docs/api/admin-graphql/2025-01/mutations/subscriptionContractActivate) Activates a Subscription Contract. Contract status must be either active, paused, or failed.
* [subscriptionContractAtomicCreate](/docs/api/admin-graphql/2025-01/mutations/subscriptionContractAtomicCreate) Creates a Subscription Contract.
* [subscriptionContractCancel](/docs/api/admin-graphql/2025-01/mutations/subscriptionContractCancel) Cancels a Subscription Contract.
* [subscriptionContractExpire](/docs/api/admin-graphql/2025-01/mutations/subscriptionContractExpire) Expires a Subscription Contract.
* [subscriptionContractFail](/docs/api/admin-graphql/2025-01/mutations/subscriptionContractFail) Fails a Subscription Contract.
* [subscriptionContractPause](/docs/api/admin-graphql/2025-01/mutations/subscriptionContractPause) Pauses a Subscription Contract.
* [subscriptionContractProductChange](/docs/api/admin-graphql/2025-01/mutations/subscriptionContractProductChange) Allows for the easy change of a Product in a Contract or a Product price change.
* [subscriptionContractSetNextBillingDate](/docs/api/admin-graphql/2025-01/mutations/subscriptionContractSetNextBillingDate) Sets the next billing date of a Subscription Contract. This field is managed by the apps.
        Alternatively you can utilize our
        [Billing Cycles APIs](https://shopify.dev/docs/apps/selling-strategies/subscriptions/billing-cycles),
        which provide auto-computed billing dates and additional functionalities.
* [subscriptionDraftCommit](/docs/api/admin-graphql/2025-01/mutations/subscriptionDraftCommit) Commits the updates of a Subscription Contract draft.

## Related Unions

## Examples
### Query for a subscription contract
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query findContract($subscriptionContractId: ID!) { subscriptionContract(id: $subscriptionContractId) { id status nextBillingDate } }\",\n \"variables\": {\n    \"subscriptionContractId\": \"gid://shopify/SubscriptionContract/593791907\"\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `query findContract($subscriptionContractId: ID!) {\n      subscriptionContract(id: $subscriptionContractId) {\n        id\n        status\n        nextBillingDate\n      }\n    }`,\n    \"variables\": {\n      \"subscriptionContractId\": \"gid://shopify/SubscriptionContract/593791907\"\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  query findContract($subscriptionContractId: ID!) {\n    subscriptionContract(id: $subscriptionContractId) {\n      id\n      status\n      nextBillingDate\n    }\n  }\nQUERY\n\nvariables = {\n  \"subscriptionContractId\": \"gid://shopify/SubscriptionContract/593791907\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  query findContract($subscriptionContractId: ID!) {\n    subscriptionContract(id: $subscriptionContractId) {\n      id\n      status\n      nextBillingDate\n    }\n  }`,\n  {\n    variables: {\n      \"subscriptionContractId\": \"gid://shopify/SubscriptionContract/593791907\"\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "query findContract($subscriptionContractId: ID!) {\n  subscriptionContract(id: $subscriptionContractId) {\n    id\n    status\n    nextBillingDate\n  }\n}"
#### Graphql Input
{
  "subscriptionContractId": "gid://shopify/SubscriptionContract/593791907"
}
#### Graphql Response
{
  "data": {
    "subscriptionContract": {
      "id": "gid://shopify/SubscriptionContract/593791907",
      "status": "ACTIVE",
      "nextBillingDate": "2120-02-05T15:00:00Z"
    }
  }
}