> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yorlet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a subscription

> Retrieve a subscription



## OpenAPI

````yaml openapi-billing.json GET /v1/subscriptions/{id}
openapi: 3.1.0
info:
  title: Yorlet Billing API
  description: APIs for managing invoices, coupons, credit grants, and subscription items.
  version: 1.0.0
servers:
  - url: https://api.yorlet.com
    description: Production
  - url: https://api.yorlet.io
    description: Sandbox
security: []
paths:
  /v1/subscriptions/{id}:
    get:
      tags:
        - Subscriptions
      summary: Retrieve a subscription
      description: Retrieve a subscription
      operationId: subscriptions_retrieve
      parameters:
        - schema:
            type: string
            description: The id identifier.
          required: true
          description: The id identifier.
          name: id
          in: path
      responses:
        '200':
          description: Returns a subscription object if a valid identifier was provided.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the object.
                  created:
                    type: number
                    description: >-
                      Time at which the object was created. Measured in seconds
                      since the Unix epoch.
                  account:
                    type: string
                    description: >-
                      The account that the object belongs to. Only returned if
                      the request is made with a valid Yorlet-Context header.
                  deleted:
                    type: boolean
                    default: false
                    description: Only returned if the object has been deleted.
                  object:
                    type: string
                    enum:
                      - subscription
                  application:
                    type:
                      - string
                      - 'null'
                    description: >-
                      The identifier of the application associated with the
                      subscription.
                  billing_anchor:
                    type:
                      - integer
                      - 'null'
                    description: >-
                      The reference point that aligns future billing cycle
                      dates.
                  billing_anchor_config:
                    type:
                      - object
                      - 'null'
                    properties:
                      day_of_month:
                        type: integer
                        minimum: 1
                        maximum: 31
                        description: The day of the month to anchor billing to.
                    required:
                      - day_of_month
                    description: Configuration for the billing anchor.
                  cancel_at:
                    type:
                      - integer
                      - 'null'
                    description: >-
                      The date at which the subscription will be automatically
                      canceled.
                  canceled_at:
                    type:
                      - integer
                      - 'null'
                    description: The date the subscription was canceled.
                  collection_method:
                    type: string
                    enum:
                      - charge_automatically
                      - send_invoice
                    description: The collection method for the subscription.
                  coupon:
                    type:
                      - string
                      - 'null'
                    description: The identifier of the coupon applied to the subscription.
                  currency:
                    type: string
                    enum:
                      - gbp
                      - usd
                      - eur
                      - sek
                    description: The currency of the subscription.
                    example: gbp
                  current_period_end:
                    type:
                      - integer
                      - 'null'
                    description: The end of the current billing period.
                  current_period_start:
                    type:
                      - integer
                      - 'null'
                    description: The start of the current billing period.
                  custom_fields:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          maxLength: 40
                          description: The name of the custom field.
                        value:
                          type: string
                          maxLength: 140
                          description: The value of the custom field.
                      required:
                        - name
                        - value
                    maxItems: 4
                    description: Custom fields attached to the subscription invoices.
                  customer:
                    anyOf:
                      - type: string
                      - type: object
                        properties:
                          id:
                            type: string
                            description: Unique identifier for the object.
                          created:
                            type: number
                            description: >-
                              Time at which the object was created. Measured in
                              seconds since the Unix epoch.
                          account:
                            type: string
                            description: >-
                              The account that the object belongs to. Only
                              returned if the request is made with a valid
                              Yorlet-Context header.
                          deleted:
                            type: boolean
                            default: false
                            description: Only returned if the object has been deleted.
                          object:
                            type: string
                            enum:
                              - customer
                          address:
                            type: object
                            properties:
                              line1:
                                type:
                                  - string
                                  - 'null'
                              line2:
                                type:
                                  - string
                                  - 'null'
                              city:
                                type:
                                  - string
                                  - 'null'
                              country:
                                type:
                                  - string
                                  - 'null'
                              postal_code:
                                type:
                                  - string
                                  - 'null'
                              state:
                                type:
                                  - string
                                  - 'null'
                            description: The customer's address.
                          default_payment_method:
                            anyOf:
                              - type: string
                              - type: object
                                additionalProperties: {}
                              - type: 'null'
                            description: ID of the default payment method for the customer.
                          delinquent:
                            type: boolean
                            description: >-
                              Whether the customer has any unpaid or past-due
                              invoices.
                          description:
                            type:
                              - string
                              - 'null'
                            description: An arbitrary description attached to the customer.
                          email:
                            type: string
                            format: email
                            description: The customer's email address.
                          invoice_prefix:
                            type: string
                            description: >-
                              The prefix for the customer used to generate
                              unique invoice numbers.
                          invoicing:
                            type: object
                            properties:
                              arrears_emails:
                                type: boolean
                                description: >-
                                  Whether the customer should receive arrears
                                  emails.
                              email_cc:
                                type: array
                                items:
                                  type: string
                                  format: email
                                description: Email addresses to CC on invoice emails.
                              email_to:
                                type:
                                  - string
                                  - 'null'
                                format: email
                                description: >-
                                  The primary email address to send invoices to.
                                  Defaults to the customer email when not set.
                            required:
                              - arrears_emails
                              - email_cc
                            description: Invoicing preferences for the customer.
                          legal:
                            type: object
                            properties:
                              dob:
                                type: object
                                properties:
                                  day:
                                    type:
                                      - integer
                                      - 'null'
                                    minimum: 1
                                    maximum: 31
                                  month:
                                    type:
                                      - integer
                                      - 'null'
                                    minimum: 1
                                    maximum: 12
                                  year:
                                    type:
                                      - integer
                                      - 'null'
                                    minimum: 1900
                                    maximum: 9999
                                required:
                                  - day
                                  - month
                                  - year
                                description: The customer's date of birth.
                              first_name:
                                type:
                                  - string
                                  - 'null'
                                description: The customer's legal first name.
                              last_name:
                                type:
                                  - string
                                  - 'null'
                                description: The customer's legal last name.
                            required:
                              - dob
                              - first_name
                              - last_name
                            description: Legal information about the customer.
                          metadata:
                            type:
                              - object
                              - 'null'
                            additionalProperties:
                              type: string
                            description: >-
                              Set of key-value pairs that you can attach to an
                              object. This can be useful for storing additional
                              information about the object in a structured
                              format.
                          name:
                            type:
                              - string
                              - 'null'
                            description: The customer's full name.
                          phone:
                            type:
                              - string
                              - 'null'
                            description: The customer's phone number.
                          radar:
                            type: object
                            properties:
                              message:
                                type:
                                  - string
                                  - 'null'
                                description: >-
                                  A human-readable message describing the radar
                                  assessment of the customer.
                              reason:
                                type:
                                  - string
                                  - 'null'
                                description: >-
                                  A machine-readable reason for the radar
                                  assessment of the customer.
                              risk_level:
                                type: string
                                description: >-
                                  The risk level assigned to the customer by
                                  radar.
                            required:
                              - message
                              - reason
                              - risk_level
                            description: Radar's risk assessment of the customer.
                        required:
                          - id
                          - created
                          - object
                          - address
                          - default_payment_method
                          - delinquent
                          - description
                          - email
                          - invoice_prefix
                          - invoicing
                          - legal
                          - name
                          - phone
                          - radar
                    description: The customer associated with the subscription.
                  days_before_collection:
                    type:
                      - integer
                      - 'null'
                    minimum: 0
                    maximum: 7
                    description: >-
                      The number of days before the due date to attempt
                      collection.
                  days_until_due:
                    type:
                      - integer
                      - 'null'
                    minimum: 0
                    description: The number of days until the invoice is due.
                  default_payment_method:
                    type:
                      - string
                      - 'null'
                    description: >-
                      The identifier of the default payment method for the
                      subscription.
                  description:
                    type:
                      - string
                      - 'null'
                    description: The description of the subscription.
                  end:
                    type:
                      - integer
                      - 'null'
                    description: The end date of the subscription.
                  interval:
                    type: string
                    enum:
                      - month
                      - week
                      - custom
                      - upfront
                    description: The billing interval for the subscription.
                  interval_count:
                    type:
                      - integer
                      - 'null'
                    description: The number of intervals between each billing cycle.
                  metadata:
                    type:
                      - object
                      - 'null'
                    additionalProperties:
                      type: string
                    description: Set of key-value pairs attached to the subscription.
                  next_period_end:
                    type:
                      - integer
                      - 'null'
                    description: The end of the next billing period.
                  next_period_start:
                    type:
                      - integer
                      - 'null'
                    description: The start of the next billing period.
                  pause_collection:
                    type:
                      - object
                      - 'null'
                    properties:
                      behavior:
                        type: string
                        enum:
                          - draft
                          - mark_uncollectible
                          - void
                        description: >-
                          The behavior to apply to invoices while collection is
                          paused.
                      resumes_at:
                        type:
                          - integer
                          - 'null'
                        description: The date at which collection will resume.
                    required:
                      - behavior
                      - resumes_at
                    description: The pause collection settings for the subscription.
                  payment_settings:
                    type:
                      - object
                      - 'null'
                    properties:
                      payment_method_types:
                        type: array
                        items:
                          type: string
                          enum:
                            - autogiro
                            - bacs_debit
                            - card
                            - card_present
                            - bank_transfer
                            - direct_transfer
                            - gbp_credit_transfer
                            - pay_by_bank
                            - sepa_debit
                        description: The payment method types allowed for the subscription.
                    required:
                      - payment_method_types
                    description: The payment settings for the subscription.
                  phases:
                    type:
                      - array
                      - 'null'
                    items:
                      type: object
                      properties:
                        start_date:
                          type: integer
                          description: The start date of the phase.
                        items:
                          type: array
                          items: {}
                          description: The items in the phase.
                      required:
                        - start_date
                        - items
                    description: The phases of the subscription.
                  start:
                    type: integer
                    description: The start date of the subscription.
                  status:
                    type: string
                    enum:
                      - active
                      - canceled
                      - complete
                      - scheduled
                    description: The status of the subscription.
                required:
                  - id
                  - created
                  - object
                  - application
                  - billing_anchor
                  - billing_anchor_config
                  - cancel_at
                  - canceled_at
                  - collection_method
                  - coupon
                  - currency
                  - current_period_end
                  - current_period_start
                  - custom_fields
                  - customer
                  - days_before_collection
                  - days_until_due
                  - default_payment_method
                  - description
                  - end
                  - interval
                  - interval_count
                  - next_period_end
                  - next_period_start
                  - pause_collection
                  - payment_settings
                  - phases
                  - start
                  - status
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API Key authentication. Use "Bearer YOUR_API_KEY".

````