Retrieve a list of plans

Retrieve a list of plans.

SecuritySecretApiKey or JWT or ApplicationJWT
Request
query Parameters
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.

Responses
200

A list of Plans was retrieved successfully.

Response Headers
Pagination-Total
integer

Total items count.

Example: 332
Pagination-Limit
integer

Items per page limit.

Example: 100
Pagination-Offset
integer

Pagination offset.

Example: 2
Response Schema: application/json
Array
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 related product ID.

required
object (PlanPriceFormula)
formula
required
string

The price formula determines what algorithm is used to calculate the invoice price based on a few factors,

  • the quantity in the order (which may be variable if usage pricing, otherwise determined when creating the order)
  • the price brackets data

To determine which formula is correct, please see the price formula documentation.

price
required
number <double>

For the very simple price when it's fixed and does not depend on the quantity chosen by customer.

If the price is 0, it's free.

id
string <= 50 characters

The plan ID.

object

Name-value pairs to specify the product options.

property name*
additional property
string
currencySign
string

Currency sign.

object

The service interval. For a one-time item, use null.

unit
required
string

The unit of time.

Enum: "day" "week" "month" "year"
length
required
integer

The length of time.

limit
integer

The number of invoices this subscription order will generate (if 1, it will not generate any beyond the initial order creation). For example, set this property to 12, when the periodUnit is month and the periodDuration is 1, for a 1 year contract billed monthly.

billingTiming
string (PlanBillingTiming)
Default: "prepaid"

The billing timing in relation to the service period. For prepaid plans the customer pays when the service period starts, whereas, for postpaid plans, the customer pays when the service period ends.

Enum: "prepaid" "postpaid"
object

The trial. Set null if no trial.

price
required
number <double>

The price of the trial. For a free trial, use 0.

required
object (PlanPeriod)
isTrialOnly
boolean

Whether a plan has a trial without recurring instructions.

object

The setup. Set null if no setup.

price
required
number <double>

The price of a setup - 0 is a valid value (for free).

customFields
object (ResourceCustomFields)
Default: {}

Custom Fields list as a map {"custom field name": "custom field value", ...}. The format must follow the saved format (see Custom Fields section for the formats).

revision
integer

Increments when the plan is modified. Compare to materialized subscription items revision.

createdTime
string <date-time>

Plan created time.

updatedTime
string <date-time> (UpdatedTime)

Read-only timestamp updates when the resource is updated.

object

You can shift issue time and due time of invoices for this plan.

object (IssueTimeShiftInstruction)

The calculation instruction of billing time. This is used in conjunction with the service period anchor to calculate the time the invoice is issued.

object (DueTimeShiftInstruction)
Default: {"duration":1,"unit":"hour"}

The calculation instruction of due time. This is used in conjunction with the billing anchor to calculate due time of invoice. The chronology of due time shift is always after.

Array of objects (Self) non-empty

The links related to resource.

Array (non-empty)
href
required
string

The link URL.

rel
required
string

The link type.

Value: "self"
401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

get/plans
Request samples
$plans = $client->plans()->search([
    'filter' => 'name:TestPlan',
]);
Response samples
application/json
[
  • {
    }
]