# Import a subscription

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


[Idempotency Supported](/docs/api/v2/pcv-1/idempotency)

Imports a subscription into Chargebee.

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/subscriptions/import_subscription \
     -u {site_api_key}:\
     -d plan_id="no_trial" \
     -d status="ACTIVE" \
     -d current_term_end=1602095400 \
     -d "customer[first_name]"="John" \
     -d "customer[last_name]"="Doe" \
     -d "customer[locale]"="fr-CA" \
     -d "customer[phone]"="+1-949-999-9999" \
     -d "billing_address[first_name]"="John" \
     -d "billing_address[last_name]"="Doe" \
     -d "billing_address[line1]"="PO Box 9999" \
     -d "billing_address[city]"="Walnut" \
     -d "billing_address[state]"="California" \
     -d "billing_address[zip]"="91789" \
     -d "billing_address[country]"="US" \
     -d billing_cycles=5 \
     -d "addons[id][0]"="ssl" \
     -d "contract_term[action_at_term_end]"="RENEW" \
     -d contract_term_billing_cycle_on_renewal=3 \
     -d "contract_term[contract_start]"=1509511210 \
     -d "contract_term[cancellation_cutoff_period]"=3 \
     -d "contract_term[created_at]"=1509511210 \
     -d "contract_term[total_amount_raised]"=900 \
     -d "contract_term[billing_cycle]"=5
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Subscription.ImportSubscription()
		.PlanId("no_trial")
		.Status(Subscription.StatusEnum.Active)
		.CurrentTermEnd(1602095400)
		.CustomerFirstName("John")
		.CustomerLastName("Doe")
		.CustomerLocale("fr-CA")
		.CustomerPhone("+1-949-999-9999")
		.BillingAddressFirstName("John")
		.BillingAddressLastName("Doe")
		.BillingAddressLine1("PO Box 9999")
		.BillingAddressCity("Walnut")
		.BillingAddressState("California")
		.BillingAddressZip("91789")
		.BillingAddressCountry("US")
		.BillingCycles(5)
		.AddonId(0, "ssl")
		.ContractTermActionAtTermEnd(Subscription.SubscriptionContractTerm.ActionAtTermEndEnum.Renew)
		.ContractTermContractStart(1509511210)
		.ContractTermCancellationCutoffPeriod(3)
		.ContractTermCreatedAt(1509511210)
		.ContractTermTotalAmountRaised(900)
		.ContractTermBillingCycle(5)
		.ContractTermBillingCycleOnRenewal(3)
		.Request();

