Core customer portal APIs for managing customer account settings, authentication, and portal configurations.
- Update subscription billing attempt
Customer Portal APIs (0.0.1)
Comprehensive API documentation for the customer-facing subscription portal. These APIs enable customers to manage their subscriptions, update billing information, modify delivery schedules, and access their account details through your storefront.
Important: These APIs must be called from your shop's domain (e.g., https://www.myshop.com/apps/subscriptions/cp/api/**) and require customer authentication. Unauthenticated requests will return a 401 Unauthorized error.
Request
Immediately processes a billing attempt, creating an order in Shopify. This bypasses the scheduled billing date and processes the order right away.
Important Notes:
- Requires shop permission 'enableImmediatePlaceOrder'
- Only QUEUED billing attempts can be processed
- Creates an actual order in Shopify
- Charges the customer's payment method immediately
- Cannot be undone once processed
Use Cases:
- Customer requests early delivery
- Process order immediately after resolving payment issue
- Manual order processing for special cases
Authentication: Requires valid X-API-Key header and shop permission
- https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/attempt-billing/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/attempt-billing/{id}'Request
Updates an existing subscription billing attempt. This endpoint allows modification of billing attempt details such as billing date, order note, and other attributes.
Important Notes:
- Only QUEUED billing attempts can be updated
- Cannot update attempts that are already processed or failed
- Billing attempt must belong to the authenticated shop
Authentication: Requires valid X-API-Key header
- https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts \
-H 'Content-Type: application/json' \
-d '{
"id": 0,
"shop": "string",
"billingAttemptId": "string",
"status": "SUCCESS",
"billingDate": "2019-08-24T14:15:22Z",
"contractId": 0,
"attemptCount": 0,
"attemptTime": "2019-08-24T14:15:22Z",
"graphOrderId": "string",
"orderId": 0,
"orderAmount": 0.1,
"orderName": "string",
"retryingNeeded": true,
"transactionFailedEmailSentStatus": "SENT",
"upcomingOrderEmailSentStatus": "SENT",
"applyUsageCharge": true,
"recurringChargeId": 0,
"transactionRate": 0.1,
"usageChargeStatus": "SUCCESS",
"transactionFailedSmsSentStatus": "SENT",
"upcomingOrderSmsSentStatus": "SENT",
"billingAttemptResponseMessage": "string",
"progressAttemptCount": 0,
"orderNote": "string",
"variantList": [
{
"variantId": 0,
"quantity": 0,
"title": "string",
"image": "string",
"productTitle": "string",
"productId": "string",
"variantTitle": "string",
"swapId": 0
}
],
"securityChallengeSentStatus": "SENT",
"orderAmountUSD": 0.1,
"orderCancelReason": "CUSTOMER",
"orderCancelledAt": "2019-08-24T14:15:22Z",
"orderClosed": true,
"orderClosedAt": "2019-08-24T14:15:22Z",
"orderConfirmed": true,
"orderDisplayFinancialStatus": "PENDING",
"orderDisplayFulfillmentStatus": "UNFULFILLED",
"orderProcessedAt": "2019-08-24T14:15:22Z",
"lastShippingUpdatedAt": "2019-08-24T14:15:22Z",
"inventorySkippedAttemptCount": 0,
"inventorySkippedRetryingNeeded": true,
"orderAttributes": [
{
"key": "string",
"value": "string"
}
],
"partialLinesSkipped": "INVENTORY_MANAGEMENT",
"orderAmountContractCurrency": 0.1
}'Billing attempt successfully updated
{ "id": 0, "shop": "string", "billingAttemptId": "string", "status": "SUCCESS", "billingDate": "2019-08-24T14:15:22Z", "contractId": 0, "attemptCount": 0, "attemptTime": "2019-08-24T14:15:22Z", "graphOrderId": "string", "orderId": 0, "orderAmount": 0.1, "orderName": "string", "retryingNeeded": true, "transactionFailedEmailSentStatus": "SENT", "upcomingOrderEmailSentStatus": "SENT", "applyUsageCharge": true, "recurringChargeId": 0, "transactionRate": 0.1, "usageChargeStatus": "SUCCESS", "transactionFailedSmsSentStatus": "SENT", "upcomingOrderSmsSentStatus": "SENT", "billingAttemptResponseMessage": "string", "progressAttemptCount": 0, "orderNote": "string", "variantList": [ { … } ], "securityChallengeSentStatus": "SENT", "orderAmountUSD": 0.1, "orderCancelReason": "CUSTOMER", "orderCancelledAt": "2019-08-24T14:15:22Z", "orderClosed": true, "orderClosedAt": "2019-08-24T14:15:22Z", "orderConfirmed": true, "orderDisplayFinancialStatus": "PENDING", "orderDisplayFulfillmentStatus": "UNFULFILLED", "orderProcessedAt": "2019-08-24T14:15:22Z", "lastShippingUpdatedAt": "2019-08-24T14:15:22Z", "inventorySkippedAttemptCount": 0, "inventorySkippedRetryingNeeded": true, "orderAttributes": [ { … } ], "partialLinesSkipped": "INVENTORY_MANAGEMENT", "orderAmountContractCurrency": 0.1 }
Request
Retrieves upcoming (queued) billing attempts for a subscription contract or customer. Returns the next scheduled orders that have not yet been processed.
Query Options:
- Filter by contract ID to see upcoming orders for a specific subscription
- Filter by customer ID to see all upcoming orders for a customer
- Results are ordered by billing date (earliest first)
Use Cases:
- Display "Your Next Order" in customer portal
- Show upcoming delivery schedule
- Calculate upcoming charges
- Preview next order contents
Authentication: Requires valid X-API-Key header
- https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/top-orders
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/top-orders?contractId=0'Successfully retrieved upcoming orders
[ { "id": 0, "shop": "string", "billingAttemptId": "string", "status": "SUCCESS", "billingDate": "2019-08-24T14:15:22Z", "contractId": 0, "attemptCount": 0, "attemptTime": "2019-08-24T14:15:22Z", "graphOrderId": "string", "orderId": 0, "orderAmount": 0.1, "orderName": "string", "retryingNeeded": true, "transactionFailedEmailSentStatus": "SENT", "upcomingOrderEmailSentStatus": "SENT", "applyUsageCharge": true, "recurringChargeId": 0, "transactionRate": 0.1, "usageChargeStatus": "SUCCESS", "transactionFailedSmsSentStatus": "SENT", "upcomingOrderSmsSentStatus": "SENT", "billingAttemptResponseMessage": "string", "progressAttemptCount": 0, "orderNote": "string", "variantList": [ … ], "securityChallengeSentStatus": "SENT", "orderAmountUSD": 0.1, "orderCancelReason": "CUSTOMER", "orderCancelledAt": "2019-08-24T14:15:22Z", "orderClosed": true, "orderClosedAt": "2019-08-24T14:15:22Z", "orderConfirmed": true, "orderDisplayFinancialStatus": "PENDING", "orderDisplayFulfillmentStatus": "UNFULFILLED", "orderProcessedAt": "2019-08-24T14:15:22Z", "lastShippingUpdatedAt": "2019-08-24T14:15:22Z", "inventorySkippedAttemptCount": 0, "inventorySkippedRetryingNeeded": true, "orderAttributes": [ … ], "partialLinesSkipped": "INVENTORY_MANAGEMENT", "orderAmountContractCurrency": 0.1 } ]