# subscriptionContract - admin-graphql - QUERY Version: 2024-10 ## Description Returns a Subscription Contract resource by ID. ### Access Scopes ## Arguments * [id](/docs/api/admin-graphql/2024-10/scalars/ID): ID! - The ID of the Subscription Contract to return. ## Returns * [app](/docs/api/admin-graphql/2024-10/objects/App): App The subscription app that the subscription contract is registered to. * [appAdminUrl](/docs/api/admin-graphql/2024-10/scalars/URL): URL The URL of the subscription contract page on the subscription app. * [billingPolicy](/docs/api/admin-graphql/2024-10/objects/SubscriptionBillingPolicy): SubscriptionBillingPolicy! The billing policy associated with the subscription contract. * [createdAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime! The date and time when the subscription contract was created. * [currencyCode](/docs/api/admin-graphql/2024-10/enums/CurrencyCode): CurrencyCode! The currency that's used for the subscription contract. * [customAttributes](/docs/api/admin-graphql/2024-10/objects/Attribute): Attribute! A list of the custom attributes to be added to the generated orders. * [customer](/docs/api/admin-graphql/2024-10/objects/Customer): Customer The customer to whom the subscription contract belongs. * [customerPaymentMethod](/docs/api/admin-graphql/2024-10/objects/CustomerPaymentMethod): CustomerPaymentMethod The customer payment method that's used for the subscription contract. * [deliveryMethod](/docs/api/admin-graphql/2024-10/unions/SubscriptionDeliveryMethod): SubscriptionDeliveryMethod The delivery method for each billing of the subscription contract. * [deliveryPolicy](/docs/api/admin-graphql/2024-10/objects/SubscriptionDeliveryPolicy): SubscriptionDeliveryPolicy! The delivery policy associated with the subscription contract. * [deliveryPrice](/docs/api/admin-graphql/2024-10/objects/MoneyV2): MoneyV2! The delivery price for each billing of the subscription contract. * [id](/docs/api/admin-graphql/2024-10/scalars/ID): ID! A globally-unique ID. * [lastBillingAttemptErrorType](/docs/api/admin-graphql/2024-10/enums/SubscriptionContractLastBillingErrorType): SubscriptionContractLastBillingErrorType The last billing error type of the contract. * [lastPaymentStatus](/docs/api/admin-graphql/2024-10/enums/SubscriptionContractLastPaymentStatus): SubscriptionContractLastPaymentStatus The current status of the last payment. * [lineCount](/docs/api/admin-graphql/2024-10/scalars/Int): Int! The number of lines associated with the subscription contract. * [linesCount](/docs/api/admin-graphql/2024-10/objects/Count): Count The number of lines associated with the subscription contract. * [nextBillingDate](/docs/api/admin-graphql/2024-10/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/2024-10/scalars/String): String The note field that will be applied to the generated orders. * [originOrder](/docs/api/admin-graphql/2024-10/objects/Order): Order The order from which this contract originated. * [revisionId](/docs/api/admin-graphql/2024-10/scalars/UnsignedInt64): UnsignedInt64! The revision id of the contract. * [status](/docs/api/admin-graphql/2024-10/enums/SubscriptionContractSubscriptionStatus): SubscriptionContractSubscriptionStatus! The current status of the subscription contract. * [updatedAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime! The date and time when the subscription contract was updated. ## Examples ### Query for a subscription contract Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/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" } } }