v1

latestOpenAPI 3.1.02026-07-222392081.7 MB
Subscriptions > Templates

Update subscription template configuration

Replace an existing configuration for a subscription template.

put/v1/subscriptions/templates/{templateId}/configurations/{id}

Path parameters

templateIdstring required
idstring required

Request body

currency'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' required

Subscription template currency.

country'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AO' | 'AQ' | 'AR' | 'AS' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BF' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FM' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'IC' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PR' | 'PS' | 'PT' | 'PT-20' | 'PT-30' | 'PW' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VI' | 'VN' | 'VU' | 'WF' | 'WS' | 'XK' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW' nullable required

Subscription template country.

namestring

Subscription custom name.

minimum_invoice_feenumber nullable

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

cancel_atstring date-time

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

cancellation_strategy'refund_prorata' | 'refund_custom' | 'charge_prorata' | 'charge_custom' | 'end_of_period' | 'do_nothing'

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.
custom_propertiesobject

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

document_namestring nullable

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

Example request

{
  "currency": "EUR",
  "minimum_invoice_fee": 250,
  "cancel_at": "2024-12-20T16:04:11Z",
  "contract_terms": {
    "starts_at": "2024-12-20T16:04:11Z",
    "ends_at": "2024-12-20T16:04:11Z",
    "duration": {
      "count": 6,
      "period": "months"
    },
    "renew_for_duration": {
      "count": 1,
      "period": "years"
    },
    "activation_strategy": "start_date",
    "end_strategy": "duration"
  },
  "phases": [
    {
      "name": "Initial term",
      "type": "standard",
      "status": "pending",
      "activation_strategy": "manual",
      "end_strategy": "duration",
      "duration": {
        "count": 1,
        "period": "years"
      },
      "billing_date_setting": "phase_start",
      "initial_billing_at": "2024-12-20T16:04:11Z",
      "starts_at": "2024-12-20T16:04:11Z",
      "ends_at": "2024-12-20T16:04:11Z",
      "billing_cycle_alignment": "anniversary",
      "transition_calculation_method": "prorata",
      "transition_invoicing_schedule": "immediately",
      "products": [
        {
          "id": "itm_FJKlqUb8COXw55",
          "name": "Product name",
          "description": "A description of the product.",
          "payment_interval": {
            "period": "once"
          },
          "payment_schedule": "start",
          "price": {
            "type": "fee",
            "amount": 200
          },
          "prices": [
            {
              "type": "volume",
              "from": 0,
              "to": 20,
              "amount": 200,
              "unit_count": 1,
              "on_tier_incomplete": null
            },
            {
              "type": "volume",
              "from": 20,
              "to": null,
              "amount": 150,
              "unit_count": 1,
              "on_tier_incomplete": null
            }
          ],
          "count": 2,
          "unit_name": "user"
        }
      ],
      "coupons": [
        {
          "expires_at": "2024-12-20T16:04:11Z",
          "apply_at": "2024-12-20T16:04:11Z"
        }
      ]
    }
  ]
}

Response

idstring required