# Reactivate a subscription

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


[Idempotency Supported](/docs/api/idempotency)

Reactivates a canceled subscription.

Use this operation to restore a canceled subscription to an active or in-trial state.

#### Extend non-renewing subscriptions[](#extend-non-renewing-subscriptions)

To extend the billing cycles of a `non_renewing` subscription, use the [Remove scheduled cancellation API](/docs/api/subscriptions/remove-scheduled-cancellation).

#### In-term reactivation[](#in-term-reactivation)

The subscription's current billing term is demarcated by the [`current_term_start`](/docs/api/subscriptions/subscription-object#current_term_start) and `current_term_end` attributes. These attributes are retained even if the subscription is canceled. An "in-term reactivation" happens when the subscription is reactivated on or before `current_term_end`.

### Prerequisites & Constraints

-   The subscription `status` must be `cancelled`.

### Impacts

**

#### Subscription[](#subscription)

**

-   For subscriptions canceled due to payment failure, [in-term reactivation](#in-term) is governed by the Chargebee Billing [configuration for reactivation](https://www.chargebee.com/docs/billing/2.0/subscriptions/reactivation#in-term-reactivation).

**

#### Invoice[](#invoice)

**

If an invoice gets generated during this operation, customer [balances](/docs/api/customers#balances) such as promotional credits, excess payments, and refundable credits are automatically applied subject to [limits set at the site level](https://www.chargebee.com/docs/billing/2.0/invoices-credit-notes-and-quotes/credit-notes#credits-flexibility) which can be overridden for subscriptions via [`subscription.billing_override`](/docs/api/subscriptions#billing_override).

### Use Cases

#### Change the payment method during reactivation[](#change-the-payment-method-during-reactivation)

Use the `payment_intent` parameter to create a payment source for the customer. If reactivation generates an invoice and `auto_collection` is `on`, Chargebee immediately attempts payment collection using the new payment source.

**Note**

-   This works for both [Strong Customer Authentication](https://www.chargebee.com/docs/payments/2.0/others/psd2-sca) (SCA) (i.e. 3D-Secure) and non-SCA flows.
-   The payment source replaces the existing [primary payment source](/docs/api/customers#primary_payment_source_id) for the customer.

1.  Create a `payment_intent` resource by calling the [Create a payment intent API](/docs/api/payment_intents/create-a-payment-intent). Set `amount` to the amount due for this reactivation.
2.  Pass the `payment_intent` object to your frontend and use Chargebee.js to capture the payment source details from the customer. You can use [Payment Components](https://www.chargebee.com/checkout-portal-docs/payment-components.html) to capture the payment source details.
3.  Listen to the [`payment_intent_updated`](/docs/api/events#payment_intent_updated) event. Once the `payment_intent.status` is `authorized`, pass the `payment_intent.id` using the `payment_intent[id]` parameter in this API call.

#### Related APIs

Remove scheduled cancellation

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__8asukSOXdwxyQE/reactivate \
     -u {site_api_key}:\
     -d invoice_immediately="true" \
     -d billing_cycles=4
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Subscription.Reactivate("__test__8asukSOXdwxyQE")
		.InvoiceImmediately(true)
		.BillingCycles(4)
		.Request();

Subscription subscription = result.Subscription;
Customer customer = result.Customer;
Card card = result.Card;
Invoice invoice = result.Invoice;
List<UnbilledCharge> unbilledCharges = result.UnbilledCharges;
```

#### 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"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := subscriptionAction.Reactivate("__test__8asukSOXdwxyQE", &subscription.ReactivateRequestParams{
        InvoiceImmediately : chargebee.Bool(true),
        BillingCycles : chargebee.Int32(4),
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
        UnbilledCharges := res.UnbilledCharges
    }
}
```

#### 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.SubscriptionReactivateRequest{
    InvoiceImmediately : chargebee.Bool(true),
    BillingCycles : chargebee.Int32(4),
}
  res, err := client.Subscription.Reactivate("__test__8asukSOXdwxyQE", req)
      if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
        UnbilledCharges := res.UnbilledCharges
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;
import java.util.List;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = Subscription.reactivate("__test__8asukSOXdwxyQE")
            .invoiceImmediately(true)
            .billingCycles(4)
            .request();

        Subscription subscription = result.subscription();
        Customer customer = result.customer();
        Card card = result.card();
        Invoice invoice = result.invoice();
        List<UnbilledCharge> unbilledCharges = result.unbilledCharges();
    }
}
```

#### 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.SubscriptionReactivateParams;
import com.chargebee.v4.models.subscription.responses.SubscriptionReactivateResponse;
import com.chargebee.v4.models.unbilledCharge.UnbilledCharge;
import java.util.List;

public class SubscriptionReactivate {

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

        SubscriptionReactivateParams params = SubscriptionReactivateParams.builder()
            .invoiceImmediately(true)
            .billingCycles(4)
            .build();

        SubscriptionReactivateResponse response = client
            .subscriptions()
            .reactivate("__test__8asukSOXdwxyQE", params);

        Subscription subscription = response.getSubscription();
        Customer customer = response.getCustomer();
        Card card = response.getCard();
        Invoice invoice = response.getInvoice();
        List<UnbilledCharge> unbilledCharges = response.getUnbilledCharges();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.subscription.reactivate("__test__8asukSOXdwxyQE", {
        invoice_immediately: true,
        billing_cycles: 4
    });

    console.log(result);
    const subscription = result.subscription;
    const customer = result.customer;
    const card = result.card;
    const invoice = result.invoice;
    const unbilledCharges = result.unbilled_charges;
} 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()->reactivate("__test__8asukSOXdwxyQE", [
    "invoice_immediately" => true,
    "billing_cycles" => 4
]);
$subscription = $result->subscription;
$customer = $result->customer;
$card = $result->card;
$invoice = $result->invoice;
$unbilledCharges = $result->unbilled_charges;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Subscription.reactivate("__test__8asukSOXdwxyQE",
    cb_client.Subscription.ReactivateParams(
        invoice_immediately=True,
        billing_cycles=4
    )
)
subscription = response.subscription
customer = response.customer
card = response.card
invoice = response.invoice
unbilled_charges = response.unbilled_charges
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::Subscription.reactivate("__test__8asukSOXdwxyQE",{
  :invoice_immediately => "true",
  :billing_cycles => 4
})

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

## Sample Response

```json
{
  "customer": {
    "allow_direct_debit": false,
    "auto_collection": "off",
    "card_status": "no_card",
    "created_at": 1612890924,
    "deleted": false,
    "excess_payments": 0,
    "first_name": "John",
    "id": "__test__8asukSOXdwsNQB",
    "last_name": "Doe",
    "net_term_days": 0,
    "object": "customer",
    "pii_cleared": "active",
    "preferred_currency_code": "USD",
    "promotional_credits": 0,
    "refundable_credits": 0,
    "resource_version": 1612890924000,
    "taxability": "taxable",
    "unbilled_charges": 0,
    "updated_at": 1612890924
  },
  "invoice": {
    "adjustment_credit_notes": {},
    "amount_adjusted": 0,
    "amount_due": 1100,
    "amount_paid": 0,
    "amount_to_collect": 1100,
    "applied_credits": {},
    "base_currency_code": "USD",
    "billing_address": {
      "first_name": "John",
      "last_name": "Doe",
      "object": "billing_address",
      "validation_status": "not_validated"
    },
    "credits_applied": 0,
    "currency_code": "USD",
    "customer_id": "__test__8asukSOXdwsNQB",
    "date": 1612890925,
    "deleted": false,
    "due_date": 1612890925,
    "dunning_attempts": {},
    "exchange_rate": 1,
    "first_invoice": false,
    "has_advance_charges": false,
    "id": "__demo_inv__18",
    "is_gifted": false,
    "issued_credit_notes": {},
    "line_items": [
      {
        "amount": 1000,
        "customer_id": "__test__8asukSOXdwsNQB",
        "date_from": 1612890925,
        "date_to": 1615310125,
        "description": "basic USD",
        "discount_amount": 0,
        "entity_id": "basic-USD",
        "entity_type": "plan_item_price",
        "id": "li___test__8asukSOXdxDQQP",
        "is_taxed": false,
        "item_level_discount_amount": 0,
        "object": "line_item",
        "pricing_model": "per_unit",
        "quantity": 1,
        "subscription_id": "__test__8asukSOXdwxyQE",
        "tax_amount": 0,
        "tax_exempt_reason": "tax_not_configured",
        "unit_amount": 1000
      },
      {..}
    ],
    "linked_orders": {},
    "linked_payments": {},
    "net_term_days": 0,
    "object": "invoice",
    "price_type": "tax_exclusive",
    "recurring": true,
    "resource_version": 1612890926000,
    "round_off_amount": 0,
    "status": "payment_due",
    "sub_total": 1100,
    "subscription_id": "__test__8asukSOXdwxyQE",
    "tax": 0,
    "term_finalized": true,
    "total": 1100,
    "updated_at": 1612890926,
    "write_off_amount": 0
  },
  "subscription": {
    "activated_at": 1612890925,
    "billing_period": 1,
    "billing_period_unit": "month",
    "created_at": 1612890924,
    "currency_code": "USD",
    "current_term_end": 1615310125,
    "current_term_start": 1612890925,
    "customer_id": "__test__8asukSOXdwsNQB",
    "deleted": false,
    "due_invoices_count": 2,
    "due_since": 1612890924,
    "has_scheduled_changes": false,
    "id": "__test__8asukSOXdwxyQE",
    "mrr": 0,
    "next_billing_at": 1615310125,
    "object": "subscription",
    "remaining_billing_cycles": 3,
    "resource_version": 1612890926000,
    "started_at": 1612890924,
    "status": "active",
    "subscription_items": [
      {
        "amount": 1000,
        "billing_cycles": 3,
        "free_quantity": 0,
        "item_price_id": "basic-USD",
        "item_type": "plan",
        "object": "subscription_item",
        "quantity": 1,
        "unit_price": 1000
      },
      {..}
    ],
    "total_dues": 2200,
    "updated_at": 1612890926
  }
}
```

## URL Format

**POST** https://[site].chargebee.com/api/v2/subscriptions/{subscription-id}/reactivate

## Input Parameters

- `trial_end` (optional, timestamp(UTC) in seconds)
  Providing this parameter indicates that the subscription reactivates with an `in_trial` status and the trial period ends at the date provided.
  
  **Constraints**
  
  -   Must not be earlier than `reactivate_from` if `reactivate_from` is provided.
  -   When `trial_end` is backdated, the subscription immediately goes into `active` or `non_renewing` status.

- `billing_cycles` (optional, integer, min=0)
  The number of billing cycles (including the current cycle) this subscription should remain active for. After the billing cycles are exhausted, the subscription is canceled automatically.
  
  **Default value**
  
  -   If not specified, the billing cycles [configured for the plan](/docs/api/item_prices#billing_cycles) are used.
  
  **Impact**
  
  -   The [`remaining_billing_cycles`](/docs/api/subscriptions#remaining_billing_cycles) attribute of the subscription is updated to one less than the value of this parameter.

- `reactivate_from` (optional, timestamp(UTC) in seconds)
  The date-time at which the subscription was reactivated. When not provided, the subscription is reactivated immediately on calling this API.
  
  **Prerequisites**
  
  -   The [backdating feature](https://www.chargebee.com/docs/billing/2.0/subscriptions/backdating#configuring-backdated-subscription-actions-and-invoicing) has been enabled for subscription reactivation operations.
  -   The current day of the month does not exceed the limit set in Chargebee for backdating such operations. This day is the day of the month by which the accounting for the previous month must be closed.
  
  **Constraints**
  
  -   Must be in the past.
  -   Must not be more than the billing period of the plan into the past. For example, if the period of the plan in the subscription is 2 months and today is 14th April, `reactivate_from` cannot be earlier than 14th February.
  -   Must not be after `trial_end` if `trial_end` is provided.

- `invoice_immediately` (optional, boolean)
  If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to [unbilled charges](https://www.chargebee.com/docs/unbilled-charges.html). The default value is as per the [site settings](https://www.chargebee.com/docs/unbilled-charges.html#configuration) .
  
  **Note:** `invoice_immediately` only affects charges that are raised at the time of execution of this API call. Any charges scheduled to be raised in the future are not affected by this parameter.
  
  .

- `billing_alignment_mode` (optional, enumerated string)
  Applicable when calendar billing is enabled and a new _active_ term gets started during this operation. Unless specified the configured _default_ value will be used.
  Possible enum values:
    - `immediate`
      Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly.
    - `delayed`
      Subscription period will be aligned with the configured billing date at the next renewal.

- `terms_to_charge` (optional, integer, min=1)
  The number of subscription billing cycles to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html). If a new term is started for the subscription due to this API call, then `terms_to_charge` is inclusive of this new term. See description for the `force_term_reset` parameter to learn more about when a subscription term is reset.

- `invoice_date` (optional, timestamp(UTC) in seconds)
  The document date displayed on the invoice PDF. Provide this value to backdate the invoice. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription is effective as of a past date. Moreover, if `create_pending_invoices` is `true`, and if the site is configured to set invoice dates to the date of closing, then upon invoice closure, this date is changed to the invoice closing date. `taxes` and `line_item_taxes` are computed based on the tax configuration as of `invoice_date`.
  
  **Default value**
  
  -   Current date.
  
  **Constraints**
  
  -   Must be in the past.
  -   Must not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
  -   Must not be earlier than `reactivate_from` or `trial_end`.
  -   `invoice_immediately` must be `true`.

- `contract_term_billing_cycle_on_renewal` (optional, integer, min=1, max=100)
  The number of billing cycles the new contract term should run for, on contract renewal. This value is used when `action_at_term_end` is `renew`.
  
  **Constraints**
  
  -   Should not be sent when `contract_term.action_at_term_end` is `cancel` or `evergreen`.
  
  **Default value**
  
  -   Defaults to the value of `billing_cycle` or a custom value depending on the [site configuration](https://www.chargebee.com/docs/billing/2.0/subscriptions/contract-terms#configuring-contract-terms).

- `payment_initiator` (optional, enumerated string)
  The initiator of this payment request. Sending this information can improve the success rate of the payment at the gateway.
  Possible enum values:
    - `customer`
      The payment was initiated by your customer.
    - `merchant`
      The payment was initiated by you (the merchant).

- `contract_term` (optional, enumerated string)
  Parameters for creating a contract term for the subscription.
  
  **Prerequisites**
  
  -   [Contract Terms](https://www.chargebee.com/docs/contract-terms.html) feature must be enabled for the site.
  - `action_at_term_end` (optional, enumerated string)
    Action to be taken when the contract term completes.
    
    **Constraints**
    
    -   `billing_cycles` must be provided when this parameter is sent.
    Possible enum values:
      - `renew`
        The contract term completes and a new contract term is started for the number of billing cycles specified in `contract_term_billing_cycle_on_renewal`. The `action_at_term_end` for the new contract term is set to `renew`.
      - `evergreen`
        The contract term completes and the subscription continues to renew without a new contract term.
      - `cancel`
        Contract term completes and subscription is canceled.
  - `cancellation_cutoff_period` (optional, integer, default=0)
    The number of days before `contract_end` during which the customer is barred from canceling the contract term. The customer can cancel the contract term via the [Self-Serve Portal](https://www.chargebee.com/docs/self-serve-portal.html) only before this period. This allows you to have sufficient time for processing the contract term closure.
    
    **Required if**
    
    -   The `action_at_term_end` is `renew`.
    
    **Constraints**
    
    -   Must be less than the duration of the contract term (in days).
    -   Should not be sent when `action_at_term_end` is `cancel` or `evergreen`.

- `statement_descriptor` (optional, string)
  Parameters for statement\_descriptor
  - `descriptor` (optional, string, max chars=65k)
    Payment transaction descriptor text to help your customer easily recognize the transaction. When this value is passed this will override the [transaction descriptor](https://www.chargebee.com/docs/1.0/transaction_descriptors.html) text configured in the Chargebee site for all the subscription renewal transactions.

- `payment_intent` (optional, string)
  Parameters for payment\_intent
  - `id` (optional, string, max chars=150)
    Identifier for the [`payment_intent`](payment_intents) resource. If you provide this parameter, you do not need to pass other `payment_intent` parameters.
    
    **Prerequisites**
    
    -   The value of [`payment_intent.status`](payment_intents#payment_intent_status) must be `authorized`.
  - `gateway_account_id` (required if payment intent token provided, string, max chars=50)
    The gateway account used for performing the 3DS flow.
  - `gw_token` (optional, string, max chars=65k)
    Identifier for 3DS transaction/verification object at the gateway. Can be passed only after successfully completing the 3DS flow. Refer [3DS implementation in Chargebee](/docs/api/3ds_card_payments) to find out the gateway-specific gw\_token format. Applicable when you are using gateway APIs directly for completing the 3DS flow.
  - `payment_method_type` (optional, enumerated string)
    The payment method type.
    
    **Default value**
    
    -   `card`
    Possible enum values:
      - `card`
        card
      - `ideal`
        ideal
      - `sofort`
        sofort
      - `bancontact`
        bancontact
      - `google_pay`
        google\_pay
      - `dotpay`
        dotpay
      - `giropay`
        giropay
      - `apple_pay`
        apple\_pay
      - `upi`
        upi
      - `netbanking_emandates`
        netbanking\_emandates
      - `paypal_express_checkout`
        paypal\_express\_checkout
      - `direct_debit`
        direct\_debit
      - `boleto`
        boleto
      - `venmo`
        Venmo
      - `amazon_payments`
        Amazon Payments
      - `pay_to`
        PayTo
      - `faster_payments`
        Faster Payments
      - `sepa_instant_transfer`
        Sepa Instant Transfer
      - `klarna_pay_now`
        Klarna Pay Now
      - `online_banking_poland`
        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.
      - `wechat_pay`
        Payments made via WeChat Pay.
      - `alipay`
        Payments made via Alipay.
      - `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`
        Pix
      - `klarna`
        Payments made via Klarna.
      - `alipay_hk`
        Payments made via Alipay HK.
      - `paypay`
        PayPay
      - `gcash`
        Payments made via GCash.
      - `south_korean_cards`
        Payments made via South Korean Cards
      - `paynow`
      - `bizum`
      - `promptpay`
      - `dana`
        Payments made via Dana.
      - `touch_n_go`
        Payments made via Touch 'n Go.
      - `tamara`
        Payments made via Tamara.
      - `qpay`
        Payments made via Qpay.
      - `ovo`
      - `momo`
      - `mercado_pago`
      - `nequi`
      - `nupay`
      - `picpay`
      - `thai_qr`
      - `blik`
      - `fpx`
      - `wero`
      - `p24`
      - `affirm_pay`
      - `rakuten_pay`
  - `reference_id` (optional, string, max chars=65k)
    Identifier for Braintree permanent token. Applicable when you are using Braintree APIs for completing the 3DS flow.
  - `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

## 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

- `unbilled_charges` (optional)
  Resource object representing unbilled\_charge
