# Pause a subscription

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


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

Use this API to pause an active or non-renewing subscription. When a subscription is paused, it does not renew, and Chargebee does not generate renewal [invoices](/docs/api/invoices) for it. This allows you to temporarily suspend a customer's service without canceling the subscription.

### Prerequisites & Constraints

-   The [Pause Subscription](https://www.chargebee.com/docs/2.0/pause-subscription.html#configure-pause-resume-subscription) feature must be enabled for the site.
-   Only subscriptions in the `active` or `non_renewing` state can be paused.
-   Subscriptions with [active contract\_terms](/docs/api/contract_terms/contract_term-object#status) cannot be paused.

### Impacts

**

Subscription

**

If the `pause_option` parameter is set to `immediately`, the subscription's `status` changes to `paused`. The `next_billing_at`, `pause_date`, and `resume_date` values are updated based on the input parameters.

**

Unbilled Charges

**

If the subscription has [unbilled charges](/docs/api/unbilled_charges) and is paused immediately, you can choose to leave the charges unbilled or invoice them. If invoiced, Chargebee attempts payment collection based on the customer's auto-collection settings. If payment fails or auto-collection is not enabled, the invoice is marked as unpaid.

Use the `unbilled_charges_handling` parameter to set your preference.

**

Dunning

**

If the subscription has unpaid invoices in [dunning](https://www.chargebee.com/docs/payments/2.0/dunning/dunning-v2) and is paused immediately, you can choose to either stop or continue the dunning process.

Use the `invoice_dunning_handling` parameter to set your preference.

**

Scheduled Ramps

**

Any future [subscription ramps](/docs/api/ramps) (such as price or quantity changes) effective on or after the pause date are automatically deleted.

**

Advanced Invoices

**

If the subscription has an [advance invoice](/docs/api/subscriptions/charge-future-renewals), Chargebee creates an adjustment credit note if the invoice is unpaid or in a payment-due state. If the invoice is already paid, a refundable credit note is created.

### Implementation Notes

Before calling this API, perform the following checks:

-   Confirm that the subscription `status` is `active` or `non_renewing`. If it isn't, the API returns an `invalid_state_for_pause` error.
-   Check the `has_scheduled_changes` attribute. If `true`, either remove the scheduled changes before calling the API or avoid the operation. Otherwise, the API returns an `operation_failed` error.
-   Ensure that the `contract_term` attribute is not present, or if it is present, that `contract_term.status` is not `active`. Otherwise, the API returns an `invalid_request` error.
-   If a subscription is in the `non_renewing` state and you want to set the [pause date](/docs/api/subscriptions/pause-a-subscription#pause_date) to a future date, the pause date must be earlier than the [cancellation date](/docs/api/subscriptions). If you specify a [resume date](/docs/api/subscriptions/pause-a-subscription#resume_date), it must also be earlier than the cancellation date.

## Sample Request

### pauses the subscription on end of term.

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/subscriptions/__test__8asukSOXdwKMPo/pause \
     -u {site_api_key}:\
     -d pause_option="END_OF_TERM"
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Subscription.Pause("__test__8asukSOXdwKMPo")
		.PauseOption(PauseOptionEnum.EndOfTerm)
		.Request();

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

#### 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"
    enum "github.com/chargebee/chargebee-go/v3/enum"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := subscriptionAction.Pause("__test__8asukSOXdwKMPo", &subscription.PauseRequestParams{
        PauseOption : enum.PauseOptionEndOfTerm,
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
        UnbilledCharges := res.UnbilledCharges
        CreditNotes := res.CreditNotes
    }
}
```

#### 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.SubscriptionPauseRequest{
    PauseOption : chargebee.PauseOptionEndOfTerm,
}
  res, err := client.Subscription.Pause("__test__8asukSOXdwKMPo", req)
      if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
        UnbilledCharges := res.UnbilledCharges
        CreditNotes := res.CreditNotes
    }
}
```

#### 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.pause("__test__8asukSOXdwKMPo")
            .pauseOption(PauseOption.END_OF_TERM)
            .request();

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

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.card.Card;
import com.chargebee.v4.models.creditNote.CreditNote;
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.SubscriptionPauseParams;
import com.chargebee.v4.models.subscription.responses.SubscriptionPauseResponse;
import com.chargebee.v4.models.unbilledCharge.UnbilledCharge;
import java.util.List;

public class SubscriptionPause {

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

        SubscriptionPauseParams params = SubscriptionPauseParams.builder()
            .pauseOption(SubscriptionPauseParams.PauseOption.END_OF_TERM)
            .build();

        SubscriptionPauseResponse response = client
            .subscriptions()
            .pause("__test__8asukSOXdwKMPo", params);

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

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.subscription.pause("__test__8asukSOXdwKMPo", {
        pause_option: "end_of_term"
    });

    console.log(result);
    const subscription = result.subscription;
    const customer = result.customer;
    const card = result.card;
    const invoice = result.invoice;
    const unbilledCharges = result.unbilled_charges;
    const creditNotes = result.credit_notes;
} 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()->pause("__test__8asukSOXdwKMPo", [
    "pause_option" => "end_of_term"
]);
$subscription = $result->subscription;
$customer = $result->customer;
$card = $result->card;
$invoice = $result->invoice;
$unbilledCharges = $result->unbilled_charges;
$creditNotes = $result->credit_notes;
```

#### Python

```python
import chargebee
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Subscription.pause("__test__8asukSOXdwKMPo",
    cb_client.Subscription.PauseParams(
        pause_option=chargebee.PauseOption.END_OF_TERM
    )
)
subscription = response.subscription
customer = response.customer
card = response.card
invoice = response.invoice
unbilled_charges = response.unbilled_charges
credit_notes = response.credit_notes
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::Subscription.pause("__test__8asukSOXdwKMPo",{
  :pause_option => "END_OF_TERM"
})

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

### Pause subscription at the end of the term and resume after one billing cycle.

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/subscriptions/6o0iPUoHhcNGcI/pause \
     -u {site_api_key}:\
     -d pause_option="BILLING_CYCLES" \
     -d skip_billing_cycles=1
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Subscription.Pause("6o0iPUoHhcNGcI")
		.PauseOption(PauseOptionEnum.BillingCycles)
		.SkipBillingCycles(1)
		.Request();

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

#### 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"
    enum "github.com/chargebee/chargebee-go/v3/enum"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := subscriptionAction.Pause("6o0iPUoHhcNGcI", &subscription.PauseRequestParams{
        PauseOption : enum.PauseOptionBillingCycles,
        SkipBillingCycles : chargebee.Int32(1),
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
        UnbilledCharges := res.UnbilledCharges
        CreditNotes := res.CreditNotes
    }
}
```

#### 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.SubscriptionPauseRequest{
    PauseOption : chargebee.PauseOptionBillingCycles,
    SkipBillingCycles : chargebee.Int32(1),
}
  res, err := client.Subscription.Pause("6o0iPUoHhcNGcI", req)
      if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
        UnbilledCharges := res.UnbilledCharges
        CreditNotes := res.CreditNotes
    }
}
```

#### 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.pause("6o0iPUoHhcNGcI")
            .pauseOption(PauseOption.BILLING_CYCLES)
            .skipBillingCycles(1)
            .request();

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

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.card.Card;
import com.chargebee.v4.models.creditNote.CreditNote;
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.SubscriptionPauseParams;
import com.chargebee.v4.models.subscription.responses.SubscriptionPauseResponse;
import com.chargebee.v4.models.unbilledCharge.UnbilledCharge;
import java.util.List;

public class SubscriptionPause {

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

        SubscriptionPauseParams params = SubscriptionPauseParams.builder()
            .pauseOption(SubscriptionPauseParams.PauseOption.BILLING_CYCLES)
            .skipBillingCycles(1)
            .build();

        SubscriptionPauseResponse response = client
            .subscriptions()
            .pause("6o0iPUoHhcNGcI", params);

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

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.subscription.pause("6o0iPUoHhcNGcI", {
        pause_option: "billing_cycles",
        skip_billing_cycles: 1
    });

    console.log(result);
    const subscription = result.subscription;
    const customer = result.customer;
    const card = result.card;
    const invoice = result.invoice;
    const unbilledCharges = result.unbilled_charges;
    const creditNotes = result.credit_notes;
} 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()->pause("6o0iPUoHhcNGcI", [
    "pause_option" => "billing_cycles",
    "skip_billing_cycles" => 1
]);
$subscription = $result->subscription;
$customer = $result->customer;
$card = $result->card;
$invoice = $result->invoice;
$unbilledCharges = $result->unbilled_charges;
$creditNotes = $result->credit_notes;
```

#### Python

```python
import chargebee
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Subscription.pause("6o0iPUoHhcNGcI",
    cb_client.Subscription.PauseParams(
        pause_option=chargebee.PauseOption.BILLING_CYCLES,
        skip_billing_cycles=1
    )
)
subscription = response.subscription
customer = response.customer
card = response.card
invoice = response.invoice
unbilled_charges = response.unbilled_charges
credit_notes = response.credit_notes
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::Subscription.pause("6o0iPUoHhcNGcI",{
  :pause_option => "BILLING_CYCLES",
  :skip_billing_cycles => 1
})

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

### Pause subscription on a specific date.

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/subscriptions/6o0iPUoHhcNGcI/pause \
     -u {site_api_key}:\
     -d pause_option="SPECIFIC_DATE" \
     -d pause_date=1751241600
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Subscription.Pause("6o0iPUoHhcNGcI")
		.PauseOption(PauseOptionEnum.SpecificDate)
		.PauseDate(1751241600)
		.Request();

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

#### 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"
    enum "github.com/chargebee/chargebee-go/v3/enum"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := subscriptionAction.Pause("6o0iPUoHhcNGcI", &subscription.PauseRequestParams{
        PauseOption : enum.PauseOptionSpecificDate,
        PauseDate : chargebee.Int64(1751241600),
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
        UnbilledCharges := res.UnbilledCharges
        CreditNotes := res.CreditNotes
    }
}
```

#### 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.SubscriptionPauseRequest{
    PauseOption : chargebee.PauseOptionSpecificDate,
    PauseDate : chargebee.Int64(1751241600),
}
  res, err := client.Subscription.Pause("6o0iPUoHhcNGcI", req)
      if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
        UnbilledCharges := res.UnbilledCharges
        CreditNotes := res.CreditNotes
    }
}
```

#### 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;
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.pause("6o0iPUoHhcNGcI")
            .pauseOption(PauseOption.SPECIFIC_DATE)
            .pauseDate(new Timestamp(1751241600L * 1000))
            .request();

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

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.card.Card;
import com.chargebee.v4.models.creditNote.CreditNote;
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.SubscriptionPauseParams;
import com.chargebee.v4.models.subscription.responses.SubscriptionPauseResponse;
import com.chargebee.v4.models.unbilledCharge.UnbilledCharge;
import java.sql.Timestamp;
import java.util.List;

public class SubscriptionPause {

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

        SubscriptionPauseParams params = SubscriptionPauseParams.builder()
            .pauseOption(SubscriptionPauseParams.PauseOption.SPECIFIC_DATE)
            .pauseDate(new Timestamp(1751241600L * 1000))
            .build();

        SubscriptionPauseResponse response = client
            .subscriptions()
            .pause("6o0iPUoHhcNGcI", params);

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

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.subscription.pause("6o0iPUoHhcNGcI", {
        pause_option: "specific_date",
        pause_date: 1751241600
    });

    console.log(result);
    const subscription = result.subscription;
    const customer = result.customer;
    const card = result.card;
    const invoice = result.invoice;
    const unbilledCharges = result.unbilled_charges;
    const creditNotes = result.credit_notes;
} 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()->pause("6o0iPUoHhcNGcI", [
    "pause_option" => "specific_date",
    "pause_date" => 1751241600
]);
$subscription = $result->subscription;
$customer = $result->customer;
$card = $result->card;
$invoice = $result->invoice;
$unbilledCharges = $result->unbilled_charges;
$creditNotes = $result->credit_notes;
```

#### Python

```python
import chargebee
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Subscription.pause("6o0iPUoHhcNGcI",
    cb_client.Subscription.PauseParams(
        pause_option=chargebee.PauseOption.SPECIFIC_DATE,
        pause_date=1751241600
    )
)
subscription = response.subscription
customer = response.customer
card = response.card
invoice = response.invoice
unbilled_charges = response.unbilled_charges
credit_notes = response.credit_notes
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::Subscription.pause("6o0iPUoHhcNGcI",{
  :pause_option => "SPECIFIC_DATE",
  :pause_date => 1751241600
})

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

### Pause subscription immediately and resume on a specific date.

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/subscriptions/6o0iPUoHhcNGcI/pause \
     -u {site_api_key}:\
     -d pause_option="IMMEDIATELY" \
     -d resume_date=1751328000
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Subscription.Pause("6o0iPUoHhcNGcI")
		.PauseOption(PauseOptionEnum.Immediately)
		.ResumeDate(1751328000)
		.Request();

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

#### 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"
    enum "github.com/chargebee/chargebee-go/v3/enum"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := subscriptionAction.Pause("6o0iPUoHhcNGcI", &subscription.PauseRequestParams{
        PauseOption : enum.PauseOptionImmediately,
        ResumeDate : chargebee.Int64(1751328000),
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
        UnbilledCharges := res.UnbilledCharges
        CreditNotes := res.CreditNotes
    }
}
```

#### 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.SubscriptionPauseRequest{
    PauseOption : chargebee.PauseOptionImmediately,
    ResumeDate : chargebee.Int64(1751328000),
}
  res, err := client.Subscription.Pause("6o0iPUoHhcNGcI", req)
      if err != nil {
        fmt.Println(err)
    } else {
        Subscription := res.Subscription
        Customer := res.Customer
        Card := res.Card
        Invoice := res.Invoice
        UnbilledCharges := res.UnbilledCharges
        CreditNotes := res.CreditNotes
    }
}
```

#### 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;
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.pause("6o0iPUoHhcNGcI")
            .pauseOption(PauseOption.IMMEDIATELY)
            .resumeDate(new Timestamp(1751328000L * 1000))
            .request();

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

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.card.Card;
import com.chargebee.v4.models.creditNote.CreditNote;
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.SubscriptionPauseParams;
import com.chargebee.v4.models.subscription.responses.SubscriptionPauseResponse;
import com.chargebee.v4.models.unbilledCharge.UnbilledCharge;
import java.sql.Timestamp;
import java.util.List;

public class SubscriptionPause {

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

        SubscriptionPauseParams params = SubscriptionPauseParams.builder()
            .pauseOption(SubscriptionPauseParams.PauseOption.IMMEDIATELY)
            .resumeDate(new Timestamp(1751328000L * 1000))
            .build();

        SubscriptionPauseResponse response = client
            .subscriptions()
            .pause("6o0iPUoHhcNGcI", params);

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

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.subscription.pause("6o0iPUoHhcNGcI", {
        pause_option: "immediately",
        resume_date: 1751328000
    });

    console.log(result);
    const subscription = result.subscription;
    const customer = result.customer;
    const card = result.card;
    const invoice = result.invoice;
    const unbilledCharges = result.unbilled_charges;
    const creditNotes = result.credit_notes;
} 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()->pause("6o0iPUoHhcNGcI", [
    "pause_option" => "immediately",
    "resume_date" => 1751328000
]);
$subscription = $result->subscription;
$customer = $result->customer;
$card = $result->card;
$invoice = $result->invoice;
$unbilledCharges = $result->unbilled_charges;
$creditNotes = $result->credit_notes;
```

#### Python

```python
import chargebee
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Subscription.pause("6o0iPUoHhcNGcI",
    cb_client.Subscription.PauseParams(
        pause_option=chargebee.PauseOption.IMMEDIATELY,
        resume_date=1751328000
    )
)
subscription = response.subscription
customer = response.customer
card = response.card
invoice = response.invoice
unbilled_charges = response.unbilled_charges
credit_notes = response.credit_notes
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::Subscription.pause("6o0iPUoHhcNGcI",{
  :pause_option => "IMMEDIATELY",
  :resume_date => 1751328000
})

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

## Sample Response

```json
{
  "customer": {
    "allow_direct_debit": false,
    "auto_collection": "off",
    "card_status": "no_card",
    "created_at": 1612890922,
    "deleted": false,
    "excess_payments": 0,
    "first_name": "John",
    "id": "__test__8asukSOXdwFjPl",
    "last_name": "Doe",
    "net_term_days": 0,
    "object": "customer",
    "pii_cleared": "active",
    "preferred_currency_code": "USD",
    "promotional_credits": 0,
    "refundable_credits": 0,
    "resource_version": 1612890922000,
    "taxability": "taxable",
    "unbilled_charges": 0,
    "updated_at": 1612890922
  },
  "subscription": {
    "activated_at": 1612890922,
    "billing_period": 1,
    "billing_period_unit": "month",
    "created_at": 1612890922,
    "currency_code": "USD",
    "current_term_end": 1615310122,
    "current_term_start": 1612890922,
    "customer_id": "__test__8asukSOXdwFjPl",
    "deleted": false,
    "due_invoices_count": 1,
    "due_since": 1612890922,
    "has_scheduled_changes": false,
    "id": "__test__8asukSOXdwKMPo",
    "mrr": 0,
    "object": "subscription",
    "pause_date": 1615310122,
    "remaining_billing_cycles": 1,
    "resource_version": 1612890923000,
    "started_at": 1612890922,
    "status": "active",
    "subscription_items": [
      {
        "amount": 1000,
        "billing_cycles": 1,
        "free_quantity": 0,
        "item_price_id": "basic-USD",
        "item_type": "plan",
        "object": "subscription_item",
        "quantity": 1,
        "unit_price": 1000
      },
      {..}
    ],
    "total_dues": 1100,
    "updated_at": 1612890923
  }
}
```

## URL Format

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

## Input Parameters

- `pause_option` (optional, enumerated string)
  List of options to pause the subscription.
  Possible enum values:
    - `immediately`
      Pause immediately
    - `end_of_term`
      Pause at the end of current term
    - `specific_date`
      Pause on a specific date
    - `billing_cycles`
      Pause at the end of the current term, and resume automatically after the set number of billing cycles (in `[skip_billing_cycles](/docs/api/subscriptions/pause-a-subscription#skip_billing_cycles)`) have been skipped

- `pause_date` (optional, timestamp(UTC) in seconds)
  Date on which the subscription will be paused. Applicable when `specific_date` option is chosen in the `[pause_option](/docs/api/subscriptions/pause-a-subscription#pause_option)` field. For non-renewing subscriptions, `pause_date` should be before the cancellation date.

- `unbilled_charges_handling` (optional, enumerated string)
  Applicable when unbilled charges are present for the subscription and `[pause_option](/docs/api/subscriptions/pause-a-subscription#pause_option)` is set as `immediately`. **Note:** On the invoice raised, an automatic charge is attempted on the payment method available, if customer's auto-collection property is set to `on`.
  Possible enum values:
    - `no_action`
      Retain as unbilled If `no_action` is chosen, charges are added to the resumption invoice.
    - `invoice`
      Invoice charges If `invoice` is chosen, an automatic charge is attempted on the payment method available if the customer has enabled auto-collection. If a payment collection fails or when auto-collection is not enabled, the invoice is closed as unpaid.

- `invoice_dunning_handling` (optional, enumerated string)
  Handles dunning for invoices already in the dunning cycle when a subscription is paused. Applicable when `[pause_option](/docs/api/subscriptions/pause-a-subscription#pause_option)` is set as `immediately`. If invoice is in the dunning cycle, `invoice_dunning_handing` allows you to `stop` or `continue` dunning.
  Possible enum values:
    - `continue`
      Continue dunning
    - `stop`
      Stop dunning

- `skip_billing_cycles` (optional, integer, min=1)
  The number of subscription billing cycles that will be skipped. The subscription resumes after the set number of billing cycles have been skipped. This is applicable only when the value of of `[pause_option](/docs/api/subscriptions/pause-a-subscription#pause_option)` is `billing_cycles` .

- `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. For non-renewing subscriptions,`resume_date` should be before the cancellation date.

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

- `credit_notes` (optional)
  Resource object representing credit\_note
