Skip to main content
GET
/
v1
/
subscriptions
/
{id}
Retrieve a subscription
curl --request GET \
  --url https://api.yorlet.com/v1/subscriptions/{id} \
  --header 'Authorization: <api-key>'
{
  "id": "<string>",
  "created": 123,
  "object": "subscription",
  "application": "<string>",
  "billing_anchor": 123,
  "billing_anchor_config": {
    "day_of_month": 16
  },
  "cancel_at": 123,
  "canceled_at": 123,
  "collection_method": "charge_automatically",
  "coupon": "<string>",
  "currency": "gbp",
  "current_period_end": 123,
  "current_period_start": 123,
  "custom_fields": [
    {
      "name": "<string>",
      "value": "<string>"
    }
  ],
  "customer": "<string>",
  "days_before_collection": 3,
  "days_until_due": 1,
  "default_payment_method": "<string>",
  "description": "<string>",
  "end": 123,
  "interval": "month",
  "interval_count": 123,
  "next_period_end": 123,
  "next_period_start": 123,
  "pause_collection": {
    "behavior": "draft",
    "resumes_at": 123
  },
  "payment_settings": {
    "payment_method_types": [
      "autogiro"
    ]
  },
  "phases": [
    {
      "start_date": 123,
      "items": [
        "<unknown>"
      ]
    }
  ],
  "start": 123,
  "status": "active",
  "account": "<string>",
  "deleted": false,
  "metadata": {}
}

Authorizations

Authorization
string
header
required

API Key authentication. Use "Bearer YOUR_API_KEY".

Path Parameters

id
string
required

The id identifier.

Response

200 - application/json

Returns a subscription object if a valid identifier was provided.

id
string
required

Unique identifier for the object.

created
number
required

Time at which the object was created. Measured in seconds since the Unix epoch.

object
enum<string>
required
Available options:
subscription
application
string | null
required

The identifier of the application associated with the subscription.

billing_anchor
integer | null
required

The reference point that aligns future billing cycle dates.

billing_anchor_config
object
required

Configuration for the billing anchor.

cancel_at
integer | null
required

The date at which the subscription will be automatically canceled.

canceled_at
integer | null
required

The date the subscription was canceled.

collection_method
enum<string>
required

The collection method for the subscription.

Available options:
charge_automatically,
send_invoice
coupon
string | null
required

The identifier of the coupon applied to the subscription.

currency
enum<string>
required

The currency of the subscription.

Available options:
gbp,
usd,
eur,
sek
Example:

"gbp"

current_period_end
integer | null
required

The end of the current billing period.

current_period_start
integer | null
required

The start of the current billing period.

custom_fields
object[]
required

Custom fields attached to the subscription invoices.

Maximum array length: 4
customer
required

The customer associated with the subscription.

days_before_collection
integer | null
required

The number of days before the due date to attempt collection.

Required range: 0 <= x <= 7
days_until_due
integer | null
required

The number of days until the invoice is due.

Required range: x >= 0
default_payment_method
string | null
required

The identifier of the default payment method for the subscription.

description
string | null
required

The description of the subscription.

end
integer | null
required

The end date of the subscription.

interval
enum<string>
required

The billing interval for the subscription.

Available options:
month,
week,
custom
interval_count
integer | null
required

The number of intervals between each billing cycle.

next_period_end
integer | null
required

The end of the next billing period.

next_period_start
integer | null
required

The start of the next billing period.

pause_collection
object
required

The pause collection settings for the subscription.

payment_settings
object
required

The payment settings for the subscription.

phases
object[] | null
required

The phases of the subscription.

start
integer
required

The start date of the subscription.

status
enum<string>
required

The status of the subscription.

Available options:
active,
canceled,
complete,
scheduled
account
string

The account that the object belongs to. Only returned if the request is made with a valid Yorlet-Context header.

deleted
boolean
default:false

Only returned if the object has been deleted.

metadata
object

Set of key-value pairs attached to the subscription.