Passer au contenu principal
POST
/
v1
/
subscriptions
/
{id}
/
renew
Renew subscription
curl --request POST \
  --url https://api.hyperline.co/v1/subscriptions/{id}/renew \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "up_to": "2024-12-20T16:04:11Z"
}
'
{
  "id": "sub_B6ClkdqNqVNBgY",
  "name": "Yearly subscription",
  "currency": "EUR",
  "status": "active",
  "purchase_order": "<string>",
  "customer_id": "cus_QalW2vTAdkR6IY",
  "invoicing_entity_id": "ive_jerrb484RHn",
  "plan_id": "plan_zHmjoDee4ZRmQV",
  "template_id": "subt_7gdusOkqr5L0B8",
  "checkout_session_id": "<string>",
  "crm_opportunity_id": null,
  "minimum_invoice_fee": 250,
  "commitment_interval": {
    "period": "years",
    "count": 1
  },
  "renew_automatically": true,
  "renew_for": {
    "period": "years",
    "count": 1
  },
  "activation_strategy": "start_date",
  "starts_at": "2024-12-20T16:04:11Z",
  "contract_start": "2024-01-15T00:00:00Z",
  "contract_end": "2025-01-15T00:00:00Z",
  "initial_billing_at": "2024-12-20T16:04:11Z",
  "paused_at": "2024-12-20T16:04:11Z",
  "reactivate_at": "2024-12-20T16:04:11Z",
  "cancel_at": "2024-12-20T16:04:11Z",
  "cancellation_amount": 123,
  "cancellation_reason": "<string>",
  "estimated_arr": 123,
  "contract_value": 123,
  "current_period_started_at": "2024-12-20T16:04:11Z",
  "current_period_ends_at": "2024-12-20T16:04:11Z",
  "next_payment_at": "2024-12-20T16:04:11Z",
  "next_payment_amount": 123,
  "renews_at": "2024-12-20T16:04:11Z",
  "current_phase_id": "<string>",
  "display_shipping_details": true,
  "properties": null,
  "custom_properties": {},
  "generate_document": true,
  "document_name": "<string>",
  "add_tax_to_document": true,
  "generate_draft_invoices": true,
  "invoice_custom_note": "<string>",
  "created_at": "2024-10-12T07:00:01.860Z",
  "updated_at": "2024-10-12T07:00:01.860Z",
  "products": [
    {
      "id": "itm_FJKlqUb8COXw55",
      "name": "Product name",
      "description": "A description of the product.",
      "description_display_interval_dates": true,
      "attached_at": "2024-01-15T00:00:00Z",
      "detached_at": "2024-04-15T00:00:00Z",
      "current_period_started_at": "2024-01-15T00:00:00Z",
      "current_period_ends_at": "2024-02-15T00:00:00Z",
      "next_payment_at": "2024-02-15T00:00:00Z",
      "payment_interval": {
        "period": "once"
      },
      "payment_schedule": "start",
      "type": "flat_fee",
      "count": 1,
      "prices": [
        {
          "type": "fee",
          "amount": 123,
          "id": "<string>"
        }
      ]
    }
  ],
  "coupons": [
    {
      "description": null,
      "expiration_date": null,
      "redemption_limit": null,
      "product_ids": [
        "itm_FJKlqUb8COXw55"
      ],
      "repeat": "forever",
      "duration": {
        "count": 3,
        "period": "months"
      },
      "created_at": "2024-12-20T16:04:11Z",
      "type": "amount",
      "discount_amount": 2000,
      "currency": "EUR",
      "id": "cou_DKL4Xcb5VSa8CQ",
      "promotion_code_id": null,
      "name": "Partner discount",
      "subscription_coupon_id": "coos_d9pVekhjoGppuX",
      "duration_count": 123,
      "apply_at": null,
      "expires_at": null
    }
  ],
  "integrations": [
    {
      "entity_id": "123456789",
      "provider_name": "stripe",
      "provider_account_id": "acc_1234567890"
    }
  ],
  "phases": [
    {
      "id": "sup_1FoLfIQ5VOMbXf",
      "type": "standard",
      "status": "pending",
      "order": 0,
      "activation_strategy": "manual",
      "end_strategy": "duration",
      "duration": {
        "count": 1,
        "period": "years"
      },
      "billing_date_setting": "phase_start",
      "initial_billing_at": null,
      "starts_at": null,
      "ends_at": null,
      "billing_cycle_alignment": "anniversary",
      "do_not_invoice_phase": false,
      "transition_calculation_method": "prorata",
      "transition_invoicing_schedule": "immediately",
      "products": [
        {
          "id": "itm_FJKlqUb8COXw55",
          "name": "Product name",
          "description": "A description of the product.",
          "description_display_interval_dates": true,
          "attached_at": "2024-01-15T00:00:00Z",
          "detached_at": "2024-04-15T00:00:00Z",
          "current_period_started_at": "2024-01-15T00:00:00Z",
          "current_period_ends_at": "2024-02-15T00:00:00Z",
          "next_payment_at": "2024-02-15T00:00:00Z",
          "payment_interval": {
            "period": "once"
          },
          "payment_schedule": "start",
          "type": "flat_fee",
          "count": 1,
          "prices": [
            {
              "type": "fee",
              "amount": 123,
              "id": "<string>"
            }
          ]
        }
      ],
      "coupons": [
        {
          "description": null,
          "expiration_date": null,
          "redemption_limit": null,
          "product_ids": [
            "itm_FJKlqUb8COXw55"
          ],
          "repeat": "forever",
          "duration": {
            "count": 3,
            "period": "months"
          },
          "created_at": "2024-12-20T16:04:11Z",
          "type": "amount",
          "discount_amount": 2000,
          "currency": "EUR",
          "id": "cou_DKL4Xcb5VSa8CQ",
          "promotion_code_id": null,
          "name": "Partner discount",
          "subscription_coupon_id": "coos_d9pVekhjoGppuX",
          "duration_count": 123,
          "apply_at": null,
          "expires_at": null
        }
      ],
      "created_at": "2024-10-12T07:00:01.860Z",
      "updated_at": "2024-10-12T07:00:01.860Z"
    }
  ],
  "quote": {
    "id": "quo_38YwqvItBH3d8a",
    "status": "signed"
  },
  "plan": {
    "id": "plan_zHmjoDee4ZRmQV",
    "name": "My example plan"
  },
  "template": {
    "id": "subt_7gdusOkqr5L0B8",
    "name": "My example template",
    "configurationId": "subtc_7mHWOlPStUogvp"
  },
  "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": null
    },
    "url": "https://billing.hyperline.co/checkout/che_hEUPdVG7IgjpW1"
  },
  "payment_method": {
    "id": "pm_1xMpj5bwRqN7LM",
    "status": "active",
    "type": "card",
    "last_4_digits": 2718,
    "expiration_date": "2027-11",
    "brand": "<string>"
  },
  "contract_terms": {
    "status": "active",
    "activation_strategy": "start_date",
    "end_strategy": "duration",
    "starts_at": "2024-12-31T23:00:00.000Z",
    "ends_at": "2025-06-30T21:59:59.999Z",
    "duration": {
      "count": 6,
      "period": "months"
    },
    "renew_automatically": true,
    "renew_for_duration": {
      "count": 1,
      "period": "years"
    },
    "current_period_started_at": "2025-06-30T22:00:00.000Z",
    "current_period_ends_at": "2026-06-30T21:59:59.999Z"
  }
}

