Subscriptions API (3.14.0)

Download OpenAPI specification:Download

The fabric Subscriptions API lets your customers set recurring purchases of their desired products or services for a scheduled period (weekly, monthly, etc.). In addition, Subscriptions helps you retrieve and update subscription details, and lets your customers skip one or more subscription schedules, or remove a subscription.

Customers

These endpoints get one or all of your customers. If you request all customers, they will be sent paginated; you can specify the page size, and which page you want.

Get a specific customer's account

Get account details for a single customer

Request
path Parameters
id
required
string

Customer ID

Example: 6169b2d892a5f30009d76480
header Parameters
Authorization
required
string (Authorization)

JWT authorization token

Example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9lIENvZGVyIn0.5dlp7GmziL2QS06sZgK4mtaqv0_xX4oFUuTDh1zHK4U
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

400

Bad request

403

Unauthorized access

get/customers/{id}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Get all customers' accounts

Get account details for all customers

Request
query Parameters
pageSize
number

Number of customers per page

Example: pageSize=35
pageNumber
number

Page number

Example: pageNumber=1
search
string

If full or partial email address is specified, customers matching the address will be returned.
If not specified, all customers will be returned.

Example: search=test.shop@fabric.inc
header Parameters
Authorization
required
string (Authorization)

JWT authorization token

Example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9lIENvZGVyIn0.5dlp7GmziL2QS06sZgK4mtaqv0_xX4oFUuTDh1zHK4U
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

403

Unauthorized access

get/customers
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Plans

Merchants create plans, to which customers can subscribe. A plan includes the product information, schedule, and associated details. Using these Plans endpoints, you can determine how many plans have been created, retrieve one or more plans, or delete a plan.

Get number of plans

Get the total number of subscription plans, including counts per subscription status

Request
header Parameters
Authorization
required
string (Authorization)

JWT authorization token

Example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9lIENvZGVyIn0.5dlp7GmziL2QS06sZgK4mtaqv0_xX4oFUuTDh1zHK4U
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

403

Unauthorized access

get/plans/count
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Get plans by itemId

Get all subscription plans for a given item ID

Request
header Parameters
Authorization
required
string (Authorization)

JWT authorization token

Example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9lIENvZGVyIn0.5dlp7GmziL2QS06sZgK4mtaqv0_xX4oFUuTDh1zHK4U
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Request Body schema: application/json

Plan IDs of plans to be returned

itemIds
Array of numbers
Responses
200

Request processed successfully

400

Bad request

post/plans/get-by-itemIds
Request samples
application/json
{
  • "itemIds": [
    ]
}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Get all plans

Get all plans that have been created for this merchant

Request
header Parameters
Authorization
required
string (Authorization)

JWT authorization token

Example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9lIENvZGVyIn0.5dlp7GmziL2QS06sZgK4mtaqv0_xX4oFUuTDh1zHK4U
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

401

Unauthorized access

get/v3/plans
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Get one plan

Get a single plan

Request
path Parameters
id
required
string

Plan group ID

Example: 848c8e-b18c-134-8bbb-5a35f2158c37
header Parameters
Authorization
required
string (Authorization)

JWT authorization token

Example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9lIENvZGVyIn0.5dlp7GmziL2QS06sZgK4mtaqv0_xX4oFUuTDh1zHK4U
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

401

Unauthorized access

get/v3/plans/{id}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Delete plan

Delete a specific plan

Request
path Parameters
id
required
string

ID of plan to be deleted

Example: 6155a9b24667170011a3e2cd
header Parameters
Authorization
required
string (Authorization)

JWT authorization token

Example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9lIENvZGVyIn0.5dlp7GmziL2QS06sZgK4mtaqv0_xX4oFUuTDh1zHK4U
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

403

Unauthorized access

delete/plans/{id}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Subscriptions

These endpoints let your customers set recurring purchases of their desired products or services for a scheduled period (weekly, monthly, etc.). In addition, these endpoints let you get and update subscription details, and let your customers skip one or more subscription schedules, or remove a subscription.

Create subscription

Create a subscription. Details, including plan ID, item ID, and quantity are specified in the request body.

Request
header Parameters
Authorization
required
string (Authorization)

JWT authorization token

Example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9lIENvZGVyIn0.5dlp7GmziL2QS06sZgK4mtaqv0_xX4oFUuTDh1zHK4U
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Request Body schema: application/json
planId
required
string

Plan ID

itemId
required
string

Item ID

Array of objects (subscriptionChildItem)

List of subscription child items

quantity
required
number

Number of items to add to subscription

customerEmail
required
string

Customer's email address

customerReferenceId
string

Customer reference ID

customerFullName
string

Customer's full name

orderReferenceId
required
string

Order reference ID

paymentMethod
string

Payment method

discount
number

Discount percent

tax
number

Tax amount

shippingCost
number

Shipping cost

status
string

Subscription status

Enum: "ACTIVE" "SCHEDULED" "INACTIVE" "CANCEL" "PAUSED" "EXPIRED" "TRIAL"
required
object (userAddress)

User's full address

required
object (userAddress)

User's full address

object (payment)

Payment details

channel
string

Subscription channel

Array of objects (subscriptionItemAttribute)

List of subscription item attributes

required
object (orderDetail)

Order details

Responses
200

Request processed successfully

400

Bad request

post/subscriptions
Request samples
application/json
{
  • "planId": "6155a9334667170011a3e2c3",
  • "itemId": 1000000006,
  • "childItems": [
    ],
  • "quantity": 2,
  • "customerEmail": "customer@mail.com",
  • "customerReferenceId": "606f01f441b8fc0008529916",
  • "customerFullName": "Pat E. Kake",
  • "orderReferenceId": "6803-5058-41270",
  • "paymentMethod": "paypal",
  • "discount": 10,
  • "tax": 10,
  • "shippingCost": 1,
  • "status": "ACTIVE",
  • "shipTo": {
    },
  • "billTo": {
    },
  • "payment": {
    },
  • "channel": "WEBSITE",
  • "itemAttributes": [
    ],
  • "orderDetail": {
    }
}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Update subscription