Subscription subscription = result.Subscription;
Customer customer = result.Customer;
Card card = result.Card;
Invoice invoice = result.Invoice;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    subscriptionAction "github.com/chargebee/chargebee-go/v3/actions/subscription"
    "github.com/chargebee/chargebee-go/v3/models/subscription"
    subscriptionEnum "github.com/chargebee/chargebee-go/v3/models/subscription/enum"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := subscriptionAction.ImportSubscription(&subscription.ImportSubscriptionRequestParams{
        Addons : []*subscription.ImportSubscriptionAddonParams{
            {
                Id : "ssl",
            },
        },
        PlanId : "no_trial",
        Status : subscriptionEnum.StatusActive,
        CurrentTermEnd : chargebee.Int64(1602095400),
        Customer : &subscription.ImportSubscriptionCustomerParams{
            FirstName : "John",
            LastName : "Doe",
            Locale : "fr-CA",
            Phone : "+1-949-999-9999",
        },
        BillingAddress : &subscription.ImportSubscriptionBillingAddressParams{
            FirstName : "John",
            LastName : "Doe",
            Line1 : "PO Box 9999",
            City : "Walnut",
            State : "California",
            Zip : "91789",
            Country : "US",
        },
        BillingCycles : chargebee.Int32(5),
        ContractTerm : &subscription.ImportSubscriptionContractTermParams{
            ActionAtTermEnd : subscriptionEnum.ContractTermActionAtTermEndRenew,
            ContractStart : chargebee.Int64(1509511210),
            CancellationCutoffPeriod : chargebee.Int32(3),
            CreatedAt : chargebee.Int64(1509511210),
            TotalAmountRaised : chargebee.Int64(900),
            BillingCycle : chargebee.Int32(5),
        },
        ContractTermBillingCycleOnRenewal : chargebee.Int32(3),
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.SubscriptionImportSubscriptionRequest{
    Addons : []*chargebee.SubscriptionImportSubscriptionAddon{
        {
            Id : "ssl",
        },
    },
    PlanId : "no_trial",
    Status : chargebee.SubscriptionStatusActive,
    CurrentTermEnd : chargebee.Int64(1602095400),
    Customer : &chargebee.SubscriptionImportSubscriptionCustomer{
        FirstName : "John",
        LastName : "Doe",
        Locale : "fr-CA",
        Phone : "+1-949-999-9999",
    },
    BillingAddress : &chargebee.SubscriptionImportSubscriptionBillingAddress{
        FirstName : "John",
        LastName : "Doe",
        Line1 : "PO Box 9999",
        City : "Walnut",
        State : "California",
        Zip : "91789",
        Country : "US",
    },
    BillingCycles : chargebee.Int32(5),
    ContractTerm : &chargebee.SubscriptionImportSubscriptionContractTerm{
        ActionAtTermEnd : chargebee.ContractTermActionAtTermEndRenew,
        ContractStart : chargebee.Int64(1509511210),
        CancellationCutoffPeriod : chargebee.Int32(3),
        CreatedAt : chargebee.Int64(1509511210),
        TotalAmountRaised : chargebee.Int64(900),
        BillingCycle : chargebee.Int32(5),
    },
    ContractTermBillingCycleOnRenewal : chargebee.Int32(3),
}
  res, err := client.Subscription.ImportSubscription(req)
      if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;
import java.sql.Timestamp;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = Subscription.importSubscription()
            .planId("no_trial")
            .status(Subscription.Status.ACTIVE)
            .currentTermEnd(new Timestamp(1602095400L * 1000))
            .customerFirstName("John")
            .customerLastName("Doe")
            .customerLocale("fr-CA")
            .customerPhone("+1-949-999-9999")
            .billingAddressFirstName("John")
            .billingAddressLastName("Doe")
            .billingAddressLine1("PO Box 9999")
            .billingAddressCity("Walnut")
            .billingAddressState("California")
            .billingAddressZip("91789")
            .billingAddressCountry("US")
            .billingCycles(5)
            .addonId(0, "ssl")
            .contractTermActionAtTermEnd(Subscription.ContractTerm.ActionAtTermEnd.RENEW)
            .contractTermContractStart(new Timestamp(1509511210L * 1000))
            .contractTermCancellationCutoffPeriod(3)
            .contractTermCreatedAt(new Timestamp(1509511210L * 1000))
            .contractTermTotalAmountRaised(900L)
            .contractTermBillingCycle(5)
            .contractTermBillingCycleOnRenewal(3)
            .request();

        Subscription subscription = result.subscription();
        Customer customer = result.customer();
        Card card = result.card();
        Invoice invoice = result.invoice();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.card.Card;
import com.chargebee.v4.models.customer.Customer;
import com.chargebee.v4.models.invoice.Invoice;
import com.chargebee.v4.models.subscription.Subscription;
import com.chargebee.v4.models.subscription.params.ImportSubscriptionParams;
import com.chargebee.v4.models.subscription.responses.ImportSubscriptionResponse;
import java.sql.Timestamp;
import java.util.List;

public class ImportSubscription {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        ImportSubscriptionParams.CustomerParams customerParams =
            ImportSubscriptionParams.CustomerParams.builder()
                .firstName("John")
                .lastName("Doe")
                .locale("fr-CA")
                .phone("+1-949-999-9999")
                .build();

        ImportSubscriptionParams.BillingAddressParams billingAddressParams =
            ImportSubscriptionParams.BillingAddressParams.builder()
                .firstName("John")
                .lastName("Doe")
                .line1("PO Box 9999")
                .city("Walnut")
                .state("California")
                .zip("91789")
                .country("US")
                .build();

        ImportSubscriptionParams.ContractTermParams contractTermParams =
            ImportSubscriptionParams.ContractTermParams.builder()
                .actionAtTermEnd(ImportSubscriptionParams.ContractTermParams.ActionAtTermEnd.RENEW)
                .contractStart(new Timestamp(1509511210L * 1000))
                .cancellationCutoffPeriod(3)
                .createdAt(new Timestamp(1509511210L * 1000))
                .totalAmountRaised(900L)
                .billingCycle(5)
                .build();

        ImportSubscriptionParams.AddonsParams addon0 =
            ImportSubscriptionParams.AddonsParams.builder()
                .id("ssl")
                .build();

        List<ImportSubscriptionParams.AddonsParams> addonsList =
            List.of(addon0);

        ImportSubscriptionParams params = ImportSubscriptionParams.builder()
            .planId("no_trial")
            .status(ImportSubscriptionParams.Status.ACTIVE)
            .currentTermEnd(new Timestamp(1602095400L * 1000))
            .customer(customerParams)
            .billingAddress(billingAddressParams)
            .billingCycles(5)
            .addons(addonsList)
            .contractTerm(contractTermParams)
            .contractTermBillingCycleOnRenewal(3)
            .build();

        ImportSubscriptionResponse response = client.subscriptions().importSubscription(params);

        Subscription subscription = response.getSubscription();
        Customer customer = response.getCustomer();
        Card card = response.getCard();
        Invoice invoice = response.getInvoice();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.subscription.importSubscription({
        addons: [
            {
                id: "ssl"
            }
        ],
        plan_id: "no_trial",
        status: "active",
        current_term_end: 1602095400,
        customer: {
            first_name: "John",
            last_name: "Doe",
            locale: "fr-CA",
            phone: "+1-949-999-9999"
        },
        billing_address: {
            first_name: "John",
            last_name: "Doe",
            line1: "PO Box 9999",
            city: "Walnut",
            state: "California",
            zip: 91789,
            country: "US"
        },
        billing_cycles: 5,
        contract_term: {
            action_at_term_end: "renew",
            contract_start: 1509511210,
            cancellation_cutoff_period: 3,
            created_at: 1509511210,
            total_amount_raised: 900,
            billing_cycle: 5
        },
        contract_term_billing_cycle_on_renewal: 3
    });

    console.log(result);
    const subscription = result.subscription;
    const customer = result.customer;
    const card = result.card;
    const invoice = result.invoice;
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->subscription()->importSubscription([
    "addons" => [
        [
            "id" => "ssl"
        ]
    ],
    "plan_id" => "no_trial",
    "status" => "active",
    "current_term_end" => 1602095400,
    "customer" => [
        "first_name" => "John",
        "last_name" => "Doe",
        "locale" => "fr-CA",
        "phone" => "+1-949-999-9999"
    ],
    "billing_address" => [
        "first_name" => "John",
        "last_name" => "Doe",
        "line1" => "PO Box 9999",
        "city" => "Walnut",
        "state" => "California",
        "zip" => "91789",
        "country" => "US"
    ],
    "billing_cycles" => 5,
    "contract_term" => [
        "action_at_term_end" => "renew",
        "contract_start" => 1509511210,
        "cancellation_cutoff_period" => 3,
        "created_at" => 1509511210,
        "total_amount_raised" => 900,
        "billing_cycle" => 5
    ],
    "contract_term_billing_cycle_on_renewal" => 3
]);
$subscription = $result->subscription;
$customer = $result->customer;
$card = $result->card;
$invoice = $result->invoice;
```

#### Python

```python
import chargebee
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Subscription.import_subscription(
    cb_client.Subscription.ImportSubscriptionParams(
        addons=[
            cb_client.Subscription.ImportSubscriptionAddonParams(
              id="ssl"
            )
        ],
        plan_id="no_trial",
        status=chargebee.Subscription.Status.ACTIVE,
        current_term_end=1602095400,
        customer=cb_client.Subscription.ImportSubscriptionCustomerParams(
            first_name="John",
            last_name="Doe",
            locale="fr-CA",
            phone="+1-949-999-9999"
        ),
        billing_address=cb_client.Subscription.ImportSubscriptionBillingAddressParams(
            first_name="John",
            last_name="Doe",
            line1="PO Box 9999",
            city="Walnut",
            state="California",
            zip="91789",
            country="US"
        ),
        billing_cycles=5,
        contract_term=cb_client.Subscription.ImportSubscriptionContractTermParams(
            action_at_term_end=chargebee.Subscription.ContractTermActionAtTermEnd.RENEW,
            contract_start=1509511210,
            cancellation_cutoff_period=3,
            created_at=1509511210,
            total_amount_raised=900,
            billing_cycle=5
        ),
        contract_term_billing_cycle_on_renewal=3
    )
)
subscription = response.subscription
customer = response.customer
card = response.card
invoice = response.invoice
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

result = ChargeBee::Subscription.import_subscription({
  :plan_id => "no_trial",
  :status => "ACTIVE",
  :current_term_end => 1602095400,
  :customer => {
    :first_name => "John",
    :last_name => "Doe",
    :locale => "fr-CA",
    :phone => "+1-949-999-9999"
  },
  :billing_address => {
    :first_name => "John",
    :last_name => "Doe",
    :line1 => "PO Box 9999",
    :city => "Walnut",
    :state => "California",
    :zip => "91789",
    :country => "US"
  },
  :billing_cycles => 5,
  :addons => [
    {
      :id => "ssl"
    }
  ],
  :contract_term => {
    :action_at_term_end => "RENEW",
    :contract_start => 1509511210,
    :cancellation_cutoff_period => 3,
    :created_at => 1509511210,
    :total_amount_raised => 900,
    :billing_cycle => 5
  },
  :contract_term_billing_cycle_on_renewal => 3
})

subscription = result.subscription
customer = result.customer
card = result.card
invoice = result.invoice
```

## Sample Response

```json
{
  "customer": {
    "allow_direct_debit": false,
    "auto_collection": "on",
    "billing_address": {
      "city": "Walnut",
      "country": "US",
      "first_name": "John",
      "last_name": "Doe",
      "line1": "PO Box 9999",
      "object": "billing_address",
      "state": "California",
      "state_code": "CA",
      "validation_status": "not_validated",
      "zip": "91789"
    },
    "card_status": "no_card",
    "created_at": 1517505656,
    "deleted": false,
    "excess_payments": 0,
    "first_name": "John",
    "id": "__test__KyVnHhSBWko452Uw",
    "last_name": "Doe",
    "locale": "fr-CA",
    "net_term_days": 0,
    "object": "customer",
    "phone": "+1-949-999-9999",
    "pii_cleared": "active",
    "preferred_currency_code": "USD",
    "promotional_credits": 0,
    "refundable_credits": 0,
    "resource_version": 1517505656000,
    "taxability": "taxable",
    "unbilled_charges": 0,
    "updated_at": 1517505656
  },
  "subscription": {
    "activated_at": 1517505655,
    "addons": [
      {
        "amount": 495,
        "id": "ssl",
        "object": "addon",
        "quantity": 1,
        "unit_price": 495
      },
      {..}
    ],
    "billing_period": 1,
    "billing_period_unit": "month",
    "contract_term": {
      "action_at_term_end": "renew",
      "billing_cycle": 5,
      "cancellation_cutoff_period": 3,
      "contract_end": 1612722600,
      "contract_start": 1509511210,
      "created_at": 1509511210,
      "id": "__test__KyVnHhSBWko4l2Uy",
      "object": "contract_term",
      "remaining_billing_cycles": 4,
      "status": "active",
      "total_contract_value": 6460
    },
    "contract_term_billing_cycle_on_renewal": 3,
    "created_at": 1517505656,
    "currency_code": "USD",
    "current_term_end": 1602095400,
    "current_term_start": 1517505655,
    "customer_id": "__test__KyVnHhSBWko452Uw",
    "deleted": false,
    "due_invoices_count": 0,
    "has_scheduled_changes": false,
    "id": "__test__KyVnHhSBWko452Uw",
    "mrr": 0,
    "next_billing_at": 1602095400,
    "object": "subscription",
    "plan_amount": 895,
    "plan_free_quantity": 0,
    "plan_id": "no_trial",
    "plan_quantity": 1,
    "plan_unit_price": 895,
    "remaining_billing_cycles": 4,
    "resource_version": 1517505656000,
    "started_at": 1517505655,
    "status": "active",
    "updated_at": 1517505656
  }
}
```

## URL Format

**POST** https://[site].chargebee.com/api/v2/subscriptions/import_subscription

## Input Parameters

- `id` (optional, string, max chars=50)
  Id for the new subscription. If not given, this will be auto-generated.

- `client_profile_id` (optional, string, max chars=50)
  Indicates the Client profile id for the customer. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.

- `plan_id` (required, string, max chars=100)
  Identifier of the plan for this subscription.

- `plan_quantity` (optional, integer, default=1, min=1)
  Plan quantity for this subscription.

- `plan_quantity_in_decimal` (optional, string, max chars=33)
  The decimal representation of the quantity of the plan purchased. Can be provided for quantity-based plans and only when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.

- `plan_unit_price` (optional, in cents, min=0)
  Amount that will override the Plan's default price. The unit depends on the [type of currency](/docs/api/getting-started) .

- `plan_unit_price_in_decimal` (optional, string, max chars=39)
  When [price overriding](http://chargebee.com/docs/price-override.html ) is enabled for the site, the price or per-unit price of the plan can be set here. The value [set for the plan](/docs/api/v2/pcv-1/plans/plan-object#price) is used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.

- `setup_fee` (optional, in cents, min=0)
  Amount that will override the default setup fee. The unit depends on the [type of currency](/docs/api/getting-started) .

- `trial_end` (optional, timestamp(UTC) in seconds)
  The time at which the trial ends for this subscription. Can be specified to override the default trial period.If **'0'** is passed, the subscription will be activated immediately.

- `billing_cycles` (optional, integer, min=0)
  Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.

- `start_date` (optional, timestamp(UTC) in seconds)
  The date/time at which the subscription is to start or has started. If not provided, the subscription starts immediately.

- `auto_collection` (optional, enumerated string)
  Defines whether payments need to be collected automatically for this subscription. Overrides customer's auto-collection property.
  Possible enum values:
    - `on`
      Whenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available.
    - `off`
      Automatic collection of charges will not be made for this subscription. Use this for offline payments.

- `po_number` (optional, string, max chars=100)
  Purchase order number for this subscription.

- `coupon_ids` (optional, string, max chars=100)
  List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.

- `contract_term_billing_cycle_on_renewal` (optional, integer, min=1, max=100)
  Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as `billing_cycles` or a custom value depending on the [site configuration](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms) .

- `status` (required, enumerated string)
  Current state of the subscription.
  Possible enum values:
    - `future`
      The subscription is scheduled to start at a future date.
    - `in_trial`
      The subscription is in trial.
    - `active`
      The subscription is active and will be charged for automatically based on the items in it.
    - `non_renewing`
      The subscription will be canceled at the end of the current term.
    - `paused`
      The subscription is [paused](https://www.chargebee.com/docs/2.0/pause-subscription.html). The subscription will not renew while in this state.
    - `cancelled`
      The subscription has been canceled and is no longer in service.
    - `transferred`
      The subscription has been transferred to another business entity within the organization.

- `current_term_end` (optional, timestamp(UTC) in seconds)
  End of the current billing term. Subscription is renewed immediately after this. If not given, this will be calculated based on plan billing cycle.
  
  **Note:**
  
  For subscription status: `non_renewing`, `active`, and `paused`, `current_term_end` is required.
  
  .

- `current_term_start` (optional, timestamp(UTC) in seconds)
  Start of the current billing period of the subscription. This is required when the subscription `status` is `paused`. When the `status` is `active` or `non_renewing` , it defaults to the current time.

- `trial_start` (optional, timestamp(UTC) in seconds)
  Start of the trial period for the subscription. When not passed, it is assumed to be current time. When passed for a `future` subscription, it implies that the subscription goes into `in_trial` when it starts.

- `cancelled_at` (optional, timestamp(UTC) in seconds)
  Time at which subscription was cancelled or is set to be cancelled.

- `started_at` (optional, timestamp(UTC) in seconds)
  Time at which the subscription was started. Is `null` for `future` subscriptions as it is yet to be started.

- `activated_at` (optional, timestamp(UTC) in seconds)
  The time at which the subscription was activated. A subscription is "activated" when its `status` changes from any other, to either `active` or `non_renewing`.
  
  The following conditions must be satisfied when passing this parameter:
  
  -   When `status` is `active`, `non_renewing`, or `paused`, `activated_at` must be on or after `trial_end` or `started_at`. Additionally, `activated_at` must be on or before `current_term_start`.
  -   When `status` is `in_trial`, `activated_at` must precede `trial_start`
  
  #### Note:[](#note)
  
  This parameter should not be provided when passing `status` as `future` or `cancelled`.

- `pause_date` (optional, timestamp(UTC) in seconds)
  When a pause has been scheduled, it is the date/time of scheduled pause. When the subscription is in the `paused` state, it is the date/time when the subscription was paused.

- `resume_date` (optional, timestamp(UTC) in seconds)
  For a paused subscription, it is the date/time when the subscription is scheduled to resume. If the pause is for an indefinite period, this value is not returned.

- `create_current_term_invoice` (optional, boolean, default=false)
  Set as `true` if you want an invoice to be created for the subscription.
  
  -   The invoice will be created for the subscription only if it has an `active` or `non_renewing` status.
  -   The period of the invoice is from `current_term_start` to `current_term_end`.
  -   The invoice will not be generated if the subscription amount is zero dollars (for that period) and 'Hide Zero Value Line Items' option is enabled in site settings.

- `affiliate_token` (optional, string, max chars=250)
  A unique tracking token.

- `invoice_notes` (optional, string, max chars=2000)
  A customer-facing note added to all invoices associated with this subscription. This note is one among [all the notes](/docs/api/invoices/invoice-object#notes) displayed on the invoice PDF.

- `meta_data` (optional, jsonobject)
  A collection of key-value pairs that provides extra information about the subscription.
  
  **Note:** There's a character limit of 65,535.
  
  [Learn more](/docs/api/v2/pcv-1/advanced-features) .

- `customer` (optional, string)
  Parameters for customer
  - `id` (optional, string, max chars=50)
    The unique ID of the customer for which this `hosted_page` should be created. When not provided, a new customer is created with the ID set to the value provided for `subscription[id]`. If `subscription[id]` is unavailable, then the customer ID is autogenerated.
  - `email` (optional, string, max chars=70)
    Email of the customer. Configured email notifications will be sent to this email.
  - `first_name` (optional, string, max chars=150)
    First name of the customer
  - `last_name` (optional, string, max chars=150)
    Last name of the customer
  - `company` (optional, string, max chars=250)
    Company name of the customer.
  - `phone` (optional, string, max chars=50)
    Phone number of the customer
  - `locale` (optional, string, max chars=50)
    Determines which region-specific language Chargebee uses to communicate with the customer. In the absence of the locale attribute, Chargebee will use your site's default language for customer communication.
  - `taxability` (optional, enumerated string, default=taxable)
    Specifies if the customer is liable for tax
    Possible enum values:
      - `taxable`
        Computes tax for the customer based on the [site configuration](https://www.chargebee.com/docs/tax.html). In some cases, depending on the region, shipping\_address is needed. If not provided, then billing\_address is used to compute tax. If that's not available either, the tax is taken as zero.
      - `exempt`
        -   Customer is exempted from tax. When using Chargebee's native [Taxes](https://www.chargebee.com/docs/tax.html) feature or when using the [TaxJar integration](https://www.chargebee.com/docs/taxjar.html), no other action is needed.
        -   However, when using our [Avalara integration](https://www.chargebee.com/docs/avalara.html), optionally, specify `entity_code` or `exempt_number` attributes if you use Chargebee's [AvaTax for Sales](https://www.chargebee.com/docs/avalara.html#configuring-tax-exemption) or specify `exemption_details` attribute if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration. Tax may still be applied by Avalara for certain values of `entity_code`/`exempt_number`/`exemption_details` based on the state/region/province of the taxable address.
  - `entity_code` (optional, enumerated string)
    The exemption category of the customer, for USA and Canada. Applicable if you use Chargebee's [AvaTax for Sales integration](https://www.chargebee.com/docs/avalara.html#configuring-tax-exemption) .
    Possible enum values:
      - `a`
        Federal government
      - `b`
        State government
      - `c`
        Tribe/Status Indian/Indian Band
      - `d`
        Foreign diplomat
      - `e`
        Charitable or benevolent organization
      - `f`
        Religious organization
      - `g`
        Resale
      - `h`
        Commercial agricultural production
      - `i`
        Industrial production/manufacturer
      - `j`
        Direct pay permit
      - `k`
        Direct mail
      - `l`
        Other or custom
      - `m`
        Educational organization
      - `n`
        Local government
      - `p`
        Commercial aquaculture
      - `q`
        Commercial Fishery
      - `r`
        Non-resident
      - `med1`
        US Medical Device Excise Tax with exempt sales tax
      - `med2`
        US Medical Device Excise Tax with taxable sales tax
  - `exempt_number` (optional, string, max chars=100)
    Any string value that will cause the sale to be exempted. Use this if your finance team manually verifies and tracks exemption certificates. Applicable if you use Chargebee's [AvaTax for Sales integration](https://www.chargebee.com/docs/avalara.html#configuring-tax-exemption) .
  - `net_term_days` (optional, integer, default=0)
    The number of days within which the customer has to make payment for the invoice.
  - `taxjar_exemption_category` (optional, enumerated string)
    Indicates the exemption type of the customer. This is applicable only if you use Chargebee's TaxJar integration.
    Possible enum values:
      - `wholesale`
        Whole-sale
      - `government`
        Government
      - `other`
        Other
  - `customer_type` (optional, enumerated string)
    Indicates the type of the customer. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
    Possible enum values:
      - `residential`
        When the purchase is made by a customer for home use
      - `business`
        When the purchase is made at a place of business
      - `senior_citizen`
        When the purchase is made by a customer who meets the jurisdiction requirements to be considered a senior citizen and qualifies for senior citizen tax breaks
      - `industrial`
        When the purchase is made by an industrial business
  - `auto_collection` (optional, enumerated string, default=on)
    Whether payments needs to be collected automatically for this customer
    Possible enum values:
      - `on`
        Whenever an invoice is created, an automatic attempt to charge the customer's payment method is made.
      - `off`
        Automatic collection of charges will not be made. All payments must be recorded offline.
  - `allow_direct_debit` (optional, boolean, default=false)
    Whether the customer can pay via Direct Debit
  - `vat_number` (optional, string, max chars=20)
    The VAT/tax registration number for the customer. For customers with `[billing_address](/docs/api/customers/customer-object#billing_address)`
    
    `country` as `XI` (which is **United Kingdom - Northern Ireland** ), the first two characters of the [full VAT number](https://en.wikipedia.org/wiki/VAT_identification_number) can be overridden by setting `[vat_number_prefix](/docs/api/customers/customer-object#vat_number_prefix)` .
  - `vat_number_prefix` (optional, string, max chars=10)
    An overridden value for the first two characters of the [full VAT number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with `[billing_address](/docs/api/customers/customer-object#billing_address)`
    
    `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
    
    When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting `[billing_address](/docs/api/customers/customer-object#billing_address)`
    
    `country` as `XI`. That's the code for **United Kingdom - Northern Ireland**. The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.

- `contract_term` (optional, string)
  Parameters for contract\_term
  - `id` (optional, string, max chars=50)
    Id that uniquely identifies the contract term in the site.
  - `created_at` (optional, timestamp(UTC) in seconds)
    The date when the contract term was created.
  - `contract_start` (optional, timestamp(UTC) in seconds)
    The start date of the contract term
  - `billing_cycle` (optional, integer, min=0)
    The number of billing cycles of the subscription that the contract term is for.
  - `total_amount_raised` (optional, in cents, default=0, min=0)
    The amount raised for the contract term till the time of importing the subscription. This amount is added to the `[total_contract_value](/docs/api/contract_terms/contract_term-object#total_contract_value)`
  - `total_amount_raised_before_tax` (optional, in cents, default=0, min=0)
    The amount raised for the contract term till the time of importing the subscription excluding tax. This amount is added to the `[total_contract_value_before_tax](/docs/api/contract_terms/contract_term-object#total_contract_value)`
  - `action_at_term_end` (optional, enumerated string, default=renew)
    Action to be taken when the contract term completes.
    Possible enum values:
      - `renew`
        -   Contract term completes and a new contract term is started for the number of billing cycles specified in [`contract_billing_cycle_on_renewal`](/docs/api/v2/pcv-1/subscriptions/create-subscription-for-customer#contract_term_billing_cycle_on_renewal).
        -   The `action_at_term_end` for the new contract term is set to `renew`.
      - `evergreen`
        Contract term completes and the subscription renews.
      - `cancel`
        Contract term completes and subscription is canceled.
      - `renew_once`
        Used when you want to renew the contract term just once. Does the following: - Contract term completes and a new contract term is started for the number of billing cycles specified in [`contract_billing_cycle_on_renewal`](/docs/api/v2/pcv-1/subscriptions/create-subscription-for-customer#contract_term_billing_cycle_on_renewal).
        
        -   The `action_at_term_end` for the new contract term is set to `cancel`.
  - `cancellation_cutoff_period` (optional, integer, default=0)
    The number of days before [`contract_end`](/docs/api/contract_terms/contract_term-object#contract_end) , during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure.

- `card` (optional, string)
  Parameters for card
  - `gateway_account_id` (optional, string, max chars=50)
    The gateway account in which this payment source is stored.
  - `first_name` (optional, string, max chars=50)
    Cardholder's first name
  - `last_name` (optional, string, max chars=50)
    Cardholder's last name
  - `number` (required if card provided, string, max chars=1500)
    The credit card number without any format. If you are using [Braintree.js](https://developer.paypal.com/braintree/docs/guides/client-sdk/setup/javascript/v2#getting-braintree.js) , you can specify the Braintree encrypted card number here.
  - `expiry_month` (required if card provided, integer, min=1, max=12)
    Card expiry month.
  - `expiry_year` (required if card provided, integer)
    Card expiry year.
  - `cvv` (optional, string, max chars=520)
    The card verification value (CVV). If you are using [Braintree.js](https://developer.paypal.com/braintree/docs/guides/client-sdk/setup/javascript/v2#getting-braintree.js) , you can specify the Braintree encrypted CVV here.
  - `preferred_scheme` (optional, enumerated string)
    The customer's preferred card scheme for co-branded cards.
    
    **Note**: Currently, this parameter is only supported for Stripe.
    Possible enum values:
      - `cartes_bancaires`
        A Cartes Bancaires card scheme.
      - `mastercard`
        A MasterCard scheme.
      - `visa`
        A Visa card scheme.
  - `billing_addr1` (optional, string, max chars=150)
    Address line 1, as available in card billing address.
  - `billing_addr2` (optional, string, max chars=150)
    Address line 2, as available in card billing address.
  - `billing_city` (optional, string, max chars=50)
    City, as available in card billing address.
  - `billing_state_code` (optional, string, max chars=50)
    The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search/code) without the country prefix. Currently supported for USA, Canada, India and UAE. For instance, for Arizona (USA), set `billing_state_code` as `AZ` (not `US-AZ` ). For Tamil Nadu (India), set as `TN` (not `IN-TN` ). For British Columbia (Canada), set as `BC` (not `CA-BC` ). For Dubai (UAE), set as `DU` (not `AE-DU` ).
  - `billing_state` (optional, string, max chars=50)
    The state/province name. Is set by Chargebee automatically for US, Canada, India and UAE, if `billing_state_code` is provided.
  - `billing_zip` (optional, string, max chars=20)
    Postal or Zip code, as available in card billing address.
  - `billing_country` (optional, string, max chars=50)
    The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html) .
    
    **Note**: If you enter an invalid country code, the system will return an error.
    
    **Brexit**
    
    If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom - Northern Ireland**) is available as an option.
  - `additional_information` (optional, jsonobject)
    -   `checkout_com`: While adding a new payment method using [permanent token](/docs/api/payment_sources/create-using-permanent-token) or passing raw card details to Checkout.com, `document` ID and `country_of_residence` are required to support payments through [dLocal](https://www.checkout.com/docs/previous/payments/payment-methods/cards/dlocal).
        
        -   `payer`: User related information.
            -   `country_of_residence`: This is required since the billing country associated with the user's payment method may not be the same as their country of residence. Hence the user's country of residence needs to be specified. The country code should be a [two-character ISO code](https://docs.checkout.com/resources/codes/country-codes).
            -   `document`: Document ID is the user's [identification number](https://docs.dlocal.com/api-documentation/payins-api-reference/country-reference#documents) based on their country.
    -   `bluesnap`: While passing raw card details to BlueSnap, if `fraud_session_id` is added, [additional validation](https://developers.bluesnap.com/docs/fraud-prevention) is performed to avoid fraudulent transactions.
        
        -   `fraud`: Fraud identification related information.
            -   `fraud_session_id`: Your [BlueSnap fraud session ID](https://developers.bluesnap.com/docs/fraud-prevention#section-implementing-device-data-collector) required to perform anti-fraud validation.
    -   `braintree`: While passing raw card details to Braintree, your `fraud_merchant_id` and the user's `device_session_id` can be added to perform [additional validation](https://developers.braintreepayments.com/guides/premium-fraud-management-tools/device-data-collection/javascript/v3#collecting-device-data) and avoid fraudulent transactions.
        
        -   `fraud`: Fraud identification related information.
            -   `device_session_id`: Session ID associated with the user's device.
            -   `fraud_merchant_id`: Your [merchant ID](https://developers.braintreepayments.com/guides/premium-fraud-management-tools/device-data-collection/javascript/v3#collecting-device-data) for fraud detection.
    -   `chargebee_payments`: While passing raw card details to Chargebee Payments, if `fraud_session_id` is added, additional validation is performed to avoid fraudulent transactions.
        
        -   `fraud`: Fraud identification related information.
            -   `fraud_session_id`: Your Chargebee Payments fraud session ID required to perform anti-fraud validation.
    -   `bank_of_america`: While passing raw card details to Bank of America, your user's `device_session_id` can be added to perform additional validation and avoid fraudulent transactions.
        
        -   `fraud`: Fraud identification related information.
            -   `device_session_id`: Session ID associated with the user's device.
    -   `ecentric`: This parameter is used to verify and process payment method details in Ecentric. If the `merchant_id` parameter is included, Chargebee will vault it / perform a lookup and verification against this `merchant_id`, overriding the one configured in Chargebee. If tokens and processing occur in the same Merchant GUID, you can just skip this part.
        
        -   `merchant_id`: Merchant GUID where the card is vaulted or need to be vaulted.
    -   `ebanx`: While passing raw card details to EBANX, the user's `document` is required for some countries and `device_session_id` can be added to perform [additional validation](https://developer.ebanx.com/docs/payments/guides/features/device-fingerprint#device-fingerprint) and avoid fraudulent transactions.
        
        -   `payer`: User related information.
            -   `document`: Document is the user's identification number based on their country.
        -   `fraud`: Fraud identification related information.
            -   `device_session_id`: Session ID associated with the user's device

- `payment_method` (optional, enumerated string)
  Parameters for payment\_method
  - `type` (optional, enumerated string)
    The type of payment method. For more details refer [Update payment method for a customer](/docs/api/customers/update-payment-method-for-a-customer) API under Customer resource.
    Possible enum values:
      - `card`
        Card based payment including credit cards and debit cards. Details about the card can be obtained from the card resource.
      - `paypal_express_checkout`
        Payments made via PayPal Express Checkout.
      - `amazon_payments`
        Payments made via Amazon Payments.
      - `direct_debit`
        Represents bank account for which the direct debit or ACH agreement/mandate is created.
      - `generic`
        Payments made via Generic Payment Method.
      - `alipay`
        Payments made via Alipay.
        
        This payment source is deprecated.
      - `unionpay`
        Payments made via UnionPay.
      - `apple_pay`
        Payments made via Apple Pay.
      - `wechat_pay`
        Payments made via WeChat Pay.
        
        This payment source is deprecated.
      - `ideal`
        Payments made via iDEAL.
      - `google_pay`
        Payments made via Google Pay.
      - `sofort`
        Payments made via Sofort.
      - `bancontact`
        Payments made via Bancontact Card.
      - `giropay`
        Payments made via giropay.
      - `dotpay`
        Payments made via Dotpay.
      - `upi`
        UPI Payments.
      - `netbanking_emandates`
        Netbanking (eMandates) Payments.
      - `venmo`
        Payments made via Venmo
      - `pay_to`
        Payments made via PayTo
      - `faster_payments`
        Payments made via Faster Payments
      - `sepa_instant_transfer`
        Payments made via Sepa Instant Transfer
      - `automated_bank_transfer`
        Represents virtual bank account using which the payment will be done.
      - `klarna_pay_now`
        Payments made via Klarna Pay Now
      - `online_banking_poland`
        Payments made via Online Banking Poland
      - `payconiq_by_bancontact`
        Payments made via Payconiq by Bancontact.
      - `electronic_payment_standard`
        Electronic Payment Standard
      - `kbc_payment_button`
        KBC Payment Button
      - `pay_by_bank`
        Pay By Bank
      - `trustly`
        Trustly
      - `stablecoin`
        Payments made via Stablecoin.
      - `kakao_pay`
        Payments made via Kakao Pay.
      - `naver_pay`
        Payments made via Naver Pay.
      - `revolut_pay`
        Payments made via Revolut Pay.
      - `cash_app_pay`
        Payments made via Cash App Pay.
      - `twint`
        Payments made via Twint
      - `go_pay`
        Payments made via GoPay
      - `grab_pay`
        Payments made via GrabPay
      - `pay_co`
        Payments made via PayCo
      - `after_pay`
        Payments made via Afterpay
      - `swish`
        Payments made via Swish
      - `payme`
        Payments made via PayMe
      - `pix`
        Payments made via Pix
      - `klarna`
        Payments made via Klarna.
      - `alipay_hk`
        Payments made via Alipay HK
      - `paypay`
        Payments made via PayPay
      - `gcash`
        Payments made via GCash
      - `south_korean_cards`
        Payments made via South Korean Cards
      - `paynow`
      - `bizum`
      - `promptpay`
      - `dana`
      - `touch_n_go`
      - `tamara`
      - `qpay`
      - `ovo`
      - `momo`
      - `mercado_pago`
      - `nequi`
      - `nupay`
      - `picpay`
      - `thai_qr`
      - `blik`
      - `fpx`
      - `wero`
      - `p24`
      - `affirm_pay`
      - `rakuten_pay`
  - `gateway_account_id` (optional, string, max chars=50)
    The gateway account in which this payment source is stored.
  - `reference_id` (optional, string, max chars=200)
    The reference id. In the case of Amazon and PayPal this will be the _billing agreement id_. For GoCardless direct debit this will be 'mandate id'. In the case of card this will be the identifier provided by the gateway/card vault for the specific payment method resource. **Note:** This is not the one-time temporary token provided by gateways like Stripe.
    
    For more details refer [Update payment method for a customer](/docs/api/customers/update-payment-method-for-a-customer) API under Customer resource.
  - `issuing_country` (optional, string, max chars=50)
    [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html) .
    
    **Note**: If you enter an invalid country code, the system will return an error.
    
    If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom - Northern Ireland** ) is available as an option.
  - `additional_information` (optional, jsonobject)
    -   `checkout_com`: While adding a new payment method using [permanent token](/docs/api/payment_sources/create-using-permanent-token) or passing raw card details to Checkout.com, `document` ID and `country_of_residence` are required to support payments through [dLocal](https://www.checkout.com/docs/previous/payments/payment-methods/cards/dlocal).
        
        -   `payer`: User related information.
            -   `country_of_residence`: This is required since the billing country associated with the user's payment method may not be the same as their country of residence. Hence the user's country of residence needs to be specified. The country code should be a [two-character ISO code](https://docs.checkout.com/resources/codes/country-codes).
            -   `document`: Document ID is the user's [identification number](https://docs.dlocal.com/api-documentation/payins-api-reference/country-reference#documents) based on their country.
    -   `bluesnap`: While passing raw card details to BlueSnap, if `fraud_session_id` is added, [additional validation](https://developers.bluesnap.com/docs/fraud-prevention) is performed to avoid fraudulent transactions.
        
        -   `fraud`: Fraud identification related information.
            -   `fraud_session_id`: Your [BlueSnap fraud session ID](https://developers.bluesnap.com/docs/fraud-prevention#section-implementing-device-data-collector) required to perform anti-fraud validation.
    -   `braintree`: While passing raw card details to Braintree, your `fraud_merchant_id` and the user's `device_session_id` can be added to perform [additional validation](https://developers.braintreepayments.com/guides/premium-fraud-management-tools/device-data-collection/javascript/v3#collecting-device-data) and avoid fraudulent transactions.
        
        -   `fraud`: Fraud identification related information.
            -   `device_session_id`: Session ID associated with the user's device.
            -   `fraud_merchant_id`: Your [merchant ID](https://developers.braintreepayments.com/guides/premium-fraud-management-tools/device-data-collection/javascript/v3#collecting-device-data) for fraud detection.
    -   `chargebee_payments`: While passing raw card details to Chargebee Payments, if `fraud_session_id` is added, additional validation is performed to avoid fraudulent transactions.
        
        -   `fraud`: Fraud identification related information.
            -   `fraud_session_id`: Your Chargebee Payments fraud session ID required to perform anti-fraud validation.
    -   `bank_of_america`: While passing raw card details to Bank of America, your user's `device_session_id` can be added to perform additional validation and avoid fraudulent transactions.
        
        -   `fraud`: Fraud identification related information.
            -   `device_session_id`: Session ID associated with the user's device.
    -   `ecentric`: This parameter is used to verify and process payment method details in Ecentric. If the `merchant_id` parameter is included, Chargebee will vault it / perform a lookup and verification against this `merchant_id`, overriding the one configured in Chargebee. If tokens and processing occur in the same Merchant GUID, you can just skip this part.
        
        -   `merchant_id`: Merchant GUID where the card is vaulted or need to be vaulted.
    -   `ebanx`: While passing raw card details to EBANX, the user's `document` is required for some countries and `device_session_id` can be added to perform [additional validation](https://developer.ebanx.com/docs/payments/guides/features/device-fingerprint#device-fingerprint) and avoid fraudulent transactions.
        
        -   `payer`: User related information.
            -   `document`: Document is the user's identification number based on their country.
        -   `fraud`: Fraud identification related information.
            -   `device_session_id`: Session ID associated with the user's device

- `billing_address` (optional, string)
  Parameters for billing\_address
  - `first_name` (optional, string, max chars=150)
    The first name of the billing contact.
  - `last_name` (optional, string, max chars=150)
    The last name of the billing contact.
  - `email` (optional, string, max chars=70)
    The email address.
  - `company` (optional, string, max chars=250)
    The company name.
  - `phone` (optional, string, max chars=50)
    The phone number.
  - `line1` (optional, string, max chars=150)
    Address line 1
  - `line2` (optional, string, max chars=150)
    Address line 2
  - `line3` (optional, string, max chars=150)
    Address line 3
  - `city` (optional, string, max chars=50)
    The name of the city.
  - `state_code` (optional, string, max chars=50)
    The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search/code) without the country prefix. Currently supported for USA, Canada, India and UAE. For instance, for Arizona (USA), set `state_code` as `AZ` (not `US-AZ` ). For Tamil Nadu (India), set as `TN` (not `IN-TN` ). For British Columbia (Canada), set as `BC` (not `CA-BC` ). For Dubai (UAE), set as `DU` (not `AE-DU` ).
  - `state` (optional, string, max chars=50)
    The state/province name. Is set by Chargebee automatically for US, Canada, India and UAE, if `state_code` is provided.
  - `zip` (optional, string, max chars=20)
    Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address) .
  - `country` (optional, string, max chars=50)
    The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html) .
    
    **Note**: If you enter an invalid country code, the system will return an error.
    
    **Brexit**
    
    If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom - Northern Ireland**) is available as an option.
  - `validation_status` (optional, enumerated string, default=not_validated)
    The address verification status.
    Possible enum values:
      - `not_validated`
        Address is not yet validated.
      - `valid`
        Address was validated successfully.
      - `partially_valid`
        The address is valid for taxability but has not been validated for shipping.
      - `invalid`
        Address is invalid.

- `shipping_address` (optional, string)
  Parameters for shipping\_address
  - `first_name` (optional, string, max chars=150)
    The first name of the contact.
  - `last_name` (optional, string, max chars=150)
    The last name of the contact.
  - `email` (optional, string, max chars=70)
    The email address.
  - `company` (optional, string, max chars=250)
    The company name.
  - `phone` (optional, string, max chars=50)
    The phone number.
  - `line1` (optional, string, max chars=150)
    Address line 1
  - `line2` (optional, string, max chars=150)
    Address line 2
  - `line3` (optional, string, max chars=150)
    Address line 3
  - `city` (optional, string, max chars=50)
    The name of the city.
  - `state_code` (optional, string, max chars=50)
    The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search/code) without the country prefix. Currently supported for USA, Canada, India and UAE. For instance, for Arizona (USA), set `state_code` as `AZ` (not `US-AZ` ). For Tamil Nadu (India), set as `TN` (not `IN-TN` ). For British Columbia (Canada), set as `BC` (not `CA-BC` ). For Dubai (UAE), set as `DU` (not `AE-DU` ).
  - `state` (optional, string, max chars=50)
    The state/province name. Is set by Chargebee automatically for US, Canada, India and UAE, if `state_code` is provided.
  - `zip` (optional, string, max chars=20)
    Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address) .
  - `country` (optional, string, max chars=50)
    The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html) .
    
    **Note**: If you enter an invalid country code, the system will return an error.
    
    **Brexit**
    
    If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom - Northern Ireland**) is available as an option.
  - `validation_status` (optional, enumerated string, default=not_validated)
    The address verification status.
    Possible enum values:
      - `not_validated`
        Address is not yet validated.
      - `valid`
        Address was validated successfully.
      - `partially_valid`
        The address is valid for taxability but has not been validated for shipping.
      - `invalid`
        Address is invalid.

- `transaction` (optional, in cents)
  Parameters for transaction
  - `amount` (optional, in cents, min=0)
    The payment transaction amount. This parameter should be passed only if the invoice is created for current term.
  - `payment_method` (optional, enumerated string)
    The payment method of this transaction. This parameter should be passed only if the invoice is created for current term.
    Possible enum values:
      - `cash`
        Cash
      - `check`
        Check
      - `bank_transfer`
        Bank Transfer
      - `other`
        Payment Methods other than the above types
      - `custom`
        Custom
      - `dana`
      - `touch_n_go`
      - `tamara`
      - `qpay`
      - `ovo`
      - `momo`
      - `mercado_pago`
      - `nequi`
      - `nupay`
      - `picpay`
      - `thai_qr`
      - `blik`
      - `fpx`
      - `wero`
      - `p24`
      - `affirm_pay`
      - `rakuten_pay`
  - `reference_number` (optional, string, max chars=100)
    The reference number for this transaction. For example, check number in case of `check` `payment_method`. This parameter should be passed only if the invoice is created for current term.
  - `date` (optional, timestamp(UTC) in seconds)
    The date of occurence of the transaction. This parameter should be passed only if the invoice is created for current term.

- `addons` (optional, array)
  Parameters for addons
  - `id` (optional, string, max chars=100)
    Identifier of the addon. Multiple addons can be passed.
  - `quantity` (optional, integer)
    Quantity of the addon. Applicable for addons with `pricing_model` other than `flat_fee` .
  - `quantity_in_decimal` (optional, string, max chars=33)
    The decimal representation of the quantity of the addon. Can be provided for quantity-based addons and only when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.
  - `unit_price` (optional, in cents)
    The price or per-unit-price of the addon. The value depends on the [type of currency](/docs/api/getting-started).
    
    **Note:**
    
    For recurring addons, this is the final price or per-unit price for each billing period of the subscription, regardless of the [addon period](/docs/api/v2/pcv-1/addons/addon-object#period). For example, consider the following details:
    
    -   The `unit_price` provided is $10
    -   The addon billing period is 1 month.
    -   The plan billing period is 3 months.
    -   The addon is only billed for $10 on each subscription renewal.
  - `unit_price_in_decimal` (optional, string, max chars=39)
    When [price overriding](http://chargebee.com/docs/price-override.html ) is enabled for the site, the price or per-unit price of the addon can be set here. The value [set for the addon](/docs/api/v2/pcv-1/addons/addon-object#price) is used by default. However, the price provided here is considered as the price of the addon for an entire billing cycle of the subscription regardless of the value of the addon `period`. Provide the value as a decimal string in major units of the currency. Can be provided only when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.
  - `billing_cycles` (optional, integer)
    Number of billing cycles the addon will be charged for. When not set, the addon is attached to the subscription for an indefinite number of billing cycles. While updating a subscription to a plan with a different billing period, set this parameter again or its value will be lost. And so, the addon will be attached indefinitely.

- `event_based_addons` (optional, array)
  Parameters for event\_based\_addons
  - `id` (optional, string, max chars=100)
    A unique 'id' used to identify the addon.
  - `quantity` (optional, integer)
    Quantity of the addon. Applicable for addons with `pricing_model` other than `flat_fee` .
  - `unit_price` (optional, in cents)
    Amount that will override the Addon's default price. The unit depends on the [type of currency](/docs/api/getting-started) .
  - `quantity_in_decimal` (optional, string, max chars=33)
    The decimal representation of the quantity of the addon. Can be provided for quantity-based addons and only when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.
  - `unit_price_in_decimal` (optional, string, max chars=39)
    When [price overriding](http://chargebee.com/docs/price-override.html ) is enabled for the site, the price or per-unit price of the addon can be set here. The value [set for the addon](/docs/api/v2/pcv-1/addons/addon-object#price) is used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.
  - `service_period_in_days` (optional, integer)
    Defines service period of the addon in days from the day of charge.
  - `on_event` (optional, enumerated string)
    Event on which this addon will be charged.
    Possible enum values:
      - `subscription_creation`
        Addon will be charged on subscription creation.
      - `subscription_trial_start`
        Addon will be charged when the trial period starts.
      - `plan_activation`
        Addon will be charged on plan activation.
      - `subscription_activation`
        Addon will be charged on subscription activation.
      - `contract_termination`
        Addon will be charged on contract termination.
  - `charge_once` (optional, boolean)
    If enabled, the addon will be charged only at the first occurrence of the event. Applicable only for non-recurring add-ons.

- `charged_event_based_addons` (optional, array)
  Parameters for charged\_event\_based\_addons
  - `id` (optional, string, max chars=100)
    Addon id.
  - `last_charged_at` (optional, timestamp(UTC) in seconds)
    Timestamp indicating when this add-on was last charged for this subscription.

## Returns

- `subscription` (Subscription object)
  Resource object representing subscription

- `customer` (Customer object)
  Resource object representing customer

- `card` (Card object)
  Resource object representing card

- `invoice` (Invoice object)
  Resource object representing invoice