Autorisations

Authorization
string
header
requis

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

Paramètres de chemin

id
string
requis

Corps

application/json
up_to
string<date-time>
requis

The date up to which the subscription should be renewed (exclusive).

Exemple:

"2024-12-20T16:04:11Z"

Réponse

200 - application/json
id
string
requis

Subscription ID.

Exemple:

"sub_B6ClkdqNqVNBgY"

name
string | null
requis

Subscription custom name.

Exemple:

"Yearly subscription"

currency
enum<string>
requis

Currency code. See ISO 4217.

Options disponibles:
EUR,
AED,
AFN,
XCD,
ALL,
AMD,
AOA,
ARS,
USD,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
XOF,
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
Exemple:

"EUR"

status
enum<string>
requis

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.
Options disponibles:
active,
cancelled,
draft,
errored,
paused,
pending,
voided
Exemple:

"active"

purchase_order
string | null
requis

Reference to the purchase order.

customer_id
string
requis

ID of the customer.

Exemple:

"cus_QalW2vTAdkR6IY"

invoicing_entity_id
string | null
requis

ID of the invoicing entity attached to the subscription. If not defined, fallback to customer's invoicing entity.

Exemple:

"ive_jerrb484RHn"

plan_id
string | null
requis
obsolète

ID of the plan that the subscription is linked to.

Exemple:

"plan_zHmjoDee4ZRmQV"

template_id
string | null
requis

ID of the template that the subscription is linked to.

Exemple:

"subt_7gdusOkqr5L0B8"

checkout_session_id
string | null
requis

ID of the checkout session.

crm_opportunity_id
string | null
requis

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

Exemple:

null

minimum_invoice_fee
number | null
requis

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

Exemple:

250

commitment_interval
object
requis
obsolète

Deprecated field, please use contract_terms.

Exemple:
{ "period": "years", "count": 1 }
renew_automatically
boolean
requis

