Billing & Payments
Get upcoming orders (top orders)
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
GET
/
api
/
external
/
v2
/
subscription-billing-attempts
/
top-orders
Get upcoming orders (top orders)
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-ordersimport requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders';
const options = {method: 'GET'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"retryingNeeded": true,
"shop": "<string>",
"applyUsageCharge": true,
"attemptCount": 123,
"attemptTime": "2023-11-07T05:31:56Z",
"billingAttemptId": "<string>",
"billingAttemptResponseMessage": "<string>",
"billingDate": "2023-11-07T05:31:56Z",
"contractId": 123,
"graphOrderId": "<string>",
"id": 123,
"inventorySkippedAttemptCount": 123,
"inventorySkippedRetryingNeeded": true,
"lastShippingUpdatedAt": "2023-11-07T05:31:56Z",
"orderAmount": 123,
"orderAmountContractCurrency": 123,
"orderAmountShopCurrency": 123,
"orderAmountUSD": 123,
"orderAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderCancelReason": "CUSTOMER",
"orderCancelledAt": "2023-11-07T05:31:56Z",
"orderClosed": true,
"orderClosedAt": "2023-11-07T05:31:56Z",
"orderConfirmed": true,
"orderDisplayFinancialStatus": "PENDING",
"orderDisplayFulfillmentStatus": "UNFULFILLED",
"orderId": 123,
"orderName": "<string>",
"orderNote": "<string>",
"orderProcessedAt": "2023-11-07T05:31:56Z",
"partialLinesSkipped": "INVENTORY_MANAGEMENT",
"progressAttemptCount": 123,
"recurringChargeId": 123,
"securityChallengeSentStatus": "SENT",
"status": "SUCCESS",
"transactionFailedEmailSentStatus": "SENT",
"transactionFailedSmsSentStatus": "SENT",
"transactionRate": 123,
"upcomingOrderEmailSentStatus": "SENT",
"upcomingOrderSmsSentStatus": "SENT",
"usageChargeStatus": "SUCCESS",
"variantList": [
{
"image": "<string>",
"productId": "<string>",
"productTitle": "<string>",
"quantity": 123,
"swapId": 123,
"title": "<string>",
"variantId": 123,
"variantTitle": "<string>"
}
]
}
][
{
"retryingNeeded": true,
"shop": "<string>",
"applyUsageCharge": true,
"attemptCount": 123,
"attemptTime": "2023-11-07T05:31:56Z",
"billingAttemptId": "<string>",
"billingAttemptResponseMessage": "<string>",
"billingDate": "2023-11-07T05:31:56Z",
"contractId": 123,
"graphOrderId": "<string>",
"id": 123,
"inventorySkippedAttemptCount": 123,
"inventorySkippedRetryingNeeded": true,
"lastShippingUpdatedAt": "2023-11-07T05:31:56Z",
"orderAmount": 123,
"orderAmountContractCurrency": 123,
"orderAmountShopCurrency": 123,
"orderAmountUSD": 123,
"orderAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderCancelReason": "CUSTOMER",
"orderCancelledAt": "2023-11-07T05:31:56Z",
"orderClosed": true,
"orderClosedAt": "2023-11-07T05:31:56Z",
"orderConfirmed": true,
"orderDisplayFinancialStatus": "PENDING",
"orderDisplayFulfillmentStatus": "UNFULFILLED",
"orderId": 123,
"orderName": "<string>",
"orderNote": "<string>",
"orderProcessedAt": "2023-11-07T05:31:56Z",
"partialLinesSkipped": "INVENTORY_MANAGEMENT",
"progressAttemptCount": 123,
"recurringChargeId": 123,
"securityChallengeSentStatus": "SENT",
"status": "SUCCESS",
"transactionFailedEmailSentStatus": "SENT",
"transactionFailedSmsSentStatus": "SENT",
"transactionRate": 123,
"upcomingOrderEmailSentStatus": "SENT",
"upcomingOrderSmsSentStatus": "SENT",
"usageChargeStatus": "SUCCESS",
"variantList": [
{
"image": "<string>",
"productId": "<string>",
"productTitle": "<string>",
"quantity": 123,
"swapId": 123,
"title": "<string>",
"variantId": 123,
"variantTitle": "<string>"
}
]
}
][
{
"retryingNeeded": true,
"shop": "<string>",
"applyUsageCharge": true,
"attemptCount": 123,
"attemptTime": "2023-11-07T05:31:56Z",
"billingAttemptId": "<string>",
"billingAttemptResponseMessage": "<string>",
"billingDate": "2023-11-07T05:31:56Z",
"contractId": 123,
"graphOrderId": "<string>",
"id": 123,
"inventorySkippedAttemptCount": 123,
"inventorySkippedRetryingNeeded": true,
"lastShippingUpdatedAt": "2023-11-07T05:31:56Z",
"orderAmount": 123,
"orderAmountContractCurrency": 123,
"orderAmountShopCurrency": 123,
"orderAmountUSD": 123,
"orderAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderCancelReason": "CUSTOMER",
"orderCancelledAt": "2023-11-07T05:31:56Z",
"orderClosed": true,
"orderClosedAt": "2023-11-07T05:31:56Z",
"orderConfirmed": true,
"orderDisplayFinancialStatus": "PENDING",
"orderDisplayFulfillmentStatus": "UNFULFILLED",
"orderId": 123,
"orderName": "<string>",
"orderNote": "<string>",
"orderProcessedAt": "2023-11-07T05:31:56Z",
"partialLinesSkipped": "INVENTORY_MANAGEMENT",
"progressAttemptCount": 123,
"recurringChargeId": 123,
"securityChallengeSentStatus": "SENT",
"status": "SUCCESS",
"transactionFailedEmailSentStatus": "SENT",
"transactionFailedSmsSentStatus": "SENT",
"transactionRate": 123,
"upcomingOrderEmailSentStatus": "SENT",
"upcomingOrderSmsSentStatus": "SENT",
"usageChargeStatus": "SUCCESS",
"variantList": [
{
"image": "<string>",
"productId": "<string>",
"productTitle": "<string>",
"quantity": 123,
"swapId": 123,
"title": "<string>",
"variantId": 123,
"variantTitle": "<string>"
}
]
}
][
{
"retryingNeeded": true,
"shop": "<string>",
"applyUsageCharge": true,
"attemptCount": 123,
"attemptTime": "2023-11-07T05:31:56Z",
"billingAttemptId": "<string>",
"billingAttemptResponseMessage": "<string>",
"billingDate": "2023-11-07T05:31:56Z",
"contractId": 123,
"graphOrderId": "<string>",
"id": 123,
"inventorySkippedAttemptCount": 123,
"inventorySkippedRetryingNeeded": true,
"lastShippingUpdatedAt": "2023-11-07T05:31:56Z",
"orderAmount": 123,
"orderAmountContractCurrency": 123,
"orderAmountShopCurrency": 123,
"orderAmountUSD": 123,
"orderAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderCancelReason": "CUSTOMER",
"orderCancelledAt": "2023-11-07T05:31:56Z",
"orderClosed": true,
"orderClosedAt": "2023-11-07T05:31:56Z",
"orderConfirmed": true,
"orderDisplayFinancialStatus": "PENDING",
"orderDisplayFulfillmentStatus": "UNFULFILLED",
"orderId": 123,
"orderName": "<string>",
"orderNote": "<string>",
"orderProcessedAt": "2023-11-07T05:31:56Z",
"partialLinesSkipped": "INVENTORY_MANAGEMENT",
"progressAttemptCount": 123,
"recurringChargeId": 123,
"securityChallengeSentStatus": "SENT",
"status": "SUCCESS",
"transactionFailedEmailSentStatus": "SENT",
"transactionFailedSmsSentStatus": "SENT",
"transactionRate": 123,
"upcomingOrderEmailSentStatus": "SENT",
"upcomingOrderSmsSentStatus": "SENT",
"usageChargeStatus": "SUCCESS",
"variantList": [
{
"image": "<string>",
"productId": "<string>",
"productTitle": "<string>",
"quantity": 123,
"swapId": 123,
"title": "<string>",
"variantId": 123,
"variantTitle": "<string>"
}
]
}
]Headers
Query Parameters
API Key (Deprecated - Use Header X-API-Key instead)
Contract ID
Customer ID
Response
Successfully retrieved upcoming orders
Show child attributes
Show child attributes
Available options:
CUSTOMER, DECLINED, FRAUD, INVENTORY, STAFF, OTHER, $UNKNOWN Available options:
PENDING, AUTHORIZED, PARTIALLY_PAID, PARTIALLY_REFUNDED, VOIDED, PAID, REFUNDED, EXPIRED, $UNKNOWN Available options:
UNFULFILLED, PARTIALLY_FULFILLED, FULFILLED, RESTOCKED, PENDING_FULFILLMENT, OPEN, IN_PROGRESS, ON_HOLD, SCHEDULED, REQUEST_DECLINED, $UNKNOWN Available options:
INVENTORY_MANAGEMENT, MANUAL, ORPHANED_FREE_PRODUCT Available options:
SENT, UNSENT, FAILED, EMAIL_SETTINGS_DISABLED, CONTRACT_CANCELLED Available options:
SUCCESS, FAILURE, REQUESTING, PROGRESS, QUEUED, SKIPPED, SOCIAL_CONNECTION_NULL, CONTRACT_CANCELLED, CONTRACT_ENDED, CONTRACT_PAUSED, AUTO_CHARGE_DISABLED, SHOPIFY_EXCEPTION, SKIPPED_DUNNING_MGMT, SKIPPED_INVENTORY_MGMT, IMMEDIATE_TRIGGERED, SECURITY_CHALLENGE, CONTRACT_PAUSED_MAX_CYCLES, REFUNDED, SKIPPED_DEMO_SHOP, SKIPPED_SHOP_INFO_NOT_FOUND, SKIPPED_BILLING_DATE_STALE, SKIPPED_DUNNING_NOT_CONFIGURED, PENDING_CONSOLIDATION Available options:
SENT, UNSENT, FAILED, EMAIL_SETTINGS_DISABLED, CUSTOMER_PAYMENT_EMPTY, CONTRACT_CANCELLED Available options:
SENT, UNSENT, FAILED, SMS_SETTINGS_DISABLED, CUSTOMER_PAYMENT_EMPTY, CONTRACT_CANCELLED, PHONE_NUMBER_EMPTY Available options:
SENT, UNSENT, FAILED, EMAIL_SETTINGS_DISABLED, CUSTOMER_PAYMENT_EMPTY, CONTRACT_CANCELLED, STOP_FROM_CONTRACT, CONTRACT_PAUSED Available options:
SENT, UNSENT, FAILED, SMS_SETTINGS_DISABLED, CUSTOMER_PAYMENT_EMPTY, CONTRACT_CANCELLED, STOP_FROM_CONTRACT, CONTRACT_PAUSED, PHONE_NUMBER_EMPTY Available options:
SUCCESS, FAILED, TO_BE_TRIED Show child attributes
Show child attributes
⌘I
Get upcoming orders (top orders)
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-ordersimport requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders';
const options = {method: 'GET'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-billing-attempts/top-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"retryingNeeded": true,
"shop": "<string>",
"applyUsageCharge": true,
"attemptCount": 123,
"attemptTime": "2023-11-07T05:31:56Z",
"billingAttemptId": "<string>",
"billingAttemptResponseMessage": "<string>",
"billingDate": "2023-11-07T05:31:56Z",
"contractId": 123,
"graphOrderId": "<string>",
"id": 123,
"inventorySkippedAttemptCount": 123,
"inventorySkippedRetryingNeeded": true,
"lastShippingUpdatedAt": "2023-11-07T05:31:56Z",
"orderAmount": 123,
"orderAmountContractCurrency": 123,
"orderAmountShopCurrency": 123,
"orderAmountUSD": 123,
"orderAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderCancelReason": "CUSTOMER",
"orderCancelledAt": "2023-11-07T05:31:56Z",
"orderClosed": true,
"orderClosedAt": "2023-11-07T05:31:56Z",
"orderConfirmed": true,
"orderDisplayFinancialStatus": "PENDING",
"orderDisplayFulfillmentStatus": "UNFULFILLED",
"orderId": 123,
"orderName": "<string>",
"orderNote": "<string>",
"orderProcessedAt": "2023-11-07T05:31:56Z",
"partialLinesSkipped": "INVENTORY_MANAGEMENT",
"progressAttemptCount": 123,
"recurringChargeId": 123,
"securityChallengeSentStatus": "SENT",
"status": "SUCCESS",
"transactionFailedEmailSentStatus": "SENT",
"transactionFailedSmsSentStatus": "SENT",
"transactionRate": 123,
"upcomingOrderEmailSentStatus": "SENT",
"upcomingOrderSmsSentStatus": "SENT",
"usageChargeStatus": "SUCCESS",
"variantList": [
{
"image": "<string>",
"productId": "<string>",
"productTitle": "<string>",
"quantity": 123,
"swapId": 123,
"title": "<string>",
"variantId": 123,
"variantTitle": "<string>"
}
]
}
][
{
"retryingNeeded": true,
"shop": "<string>",
"applyUsageCharge": true,
"attemptCount": 123,
"attemptTime": "2023-11-07T05:31:56Z",
"billingAttemptId": "<string>",
"billingAttemptResponseMessage": "<string>",
"billingDate": "2023-11-07T05:31:56Z",
"contractId": 123,
"graphOrderId": "<string>",
"id": 123,
"inventorySkippedAttemptCount": 123,
"inventorySkippedRetryingNeeded": true,
"lastShippingUpdatedAt": "2023-11-07T05:31:56Z",
"orderAmount": 123,
"orderAmountContractCurrency": 123,
"orderAmountShopCurrency": 123,
"orderAmountUSD": 123,
"orderAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderCancelReason": "CUSTOMER",
"orderCancelledAt": "2023-11-07T05:31:56Z",
"orderClosed": true,
"orderClosedAt": "2023-11-07T05:31:56Z",
"orderConfirmed": true,
"orderDisplayFinancialStatus": "PENDING",
"orderDisplayFulfillmentStatus": "UNFULFILLED",
"orderId": 123,
"orderName": "<string>",
"orderNote": "<string>",
"orderProcessedAt": "2023-11-07T05:31:56Z",
"partialLinesSkipped": "INVENTORY_MANAGEMENT",
"progressAttemptCount": 123,
"recurringChargeId": 123,
"securityChallengeSentStatus": "SENT",
"status": "SUCCESS",
"transactionFailedEmailSentStatus": "SENT",
"transactionFailedSmsSentStatus": "SENT",
"transactionRate": 123,
"upcomingOrderEmailSentStatus": "SENT",
"upcomingOrderSmsSentStatus": "SENT",
"usageChargeStatus": "SUCCESS",
"variantList": [
{
"image": "<string>",
"productId": "<string>",
"productTitle": "<string>",
"quantity": 123,
"swapId": 123,
"title": "<string>",
"variantId": 123,
"variantTitle": "<string>"
}
]
}
][
{
"retryingNeeded": true,
"shop": "<string>",
"applyUsageCharge": true,
"attemptCount": 123,
"attemptTime": "2023-11-07T05:31:56Z",
"billingAttemptId": "<string>",
"billingAttemptResponseMessage": "<string>",
"billingDate": "2023-11-07T05:31:56Z",
"contractId": 123,
"graphOrderId": "<string>",
"id": 123,
"inventorySkippedAttemptCount": 123,
"inventorySkippedRetryingNeeded": true,
"lastShippingUpdatedAt": "2023-11-07T05:31:56Z",
"orderAmount": 123,
"orderAmountContractCurrency": 123,
"orderAmountShopCurrency": 123,
"orderAmountUSD": 123,
"orderAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderCancelReason": "CUSTOMER",
"orderCancelledAt": "2023-11-07T05:31:56Z",
"orderClosed": true,
"orderClosedAt": "2023-11-07T05:31:56Z",
"orderConfirmed": true,
"orderDisplayFinancialStatus": "PENDING",
"orderDisplayFulfillmentStatus": "UNFULFILLED",
"orderId": 123,
"orderName": "<string>",
"orderNote": "<string>",
"orderProcessedAt": "2023-11-07T05:31:56Z",
"partialLinesSkipped": "INVENTORY_MANAGEMENT",
"progressAttemptCount": 123,
"recurringChargeId": 123,
"securityChallengeSentStatus": "SENT",
"status": "SUCCESS",
"transactionFailedEmailSentStatus": "SENT",
"transactionFailedSmsSentStatus": "SENT",
"transactionRate": 123,
"upcomingOrderEmailSentStatus": "SENT",
"upcomingOrderSmsSentStatus": "SENT",
"usageChargeStatus": "SUCCESS",
"variantList": [
{
"image": "<string>",
"productId": "<string>",
"productTitle": "<string>",
"quantity": 123,
"swapId": 123,
"title": "<string>",
"variantId": 123,
"variantTitle": "<string>"
}
]
}
][
{
"retryingNeeded": true,
"shop": "<string>",
"applyUsageCharge": true,
"attemptCount": 123,
"attemptTime": "2023-11-07T05:31:56Z",
"billingAttemptId": "<string>",
"billingAttemptResponseMessage": "<string>",
"billingDate": "2023-11-07T05:31:56Z",
"contractId": 123,
"graphOrderId": "<string>",
"id": 123,
"inventorySkippedAttemptCount": 123,
"inventorySkippedRetryingNeeded": true,
"lastShippingUpdatedAt": "2023-11-07T05:31:56Z",
"orderAmount": 123,
"orderAmountContractCurrency": 123,
"orderAmountShopCurrency": 123,
"orderAmountUSD": 123,
"orderAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderCancelReason": "CUSTOMER",
"orderCancelledAt": "2023-11-07T05:31:56Z",
"orderClosed": true,
"orderClosedAt": "2023-11-07T05:31:56Z",
"orderConfirmed": true,
"orderDisplayFinancialStatus": "PENDING",
"orderDisplayFulfillmentStatus": "UNFULFILLED",
"orderId": 123,
"orderName": "<string>",
"orderNote": "<string>",
"orderProcessedAt": "2023-11-07T05:31:56Z",
"partialLinesSkipped": "INVENTORY_MANAGEMENT",
"progressAttemptCount": 123,
"recurringChargeId": 123,
"securityChallengeSentStatus": "SENT",
"status": "SUCCESS",
"transactionFailedEmailSentStatus": "SENT",
"transactionFailedSmsSentStatus": "SENT",
"transactionRate": 123,
"upcomingOrderEmailSentStatus": "SENT",
"upcomingOrderSmsSentStatus": "SENT",
"usageChargeStatus": "SUCCESS",
"variantList": [
{
"image": "<string>",
"productId": "<string>",
"productTitle": "<string>",
"quantity": 123,
"swapId": 123,
"title": "<string>",
"variantId": 123,
"variantTitle": "<string>"
}
]
}
]