GET
/
v2
/
subscriptions
/
{id}
curl --request GET \
  --url https://api.hyperline.co/v2/subscriptions/{id} \
  --header 'Authorization: Bearer <token>'
{
  "id": "sub_B6ClkdqNqVNBgY",
  "currency": "EUR",
  "status": "active",
  "purchase_order": "<string>",
  "properties": {},
  "customer_id": "cus_QalW2vTAdkR6IY",
  "plan_id": "plan_zHmjoDee4ZRmQV",
  "minimum_invoice_fee": 250,
  "invoicing_entity_id": "ive_jerrb484RHn",
  "checkout_session_id": "<string>",
  "commitment_interval": {
    "period": "years",
    "count": 1
  },
  "renew_automatically": true,
  "activation_strategy": "checkout",
  "starts_at": "2023-01-20T16:04:11Z",
  "paused_at": "2023-01-20T16:04:11Z",
  "reactivate_at": "2023-01-20T16:04:11Z",
  "cancel_at": "2023-01-20T16:04:11Z",
  "cancellation_strategy": "refund_prorata",
  "cancellation_amount": 123,
  "estimated_arr": 123,
  "current_period_started_at": "2023-01-20T16:04:11Z",
  "current_period_ends_at": "2023-01-20T16:04:11Z",
  "next_payment_at": "2023-01-20T16:04:11Z",
  "next_payment_amount": 123,
  "renews_at": "2023-01-20T16:04:11Z",
  "trial_ends_at": "2023-01-20T16:04:11Z",
  "created_at": "2023-01-20T16:04:11Z",
  "products": [
    {
      "id": "itm_FJKlqUb8COXw55",
      "name": "Product name",
      "description": "A description of the product.",
      "description_display_interval_dates": true,
      "payment_interval": {
        "period": "months",
        "count": 1
      },
      "payment_schedule": "start",
      "type": "flat_fee",
      "count": 1,
      "prices": [
        {
          "type": "fee",
          "amount": 123
        }
      ]
    }
  ],
  "coupons": [
    {
      "id": "cou_DKL4Xcb5VSa8CQ",
      "name": "Partner discount",
      "description": "<string>",
      "expiration_date": "2023-11-07T05:31:56Z",
      "redemption_limit": 123,
      "created_at": "2023-01-20T16:04:11Z",
      "type": "amount",
      "discount_amount": 2000,
      "currency": "EUR",
      "repeat": "once",
      "product_ids": [
        "<string>"
      ],
      "expires_at": "2023-01-20T16:04:11Z",
      "apply_at": "2023-01-20T16:04:11Z"
    }
  ],
  "plan": {
    "id": "plan_zHmjoDee4ZRmQV",
    "name": "My example plan"
  },
  "checkout_session": {
    "id": "che_hEUPdVG7IgjpW1",
    "status": "opened",
    "available_payment_methods": [
      "card"
    ],
    "redirect_url": "https://app.hyperline.co/callback/checkout",
    "send_to": {
      "email": "josh@alpeak.com",
      "message": "<string>"
    },
    "url": "https://billing.hyperline.co/checkout/che_hEUPdVG7IgjpW1"
  },
  "payment_method_type": "card",
  "payment_method": {
    "id": "pm_1xMpj5bwRqN7LM",
    "type": "card",
    "last_4_digits": 2718,
    "expiration_date": "2026-11",
    "brand": "visa"
  },
  "generate_draft_invoices": true,
  "live_billing": {
    "total_amount": 123,
    "total_discount": 123,
    "fixed_amount": 123,
    "billing_items": [
      {
        "id": "<string>",
        "total_amount": 123,
        "original_amount": 123,
        "discount_amount": 123,
        "item_name": "<string>",
        "tiers": [
          {
            "from": 123,
            "to": 123,
            "amount": 123,
            "total_amount": 123,
            "count": 123
          }
        ]
      }
    ],
    "coupons": [
      {
        "id": "<string>",
        "name": "<string>",
        "discount_amount": 123,
        "item_ids": [
          "<string>"
        ]
      }
    ]
  }
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Query Parameters

include_live_billing
string

Response

200 - application/json
id
string
required

Subscription ID.

currency
string
required

Currency code. See ISO 4217.

status
enum<string>
required

Subscription status.

  • draft: The subscription is being created, this status is only used in the subscription assignation flow of the UI version of Hyperline.
  • pending: The subscription has been created and won't be charged until it is activated.
  • active: The subscription is running and will be invoiced at the next payment date.
  • paused: The subscription's payment collection is paused.
  • cancelled: The subscription has been canceled from an active state.
  • voided: The subscription has been voided directly from the pending state.
  • errored: We attempted 4 times (3 retries) and failed to charge a subscription's invoice, see Handling payment errors. We consider the subscription as inactive (as the customer failed to pay you) meaning that we won't invoice the customer in the future nor collect payment. You can choose to reactivate it manually.
Available options:
active,
cancelled,
draft,
errored,
paused,
pending,
voided
purchase_order
string | null
required

Reference to the purchase order.

properties
object | null
required

Key/value pairs to store any information you find useful.

customer_id
string
required

ID of the customer.

plan_id
string | null
required

ID of the plan used to create the subscription.

minimum_invoice_fee
number | null
required

Minimum fee applied to each invoice outside of one time payments

invoicing_entity_id
string
required

ID of the invoicing entity attached to the subscription

checkout_session_id
string | null
required

ID of the checkout session.

commitment_interval
object | null
required

Interval used to represent the commitment period of the subscription. Note that the commitment interval is different than the subscription duration (e.g. you can have a mandatory commitment of 1 year but an unlimited subscription).

renew_automatically
boolean
required

Indicates if the subscription should automatically renew.

activation_strategy
enum<string> | null
required

Strategy used to activate the subscription.

  • start_date: The subscription will become active on the specified start date. If the start date is in the past, it will be activated immediately.
  • manually: The subscription requires activation through a manual action.
  • checkout: The subscription will be activated once the checkout is completed, but only if the start date is in the past. Otherwise, activation will occur later on the specified start date.
  • quote: The subscription will be activated depending on the configuration and the signature of the related quote.
Available options:
start_date,
manually,
checkout,
quote
starts_at
string
required

Subscription contract start date. UTC date time string in the ISO 8601 format.

paused_at
string | null
required

Date when the subscription was paused. Only applies to paused status. UTC date time string in the ISO 8601 format.

reactivate_at
string | null
required

Date when the subscription was reactivated after the last pause event. UTC date time string in the ISO 8601 format.

cancel_at
string | null
required

Subscription cancel date. UTC date time string in the ISO 8601 format.

cancellation_strategy
enum<string> | null
required

Strategy used to cancel the subscription. If not specified do_nothing is used.

  • charge_prorata: Will charge the customer the unpaid amount for the prorated period up to the end of the current period.
  • charge_custom: Will charge the customer a custom amount.
  • refund_prorata: Will refund to the customer the overpaid subscription amount using prorated calculations on the cancellation date.
  • refund_custom: Will refund to the customer a custom amount.
  • end_of_period: Will cancel the subscription at the end date of the current billing period.
  • do_nothing: Will only cease the subscription without any additional actions.
Available options:
refund_prorata,
refund_custom,
charge_prorata,
charge_custom,
end_of_period,
do_nothing
cancellation_amount
number
required

Custom amount used when cancelling the subscription. Only applies to the charge_custom or the refund_custom cancellation strategy.

estimated_arr
number
required

Estimated Annual Recurring Revenue generated by the subscription.

current_period_started_at
string | null
required

Start date of the current billing period. UTC date time string in the ISO 8601 format.

current_period_ends_at
string | null
required

End date of the current billing period. UTC date time string in the ISO 8601 format.

next_payment_at
string | null
required

Date on which the next subscription payment will occur. UTC date time string in the ISO 8601 format.

next_payment_amount
number
required

The amount of the next subscription payment. The system will generate an invoice to pay on the next_payment_at.

renews_at
string | null
required

Next subscription commitment renewal date. UTC date time string in the ISO 8601 format.

trial_ends_at
string | null
required

End date of the trial period. UTC date time string in the ISO 8601 format.

created_at
string
required

Subscription creation date. UTC date time string in the ISO 8601 format.

products
object[]
required

Products that make up the subscription.

coupons
object[]
required

Coupons to be applied to the prices of subscription products.

plan
object | null
required
checkout_session
object | null
required

Checkout session of the subscription.

payment_method_type
enum<string> | null
required

Payment method type used to pay the subscription.

Available options:
card,
direct_debit,
direct_debit_ach,
direct_debit_bacs,
transfer,
transfer_automated,
external
payment_method
object | null
required

Payment method details used to pay the subscription.

generate_draft_invoices
boolean
required

Generate draft invoices for the subscription. Each invoice will need to be reviewed and validated manually before being sent

live_billing
object