β»οΈSubscriptions
Last updated
Last updated
Searches for subscription contracts with various filters, sorting, and pagination.
A list of subscription contracts with pagination details.
const response = await fetch('http://localhost:3002/subscription-contracts/search', {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({}),
});
const data = await response.json();
{
"data": [
{
"id": "text",
"failedBillingCount": 0,
"subscriptionTotal": 0,
"draft": false,
"createdAt": "text",
"notification_at": "2024-11-21T09:16:58.057Z",
"notified": false,
"billingInterval": "text",
"billingIntervalCount": 0,
"maxCycles": 0,
"isPrepaid": false,
"minCycles": 0,
"billingAnchorType": "text",
"billingAnchorDay": 0,
"billingAnchorMonth": 0,
"currencyCode": "text",
"customer": {
"id": "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"
],
"firstName": "text",
"lastName": "text",
"email": "text",
"phone": "text",
"state": "text",
"createdAt": "text",
"imageUrl": "text"
},
"deliveryPrice": 0,
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"orderIds": [
"text"
],
"status": "text",
"shop": "text",
"lines": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"taxable": false,
"handle": "text",
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"requiresShipping": false,
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"amount": {
"amount": "text",
"currencyCode": "text"
},
"discount": "text"
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
},
"afterCycle": 0,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
}
}
]
}
}
],
"addons": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"taxable": false,
"handle": "text",
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"requiresShipping": false,
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"amount": {
"amount": "text",
"currencyCode": "text"
},
"discount": "text"
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
},
"afterCycle": 0,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
}
}
]
}
}
],
"deliveryMethod": {
"shippingOption": {
"code": "text",
"description": "text"
}
},
"originOrder": {
"id": "text",
"legacyResourceId": "text",
"name": "text",
"createdAt": "text",
"amount": "text"
}
}
]
}
Fetches a single subscription contract by its ID along with its billing attempts.
The subscription contract ID
A single subscription contract with billing attempts
const response = await fetch('http://localhost:3002/subscription-contracts/{contractId}', {
method: 'GET',
headers: {},
});
const data = await response.json();
{
"data": {
"id": "text",
"failedBillingCount": 0,
"subscriptionTotal": 0,
"draft": false,
"createdAt": "text",
"notification_at": "2024-11-21T09:16:58.057Z",
"notified": false,
"billingInterval": "text",
"billingIntervalCount": 0,
"maxCycles": 0,
"isPrepaid": false,
"minCycles": 0,
"billingAnchorType": "text",
"billingAnchorDay": 0,
"billingAnchorMonth": 0,
"currencyCode": "text",
"customer": {
"id": "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"
],
"firstName": "text",
"lastName": "text",
"email": "text",
"phone": "text",
"state": "text",
"createdAt": "text",
"imageUrl": "text"
},
"deliveryPrice": 0,
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"orderIds": [
"text"
],
"status": "text",
"shop": "text",
"lines": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"taxable": false,
"handle": "text",
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"requiresShipping": false,
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"amount": {
"amount": "text",
"currencyCode": "text"
},
"discount": "text"
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
},
"afterCycle": 0,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
}
}
]
}
}
],
"addons": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"taxable": false,
"handle": "text",
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"requiresShipping": false,
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"amount": {
"amount": "text",
"currencyCode": "text"
},
"discount": "text"
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
},
"afterCycle": 0,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
}
}
]
}
}
],
"deliveryMethod": {
"shippingOption": {
"code": "text",
"description": "text"
}
},
"originOrder": {
"id": "text",
"legacyResourceId": "text",
"name": "text",
"createdAt": "text",
"amount": "text"
}
},
"billingAttempts": [
{
"id": "text",
"subscription_contract_id": "text",
"created_at": "2024-11-21T09:16:58.057Z",
"status": "text",
"errorMessage": "text"
}
]
}
Searches for subscription contracts based on provided filters, search order, and pagination settings.
Successfully retrieved list of subscription contracts
const response = await fetch('http://localhost:3002/subscriptions/customer-contracts', {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({}),
});
const data = await response.json();
{
"data": [
{
"id": "text",
"failedBillingCount": 0,
"subscriptionTotal": 0,
"draft": false,
"createdAt": "text",
"notification_at": "2024-11-21T09:16:58.057Z",
"notified": false,
"billingInterval": "text",
"billingIntervalCount": 0,
"maxCycles": 0,
"isPrepaid": false,
"minCycles": 0,
"billingAnchorType": "text",
"billingAnchorDay": 0,
"billingAnchorMonth": 0,
"currencyCode": "text",
"customer": {
"id": "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"
],
"firstName": "text",
"lastName": "text",
"email": "text",
"phone": "text",
"state": "text",
"createdAt": "text",
"imageUrl": "text"
},
"deliveryPrice": 0,
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"orderIds": [
"text"
],
"status": "text",
"shop": "text",
"lines": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"taxable": false,
"handle": "text",
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"requiresShipping": false,
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"amount": {
"amount": "text",
"currencyCode": "text"
},
"discount": "text"
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
},
"afterCycle": 0,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
}
}
]
}
}
],
"addons": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"taxable": false,
"handle": "text",
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"requiresShipping": false,
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"amount": {
"amount": "text",
"currencyCode": "text"
},
"discount": "text"
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
},
"afterCycle": 0,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
}
}
]
}
}
],
"deliveryMethod": {
"shippingOption": {
"code": "text",
"description": "text"
}
},
"originOrder": {
"id": "text",
"legacyResourceId": "text",
"name": "text",
"createdAt": "text",
"amount": "text"
}
}
]
}