Deprecated field, please use contract_terms.

Exemple:

true

renew_for
object
requis

Deprecated field, please use contract_terms.

Exemple:
{ "period": "years", "count": 1 }
activation_strategy
enum<string> | null
requis

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.
Options disponibles:
start_date,
manually,
checkout,
quote,
contract_start_date
Exemple:

"start_date"

starts_at
string<date-time> | null
requis
obsolète

Applies only if the activation strategy is start_date. UTC date time string in the ISO 8601 format.

Exemple:

"2024-12-20T16:04:11Z"

contract_start
string<date-time> | null
requis

Deprecated field, please use contract_terms.

Exemple:

"2024-01-15T00:00:00Z"

contract_end
string<date-time> | null
requis

Deprecated field, please use contract_terms.

Exemple:

"2025-01-15T00:00:00Z"

initial_billing_at
string<date-time> | null
requis

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

Exemple:

"2024-12-20T16:04:11Z"

paused_at
string<date-time> | null
requis

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

Exemple:

"2024-12-20T16:04:11Z"

reactivate_at
string<date-time> | null
requis

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

Exemple:

"2024-12-20T16:04:11Z"

cancel_at
string<date-time> | null
requis

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

Exemple:

"2024-12-20T16:04:11Z"

cancellation_strategy
enum<string> | null
requis

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.
Options disponibles:
refund_prorata,
refund_custom,
charge_prorata,
charge_custom,
end_of_period,
do_nothing
cancellation_amount
number | null
requis

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

cancellation_reason
string | null
requis

Reason for the cancellation.

cancellation_source
enum<string> | null
requis

Origin of the cancellation.

  • portal: customer cancelled themselves from the hosted customer portal.
  • app: admin cancelled from the Hyperline dashboard.
  • api: cancelled programmatically through the public API.
  • system: cancelled by an automated internal process.
Options disponibles:
portal,
app,
api,
system
estimated_arr
number | null
requis

Estimated Annual Recurring Revenue generated by the subscription.

contract_value
number | null
requis

Contract value of the subscription. This value is overridable by the user.

current_period_started_at
string<date-time> | null
requis

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

Exemple:

"2024-12-20T16:04:11Z"

current_period_ends_at
string<date-time> | null
requis

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

Exemple:

"2024-12-20T16:04:11Z"

next_payment_at
string<date-time> | null
requis

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

Exemple:

"2024-12-20T16:04:11Z"

next_payment_amount
number | null
requis

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

renews_at
string<date-time> | null
requis

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

Exemple:

"2024-12-20T16:04:11Z"

current_phase_id
string | null
requis

ID of the current subscription phase.

display_shipping_details
boolean | null
requis

Indicates if the shipping details should be displayed on the subscription's invoices.

properties
object
requis

Key/value pairs to store any metadata useful in your context.

Exemple:

null

custom_properties
object
requis

A list of key value with the slug of the custom property as the key and the custom property value as value.

invoice_schedule
enum<string> | null
requis

Defines when invoices are generated relative to the billing period.

  • period_start: Invoices are generated at the start of the billing period.
  • period_end: Invoices are generated at the end of the billing period.
Options disponibles:
period_start,
period_end
generate_document
boolean
requis

Generate documents instead of invoices for the subscription.

document_name
string | null
requis

If generate_document is turned on, allows you to give a name to your document.

add_tax_to_document
boolean
requis

If generate_document is turned on, will add taxes to document.

generate_draft_invoices
boolean
requis

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

invoice_custom_note
string | null
requis

Default custom note added to invoices generated by the subscription.

created_at
string<date-time>
requis

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

Exemple:

"2024-10-12T07:00:01.860Z"

updated_at
string<date-time>
requis

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

Exemple:

"2024-10-12T07:00:01.860Z"

products
(Fee product · object | Seat product · object | Dynamic product · object | Credit product · object | Bundle product · object)[]
requis

Products that make up the subscription.

coupons
(Coupon amount · object | Coupon percent · object)[]
requis

Coupons to be applied to the prices of subscription products.

integrations
object[]
requis

References to this subscription in external providers (billing, CRM, etc).

phases
object[]
requis

Phases of the subscription.

quote
object
requis
plan
object
requis
template
object
requis
checkout_session
object
requis

Checkout session of the subscription.

payment_method_type
enum<string> | null
requis

Payment method type used to pay the subscription.

Options disponibles:
card,
apple_pay,
google_pay,
direct_debit,
direct_debit_ach,
direct_debit_bacs,
stripe_link,
transfer,
transfer_automated,
external
payment_method
Card · object
requis

Payment method details used to pay the subscription.

contract_terms
object
requis

Contract terms linked to the subscription.