Subscriptions
Last updated
Was this helpful?
Last updated
Was this helpful?
Searches for subscription contracts with various filters, sorting, and pagination.
/subscription-contracts/search
curl -L \
--request POST \
--url 'http://localhost:3002/subscription-contracts/search' \
--header 'Content-Type: application/json' \
--data '{"searchOrder":{},"filters":{"sort":{}}}'
{
"totalCount": 1,
"pageCount": 1,
"data": [
{
"id": "text",
"failedBillingCount": 1,
"subscriptionTotal": 1,
"draft": true,
"createdAt": "text",
"notification_at": "2025-02-20T19:08:36.627Z",
"notified": true,
"billingInterval": "text",
"billingIntervalCount": 1,
"maxCycles": 1,
"isPrepaid": true,
"minCycles": 1,
"billingAnchorType": "text",
"billingAnchorDay": 1,
"billingAnchorMonth": 1,
"currencyCode": "text",
"customer": {
"id": "text",
"firstName": "text",
"lastName": "text",
"email": "text",
"phone": "text",
"state": "text",
"createdAt": "text",
"imageUrl": "text",
"addresses": [
{
"id": "text",
"address1": "text",
"address2": "text",
"city": "text",
"company": "text",
"country": "text",
"countryCodeV2": "text",
"firstName": "text",
"lastName": "text",
"phone": "text",
"province": "text",
"provinceCode": "text",
"zip": "text"
}
],
"tags": [
"text"
]
},
"deliveryPrice": 1,
"status": "text",
"shop": "text",
"originOrder": {
"id": "text",
"legacyResourceId": "text",
"name": "text",
"createdAt": "text",
"amount": "text"
},
"orderIds": [
"text"
],
"lines": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"quantity": 1,
"taxable": true,
"handle": "text",
"requiresShipping": true,
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"discount": "text",
"amount": {
"amount": "text",
"currencyCode": "text"
}
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"afterCycle": 1,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
},
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
}
}
]
}
}
],
"addons": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"quantity": 1,
"taxable": true,
"handle": "text",
"requiresShipping": true,
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"discount": "text",
"amount": {
"amount": "text",
"currencyCode": "text"
}
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"afterCycle": 1,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
},
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
}
}
]
}
}
],
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"deliveryMethod": {
"shippingOption": {
"code": "text",
"description": "text"
}
}
}
]
}
A list of subscription contracts with pagination details.
Searches for subscription contracts based on provided filters, search order, and pagination settings.
/subscriptions/customer-contracts
Page number for pagination
Number of records per page for pagination
curl -L \
--request POST \
--url 'http://localhost:3002/subscriptions/customer-contracts' \
--header 'Content-Type: application/json' \
--data '{"searchOrder":{},"filters":{"sort":{}}}'
{
"totalCount": 1,
"pageCount": 1,
"data": [
{
"id": "text",
"failedBillingCount": 1,
"subscriptionTotal": 1,
"draft": true,
"createdAt": "text",
"notification_at": "2025-02-20T19:08:36.627Z",
"notified": true,
"billingInterval": "text",
"billingIntervalCount": 1,
"maxCycles": 1,
"isPrepaid": true,
"minCycles": 1,
"billingAnchorType": "text",
"billingAnchorDay": 1,
"billingAnchorMonth": 1,
"currencyCode": "text",
"customer": {
"id": "text",
"firstName": "text",
"lastName": "text",
"email": "text",
"phone": "text",
"state": "text",
"createdAt": "text",
"imageUrl": "text",
"addresses": [
{
"id": "text",
"address1": "text",
"address2": "text",
"city": "text",
"company": "text",
"country": "text",
"countryCodeV2": "text",
"firstName": "text",
"lastName": "text",
"phone": "text",
"province": "text",
"provinceCode": "text",
"zip": "text"
}
],
"tags": [
"text"
]
},
"deliveryPrice": 1,
"status": "text",
"shop": "text",
"originOrder": {
"id": "text",
"legacyResourceId": "text",
"name": "text",
"createdAt": "text",
"amount": "text"
},
"orderIds": [
"text"
],
"lines": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"quantity": 1,
"taxable": true,
"handle": "text",
"requiresShipping": true,
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"discount": "text",
"amount": {
"amount": "text",
"currencyCode": "text"
}
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"afterCycle": 1,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
},
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
}
}
]
}
}
],
"addons": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"quantity": 1,
"taxable": true,
"handle": "text",
"requiresShipping": true,
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"discount": "text",
"amount": {
"amount": "text",
"currencyCode": "text"
}
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"afterCycle": 1,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
},
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
}
}
]
}
}
],
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"deliveryMethod": {
"shippingOption": {
"code": "text",
"description": "text"
}
}
}
]
}
Successfully retrieved list of subscription contracts
Fetches a single subscription contract by its ID along with its billing attempts.
/subscription-contracts/{contractId}
The subscription contract ID
curl -L \
--url 'http://localhost:3002/subscription-contracts/{contractId}'
{
"data": {
"id": "text",
"failedBillingCount": 1,
"subscriptionTotal": 1,
"draft": true,
"createdAt": "text",
"notification_at": "2025-02-20T19:08:36.627Z",
"notified": true,
"billingInterval": "text",
"billingIntervalCount": 1,
"maxCycles": 1,
"isPrepaid": true,
"minCycles": 1,
"billingAnchorType": "text",
"billingAnchorDay": 1,
"billingAnchorMonth": 1,
"currencyCode": "text",
"customer": {
"id": "text",
"firstName": "text",
"lastName": "text",
"email": "text",
"phone": "text",
"state": "text",
"createdAt": "text",
"imageUrl": "text",
"addresses": [
{
"id": "text",
"address1": "text",
"address2": "text",
"city": "text",
"company": "text",
"country": "text",
"countryCodeV2": "text",
"firstName": "text",
"lastName": "text",
"phone": "text",
"province": "text",
"provinceCode": "text",
"zip": "text"
}
],
"tags": [
"text"
]
},
"deliveryPrice": 1,
"status": "text",
"shop": "text",
"originOrder": {
"id": "text",
"legacyResourceId": "text",
"name": "text",
"createdAt": "text",
"amount": "text"
},
"orderIds": [
"text"
],
"lines": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"quantity": 1,
"taxable": true,
"handle": "text",
"requiresShipping": true,
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"discount": "text",
"amount": {
"amount": "text",
"currencyCode": "text"
}
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"afterCycle": 1,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
},
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
}
}
]
}
}
],
"addons": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"quantity": 1,
"taxable": true,
"handle": "text",
"requiresShipping": true,
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"discount": "text",
"amount": {
"amount": "text",
"currencyCode": "text"
}
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"afterCycle": 1,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
},
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
}
}
]
}
}
],
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"deliveryMethod": {
"shippingOption": {
"code": "text",
"description": "text"
}
}
},
"billingAttempts": [
{
"id": "text",
"subscription_contract_id": "text",
"created_at": "2025-02-20T19:08:36.627Z",
"status": "text",
"errorMessage": "text"
}
]
}
A single subscription contract with billing attempts