Plans are a template for making a subscription. For example, you may have a plan that has a 30-day free trial followed by a recurring charge of $19.95 per month until canceled. The combination of the plan and a request to make an order will apply those instructions to create the invoices according to the plan's schedule.
Retrieve a list of plans.
filter | string The collection items filter requires a special format. Use "," for multiple allowed values. Use ";" for multiple fields. See the filter guide for more options and examples about this format. |
sort | Array of strings The collection items sort field and order (prefix with "-" for descending sort). |
limit | integer [ 0 .. 1000 ] The collection items limit. |
offset | integer >= 0 The collection items offset. |
q | string The partial search of the text fields. |
A list of plans was retrieved successfully.
Pagination-Total | integer Total items count. |
Pagination-Limit | integer Items per page limit. |
Pagination-Offset | integer Pagination offset. |
name required | string The plan name, displayed on invoices and receipts. | ||||
currency required | string 3 characters ISO 4217 alphabetic currency code. | ||||
productId required | string <= 50 characters The resource ID. Defaults to UUID v4. | ||||
required | object (PlanPriceFormula) | ||||
| |||||
id | string <= 50 characters The resource ID. Defaults to UUID v4. | ||||
object Name-value pairs to specify the product options. | |||||
currencySign | string Currency sign. | ||||
object The service interval. For a one-time item, use | |||||
object The trial. Set | |||||
isTrialOnly | boolean Whether a plan has a trial without recurring instructions. | ||||
object The setup. Set | |||||
customFields | object (ResourceCustomFields) Default: {} Custom Fields list as a map | ||||
revision | integer Increments when the plan is modified. Compare to materialized subscription items revision. | ||||
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||
Array of SelfLink (object) non-empty The links related to resource. | |||||
Unauthorized access, invalid credentials were used.
Access forbidden.
curl -i -X GET \ 'https://api-sandbox.rebilly.com/storefront/plans?filter=string&sort=string&limit=1000&offset=0&q=string' \ -H 'REB-APIKEY: YOUR_API_KEY_HERE'
[- {
- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "name": "string",
- "productId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "productOptions": {
- "color": "red",
- "size": "xxl"
}, - "currency": "USD",
- "currencySign": "string",
- "pricing": {
- "formula": "fixed-fee"
}, - "recurringInterval": {
- "unit": "day",
- "length": 0,
- "limit": 0,
- "billingTiming": "prepaid"
}, - "trial": {
- "price": 0,
- "period": {
- "unit": "day",
- "length": 0
}
}, - "isTrialOnly": true,
- "setup": {
- "price": 0
}, - "customFields": {
- "foo": "bar"
}, - "revision": 0,
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
]
Retrieve a plan with specified ID.
Plan was retrieved successfully.
name required | string The plan name, displayed on invoices and receipts. | ||||
currency required | string 3 characters ISO 4217 alphabetic currency code. | ||||
productId required | string <= 50 characters The resource ID. Defaults to UUID v4. | ||||
required | object (PlanPriceFormula) | ||||
| |||||
id | string <= 50 characters The resource ID. Defaults to UUID v4. | ||||
object Name-value pairs to specify the product options. | |||||
currencySign | string Currency sign. | ||||
object The service interval. For a one-time item, use | |||||
object The trial. Set | |||||
isTrialOnly | boolean Whether a plan has a trial without recurring instructions. | ||||
object The setup. Set | |||||
customFields | object (ResourceCustomFields) Default: {} Custom Fields list as a map | ||||
revision | integer Increments when the plan is modified. Compare to materialized subscription items revision. | ||||
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||
Array of SelfLink (object) non-empty The links related to resource. | |||||
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
curl -i -X GET \ 'https://api-sandbox.rebilly.com/storefront/plans/{id}' \ -H 'REB-APIKEY: YOUR_API_KEY_HERE'
{- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "name": "string",
- "productId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "productOptions": {
- "color": "red",
- "size": "xxl"
}, - "currency": "USD",
- "currencySign": "string",
- "pricing": {
- "formula": "fixed-fee"
}, - "recurringInterval": {
- "unit": "day",
- "length": 0,
- "limit": 0,
- "billingTiming": "prepaid"
}, - "trial": {
- "price": 0,
- "period": {
- "unit": "day",
- "length": 0
}
}, - "isTrialOnly": true,
- "setup": {
- "price": 0
}, - "customFields": {
- "foo": "bar"
}, - "revision": 0,
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}