Update product quantity, billing and shipping frequency, shipping address, payment method, product tax, or shipping cost; cancel a subscription; change next payment date.

Request
path Parameters
id
required
string

Subscription ID

Example: 6169b2d892a5f30009d76480
header Parameters
Authorization
required
string (Authorization)

JWT authorization token

Example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9lIENvZGVyIn0.5dlp7GmziL2QS06sZgK4mtaqv0_xX4oFUuTDh1zHK4U
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Request Body schema: application/json
frequency
number

Frequency with which a customer is billed and a recurring order is created for a product or service.
For example, when frequency=5 and frequencyType=weekly, the product or service will be billed, and an order will be created, every 5 weeks.

frequencyType
string

Period at which a customer is billed and a recurring order is created for a product or service.
For example, when frequency=5 and frequencyType=weekly, the product or service will be billed, and an order will be created, every 5 weeks.

Enum: "Daily" "Weekly" "Monthly" "Yearly"
quantity
number

Number of items on subscription

orderReferenceId
string

Order reference ID

paymentMethod
string

Payment method

discount
number

Discount percent

tax
number

Tax amount

shippingCost
number

Shipping cost

status
string

Subscription status

Enum: "ACTIVE" "SCHEDULED" "INACTIVE" "CANCEL" "PAUSED" "EXPIRED" "TRIAL"
object (userAddress)

User's full address

object (userAddress)

User's full address

channel
string

Subscription channel

Array of objects (subscriptionItemAttribute)

List of item attributes

object (orderDetail)

Order details

nextPaymentDate
string

Date of next payment

Responses
200

Request processed successfully

400

Bad request

401

Unauthorized access

put/subscriptions/{id}
Request samples
application/json
{
  • "frequency": 2,
  • "frequencyType": "Weekly",
  • "quantity": 2,
  • "orderReferenceId": "6803-5058-41270",
  • "paymentMethod": "authorize.net",
  • "discount": 10,
  • "tax": 10,
  • "shippingCost": 1,
  • "status": "ACTIVE",
  • "shipTo": {
    },
  • "billTo": {
    },
  • "channel": "WEBSITE",
  • "itemAttributes": [
    ],
  • "orderDetail": {
    },
  • "nextPaymentDate": "2025-10-17T10:00:01.199Z"
}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Get subscription

Get details of a single subscription

Request
path Parameters
id
required
string

Subscription ID

Example: 6169b2d892a5f30009d76480
header Parameters
Authorization
required
string (Authorization)

JWT authorization token

Example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9lIENvZGVyIn0.5dlp7GmziL2QS06sZgK4mtaqv0_xX4oFUuTDh1zHK4U
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

400

Bad request

403

Unauthorized access

get/subscriptions/{id}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Delete subscription

Delete a single subscription

Request
path Parameters
id
required
string

Subscription ID

Example: 6169b2d892a5f30009d76480
header Parameters
Authorization
required
string (Authorization)

JWT authorization token

Example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9lIENvZGVyIn0.5dlp7GmziL2QS06sZgK4mtaqv0_xX4oFUuTDh1zHK4U
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

400

Bad request

401

Unauthorized access

delete/subscriptions/{id}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Get specific order

Get order by specifying order ID

Request
path Parameters
id
required
string

Order ID

Example: 6803-5058-41298
header Parameters
Authorization
required
string

JWT authorization token

Example: JWT
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

400

Bad request

403

Unauthorized access

get/orders/{id}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Get all orders for specific customer

Get all orders for a specific customer by specifying the customer reference ID

Request
path Parameters
id
required
string

Customer reference ID

Example: 606f01f441b8fc0008529916
header Parameters
Authorization
required
string

JWT authorization token

Example: JWT
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

403

Unauthorized access

get/orders/get-by-customer/{id}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Get all scheduled orders for specific customer

Get all scheduled orders by specifying customer reference ID

Request
path Parameters
id
required
string

Customer reference ID

Example: 606f01f441b8fc0008529916
header Parameters
Authorization
required
string

JWT authorization token

Example: JWT
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

400

Bad request

403

Unauthorized access

get/orders/scheduled/get-by-customerId/{id}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Get orders for specific subscription

Get all orders for a given subscription by specifying the subscription ID

Request
path Parameters
id
required
string

Subscription ID

Example: 616984147da89c000824f483
header Parameters
Authorization
required
string

JWT authorization token

Example: JWT
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Responses
200

Request processed successfully

400

Bad request

403

Unauthorized access

get/orders/get-by-subscriptionId/{id}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}

Skip order

Skip the next order for a specific subscription

Request
path Parameters
id
required
string

Subscription ID

Example: 6149b1726a9f860011a9fb5a
header Parameters
Authorization
required
string

JWT authorization token

Example: JWT
required
object (xsitecontext)

JSON object containing channel, account, stage, and date. If omitted, the Authorization parameter is required.

Request Body schema: application/json
skipDate
string

Subscription skip date

skip
boolean

true: Next order is to be skipped
false: Next order should be processed as usual

Responses
200

Request processed successfully

400

Bad request

403

Unauthorized access

post/subscriptions/skip/{id}
Request samples
application/json
{
  • "skipDate": "2024-02-20T10:00:01.199Z",
  • "skip": true
}
Response samples
application/json
{
  • "success": true,
  • "responseStatus": "OK",
  • "message": "Request processed successfully",
  • "data": {
    }
}