Get raw Shopify GraphQL contract response
Retrieves the complete, unprocessed subscription contract data directly from Shopify’s GraphQL API. This endpoint returns the full Shopify subscription contract object exactly as Shopify provides it, including all nested fields, relationships, and GraphQL metadata.
Full behavior, validation rules, and side effects
What This Endpoint Returns: Unlike processed/transformed endpoints, this returns Shopify’s raw SubscriptionContract GraphQL object with all available fields. This is the same data structure you would receive if querying Shopify’s GraphQL API directly, making it ideal for:
- Debugging Shopify data synchronization issues
- Accessing fields not exposed in other endpoints
- Understanding complete Shopify contract structure
- Building custom integrations requiring full data
- Comparing Shopify source data with processed data
Data Included:
Contract Core:
- Full subscription contract object from Shopify
- All GraphQL __typename fields preserved
- Complete nested object structures
- All available Shopify contract fields
Customer Information:
- Complete customer object with all fields
- Default address details
- Customer tags and metadata
- Marketing preferences
Line Items:
- Full line item details with edges/nodes structure
- Product and variant complete objects
- Pricing policies with all cycle discounts
- Line item custom attributes
- Current and original prices
Billing & Delivery:
- Complete billing policy object
- Full delivery policy details
- Delivery method with all fields
- Delivery price breakdown
- Billing anchor details
Payment Information:
- Payment method details (if available)
- Customer payment instrument
- Payment gateway information
Orders & History:
- Origin order details
- Last payment status
- Historical billing attempts (in Appstle)
Use Cases:
1. Debugging & Troubleshooting:
- Investigate data sync discrepancies
- Verify what Shopify actually stores
- Debug webhook payload issues
- Compare expected vs actual data
2. Advanced Integrations:
- Access Shopify-specific fields not in standard APIs
- Build custom analytics using raw data
- Integrate with Shopify GraphQL directly
- Extract fields for custom processing
3. Data Analysis:
- Analyze complete contract structure
- Extract all available metadata
- Build comprehensive data exports
- Perform deep data audits
4. Development & Testing:
- Understand Shopify’s data model
- Test new feature development
- Verify API responses
- Documentation and examples
Response Structure:
Returns SubscriptionContractQuery.SubscriptionContract object:
{
"id": "gid://shopify/SubscriptionContract/123456789",
"status": "ACTIVE",
"nextBillingDate": "2024-03-15T00:00:00Z",
"customer": {
"id": "gid://shopify/Customer/987654321",
"email": "customer@example.com",
"displayName": "John Doe",
"__typename": "Customer"
},
"lines": {
"edges": [
{
"node": {
"id": "gid://shopify/SubscriptionLine/111111",
"quantity": 2,
"variantId": "gid://shopify/ProductVariant/222222",
"title": "Monthly Coffee Box",
"variantTitle": "Medium Roast",
"currentPrice": {
"amount": "29.99",
"currencyCode": "USD"
},
"pricingPolicy": {...},
"__typename": "SubscriptionLine"
}
}
]
},
"billingPolicy": {
"interval": "MONTH",
"intervalCount": 1,
"minCycles": 3,
"maxCycles": 12
},
"deliveryPolicy": {...},
"deliveryMethod": {...},
"__typename": "SubscriptionContract"
}
Important Considerations:
Data Source:
- Queries Shopify GraphQL API in real-time
- NOT cached in Appstle database
- Always returns current Shopify state
- Subject to Shopify API rate limits
Performance:
- Slower than database queries (500-1500ms typical)
- Makes real-time call to Shopify
- Response size can be large (10-50 KB)
- Use sparingly to avoid rate limits
GraphQL Structure:
- Includes __typename fields throughout
- Uses GraphQL ID format (gid://shopify/…)
- Nested edges/nodes structure for lists
- All fields as defined in Shopify’s schema
Best Practices:
- Use for Debugging: Perfect for troubleshooting data issues
- Avoid Polling: Don’t call repeatedly - use cached/processed endpoints instead
- Cache Response: Cache the response if using for display
- Parse Carefully: Handle GraphQL structure (edges/nodes)
- Monitor Rate Limits: Each call counts against Shopify API limits
When to Use vs Other Endpoints:
Use this endpoint when:
- Need complete Shopify contract data
- Debugging synchronization issues
- Accessing Shopify-specific fields
- Building Shopify GraphQL integrations
Use /api/external/v2/subscription-contract-details when:
- Need processed, filtered contract data
- Want faster response times
- Querying multiple contracts
- Building customer-facing UIs
Authentication: Requires valid X-API-Key header
Documentation Index
Fetch the complete documentation index at: https://developers.appstle.com/llms.txt
Use this file to discover all available pages before exploring further.
Headers
Path Parameters
Contract ID
Query Parameters
API Key (Deprecated - Use Header X-API-Key instead)
Response
Successfully retrieved raw Shopify contract data
ACTIVE, PAUSED, CANCELLED, EXPIRED, FAILED, $UNKNOWN SUCCEEDED, FAILED, $UNKNOWN