Skip to main content
This guide walks you through authenticating and making your first API request.

Prerequisites

  • An active Appfox Subscriptions installation
  • The Enterprise plan (external API access is Enterprise-only)
  • At least one active subscription contract in your shop

Step 1: Generate an API key

  1. Open the Appfox Subscriptions app in your Shopify admin
  2. Click API in the sidebar
  3. Click Generate key
  4. Copy the key that starts with afx_live_ — you’ll only see it once
Store the key securely in your server-side environment (e.g., as an environment variable or in a secrets manager).

Step 2: Get a contract ID

You’ll need a subscription contract ID to test with. You can find contract IDs in:
  • The Appfox app under Subscriptions (the numeric ID in the URL or table)
  • Your Shopify admin under Orders → Subscriptions
  • Shopify’s Admin GraphQL API
For this example, we’ll use contract ID 123456789.

Step 3: Pause a subscription

Try pausing a subscription with a 30-day resumption:
Replace:
  • afx_live_YOUR_KEY_HERE with your actual API key
  • 123456789 with a real contract ID
  • 2026-10-01T09:00:00Z with a future date (up to 60 days from now)

Expected response

The subscription is now paused and will automatically resume at the scheduled time.

Step 4: Resume immediately

To resume the subscription before the scheduled time:

Expected response

Common issues

401 Unauthorized: Check that your API key is correct and hasn’t been revoked. 403 Forbidden: Verify that your shop is on the Enterprise plan. 404 Not Found: Make sure the contract ID exists and belongs to the shop that generated the API key. 422 Invalid Resume Time: Ensure resumeAt is:
  • A valid ISO-8601 timestamp
  • In the future
  • No more than 60 days from now

Next steps

Authentication

Learn about key management and security best practices

Contract actions

View full documentation for all contract actions