POST
/
v2
/
subscriptions

Authorizations

Authorization
string
header
required

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

Body

application/json
activation_strategy
enum<string>
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
customer_id
string
required

ID of the customer.

available_payment_method_types
enum<string>[]

Set the allowed types of payment methods for the customer. Only applies to the new payment method strategy.

Available options:
card,
direct_debit,
direct_debit_ach,
direct_debit_bacs,
transfer,
transfer_automated
cancel_at
string

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

cancellation_amount
number

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

cancellation_strategy
enum<string>

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
checkout_session
object
commitment_interval
object
deprecated

Use contract_start contract_end and renew_automatically instead. Interval previously used to represent the commitment period of the subscription.

contract_end
string

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

contract_start
string

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

coupons
object[]
create_setup_phase

[On demand] Will split the subscription into 2 phases, one will contain 'once' products and the other the recurring ones. Call next-phase endpoint to transition between the 2 phases.

custom_properties
object

A list of key value with the ID or the name of the custom property as the key and the custom property value as value.

generate_draft_invoices
default:
false

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

initial_billing_at
string

Date when the subscription will start being billed. If not specified, it will correspond to the contract_start date. UTC date time string in the ISO 8601 format.

invoicing_entity_id
string

ID of the invoicing entity attached to the subscription.

minimum_invoice_fee
number | null

Minimum fee applied to each invoice outside of one time payments.

payment_method_strategy
enum<string>

Payment method strategy used to bill the subscription. By default, the current payment method of the customer will be used.

  • new: Ask the customer for a new payment method. The customer can fill in their payment method either on the subscription's checkout session or on their portal page.
  • current: Use the current default payment method of the customer.
  • external: Manage the payments of the subscription outside of Hyperline.
Available options:
current,
external,
new
plan_id
string

ID of the plan used to create the subscription.

products
object[]

Products that make up the subscription.

properties
object

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

purchase_order
string

Reference to the purchase order.

renew_automatically
default:
true

Indicates if the subscription should automatically renew.

renew_for
object

If renew_automatically is enabled, will renew the subscription for the given interval.

starts_at
string
deprecated

Deprecated field, please use contract_start.

trial_delay_first_invoice
default:
false

Delay first invoice to the end of the trial period.

trial_ends_at
string

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

Response

201 - application/json
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,
contract_start_date
cancel_at
string | null
required

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

cancellation_amount
number
required

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

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
checkout_session
object | null
required

Checkout session of the subscription.

checkout_session_id
string | null
required

ID of the checkout session.

commitment_interval
object | null
requireddeprecated

Use contract_start contract_end and renew_automatically instead. Interval previously used to represent the commitment period of the subscription.

contract_end
string | null
required

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

contract_start
string
required

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

coupons
object[]
required

Coupons to be applied to the prices of subscription products.

created_at
string
required

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

crm_opportunity_id
string | null
required

ID of the related opportunity/deal in the connected CRM.

currency
enum<string>
required

Currency code. See ISO 4217.

Available options:
EUR,
AED,
AFN,
XCD,
ALL,
AMD,
AOA,
ARS,
USD,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
XOF,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BRL,
BSD,
BTN,
NOK,
BWP,
BYR,
BZD,
CAD,
CDF,
XAF,
CHF,
NZD,
CLP,
CNY,
COP,
CRC,
CUP,
CVE,
ANG,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
MAD,
ERN,
ETB,
FJD,
FKP,
GBP,
GEL,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
INR,
IQD,
IRR,
ISK,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KPW,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LYD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRO,
MUR,
MVR,
MWK,
MXN,
MYR,
MZN,
NAD,
XPF,
NGN,
NIO,
NPR,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SDG,
SEK,
SGD,
SHP,
SLL,
SOS,
SRD,
SSP,
STD,
SYP,
SZL,
THB,
TJS,
TMT,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
UYU,
UZS,
VEF,
VND,
VUV,
WST,
YER,
ZAR,
ZMW,
ZWL
current_period_ends_at
string | null
required

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

current_period_started_at
string | null
required

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

current_phase_id
string | null
required

ID of the current subscription phase.

custom_properties
object | null
required

A list of key value with the ID or the name of the custom property as the key and the custom property value as value.

customer_id
string
required

ID of the customer.

estimated_arr
number
required

Estimated Annual Recurring Revenue generated by 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

id
string
required

Subscription ID.

initial_billing_at
string | null
required

Date when the subscription will start being billed. If not specified, it will correspond to the contract_start date. UTC date time string in the ISO 8601 format.

invoicing_entity_id
string
required

ID of the invoicing entity attached to the subscription.

minimum_invoice_fee
number | null
required

Minimum fee applied to each invoice outside of one time payments.

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.

next_payment_at
string | null
required

Date on which the next subscription payment will occur. 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.

payment_method
object | null
required

Payment method details used to pay 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
plan
object | null
required
plan_id
string | null
required

ID of the plan used to create the subscription.

products
object[]
required

Products that make up the subscription.

properties
object | null
required

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

purchase_order
string | null
required

Reference to the purchase order.

quote
object | null
required
reactivate_at
string | null
required

Date when the subscription will be automatically reactivated. UTC date time string in the ISO 8601 format.

renew_automatically
boolean
required

Indicates if the subscription should automatically renew.

renew_for
object | null
required

If renew_automatically is enabled, will renew the subscription for the given interval.

renews_at
string | null
required

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

starts_at
string
requireddeprecated

Deprecated field, please use contract_start.

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
trial_ends_at
string | null
required

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

updated_at
string
required

Subscription last edition date. UTC date time string in the ISO 8601 format.