> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.paymentkit.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.paymentkit.com/_mcp/server.

# Reschedule Billing

POST https://app.paymentkit.com/api/{account_id}/subscriptions/{subscription_id}/reschedule-billing
Content-Type: application/json

Reschedule subscription billing date.

Changes current_period_end and triggers Restate re-evaluation.
Old scheduled billing actions are automatically superseded.

Requirements:
- Subscription must be in ACTIVE state
- No unpaid invoices (open or draft) can exist
- next_billing_date must be in the future

Preview mode:
- Set is_preview=true to calculate changes without applying them
- Useful for showing customers what the new billing date would be

Proration (optional):
- Set create_proration=true to create proration items for the time difference
- This is a future enhancement and currently has no effect

Returns:
- subscription_id: The subscription's ID
- current_period_end: The new billing date
- previous_period_end: The old billing date
- lifecycle_triggered: Whether Restate was notified to re-evaluate

Works for both User and API Key authentication.
Account access is automatically validated via endpoint dependency.

Reference: https://docs.paymentkit.com/api-reference/api-reference/subscriptions/reschedule-billing

## Authentication

- `Authorization` header (bearer token, required)

## Servers

- `https://app.paymentkit.com` (Production, default)
- `https://staging.paymentkit.com` (Staging)

## Request

### Path parameters

- `subscription_id` (string, required)
- `account_id` (string, required)

### Body (application/json)

- `next_billing_date` (datetime, required) — New billing date (must be in the future)
- `create_proration` (boolean, optional, default: false) — Create proration items for time difference
- `is_preview` (boolean, optional, default: false) — Calculate without applying changes

## Response

### 200

Successful Response

- `subscription_id` (string, required)
- `current_period_end` (datetime, required)
- `previous_period_end` (datetime, required)
- `proration_credit_amount_atom` (integer, optional, default: 0)
- `proration_charge_amount_atom` (integer, optional, default: 0)
- `lifecycle_triggered` (boolean, optional, default: false)
- `is_preview` (boolean, optional, default: false)

## Examples

**Request**

```json
{
  "next_billing_date": "2024-07-01T10:00:00Z"
}
```

**Response**

```json
{
  "subscription_id": "sub_9f8b7c6d5e4a3b2c1d0e",
  "current_period_end": "2024-07-01T10:00:00Z",
  "previous_period_end": "2024-06-01T10:00:00Z",
  "proration_credit_amount_atom": 0,
  "proration_charge_amount_atom": 0,
  "lifecycle_triggered": true,
  "is_preview": false
}
```

**SDK Code**

```python
import requests

url = "https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/reschedule-billing"

payload = { "next_billing_date": "2024-07-01T10:00:00Z" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/reschedule-billing';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"next_billing_date":"2024-07-01T10:00:00Z"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/reschedule-billing"

	payload := strings.NewReader("{\n  \"next_billing_date\": \"2024-07-01T10:00:00Z\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/reschedule-billing")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"next_billing_date\": \"2024-07-01T10:00:00Z\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/reschedule-billing")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"next_billing_date\": \"2024-07-01T10:00:00Z\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/reschedule-billing', [
  'body' => '{
  "next_billing_date": "2024-07-01T10:00:00Z"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/reschedule-billing");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"next_billing_date\": \"2024-07-01T10:00:00Z\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["next_billing_date": "2024-07-01T10:00:00Z"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.paymentkit.com/api/account_id/subscriptions/subscription_id/reschedule-billing")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```