Retrieve a plan

Retrieve a plan with specified identifier string.

SecuritySecretApiKey or JWT or ApplicationJWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

Responses
200

Plan was retrieved successfully.

Response Schema: application/json
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)
unit
required
string

The unit of time.

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

The length of time.

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.

chronology
required
string

The chronology of the billing time relatively to the service period start.

Value: "before"
duration
required
integer >= 1

The number of the units.

required
TimeUnit (string) or TimePluralUnit (string)
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.

duration
required
integer >= 1
Default: 1

The number of the units.

required
TimeUnit (string) or TimePluralUnit (string)
Default: "hour"
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.

404

Resource was not found.

get/plans/{id}
Request samples
$plan = $client->plans()->load('planId');
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "name": "string",
  • "productId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "productOptions": {
    },
  • "currency": "USD",
  • "currencySign": "string",
  • "pricing": {
    },
  • "recurringInterval": {
    },
  • "trial": {
    },
  • "isTrialOnly": true,
  • "setup": {
    },
  • "customFields": {
    },
  • "revision": 0,
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "invoiceTimeShift": {
    },
  • "_links": [
    ]
}