> ## Client identification
>
> Requests to this API should include a `Client-Platform` header alongside
> `Authorization`, identifying the application, tool, or model making the
> request. This is used for integration support and analytics.
>
> Use your model or tool name, for example `claude-code` or `chatgpt`.
>
> Example:
>
> ```bash
> curl https://api.salaryboxapp.com/... \
>   -H "Authorization: Api-Key <api-key>" \
>   -H "Client-Platform: claude-code"
> ```

# Fetch Upcoming Renewal

GET https://api.salaryboxapp.com/v2/customer/v1/company/subscription/upcoming

Returns what your company's next billing cycle renews into and when it will be charged. Not paginated, no parameters. Only for companies on SalaryBox's current pricing.

- `data` is `null` when the company has no recurring payment set up.
- This shows what auto-renew will charge next. `upcoming_renewal` in Fetch Company Subscription shows a cycle that is already paid for.
- Returns `503` `"Service temporarily unavailable. Please try again later."` when this can't be fetched right now.


Reference: https://docs.salarybox.in/api-reference/billing/subscription-upcoming-retrieve

## Authentication

- `Authorization` header (required) (prefixed with ` Api-Key   `) — Format: "Api-Key \{api-key}"

## Response

### 200

The next renewal, or `null` data when no recurring payment is set up.

- `message` (string, required)
- `status` (boolean, required)
- `data` (SubscriptionUpcomingRenewal, required, nullable) — `null` when the company has no recurring payment set up.

## Errors

### 403 Forbidden Error

Your company is not on SalaryBox's current pricing.

- `message` (string, required)
- `status` (boolean, required)
- `errors` (map from string to any, optional, nullable)

### 503 Service Unavailable Error

This can't be fetched right now. Try again shortly.

- `message` (string, required)
- `status` (boolean, required)
- `errors` (map from string to any, optional, nullable)

## Types

### SubscriptionUpcomingRenewal

- `addons` (list of SubscriptionUpcomingRenewalAddonsItems, required)
- `auto_renew` (boolean, required) — `true` when the next cycle will be charged automatically.
- `plan_id` (string, optional, nullable)
- `plan_name` (string, optional, nullable)
- `billing_cycle` (string, optional, nullable) — Lower case, for example `quarterly` or `annual`.
- `staff_count` (integer, optional, nullable)
- `coupon_code` (string, optional, nullable)
- `coupon_discount_amount` (string, optional, nullable) — 2-decimal string.
- `next_renewal_date` (datetime, optional, nullable) — When the next charge is due.
- `next_renewal_amount` (string, optional, nullable) — 2-decimal string.

### SubscriptionUpcomingRenewalAddonsItems

- `id` (string, required)
- `name` (string, required)
- `staff_count` (integer, required)

## Examples

**Response**

```json
{
  "message": "Success",
  "status": true,
  "data": {
    "addons": [
      {
        "id": "location_tracking",
        "name": "Location Tracking",
        "staff_count": 10
      }
    ],
    "auto_renew": true,
    "plan_id": "business",
    "plan_name": "Business",
    "billing_cycle": "quarterly",
    "staff_count": 25,
    "coupon_code": "WELCOME10",
    "coupon_discount_amount": "150.00",
    "next_renewal_date": "2027-01-15T00:00:00+05:30",
    "next_renewal_amount": "3400.00"
  }
}
```

**SDK Code**

```python Example
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/company/subscription/upcoming"

headers = {"Authorization": "Api-Key  <apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Example
const url = 'https://api.salaryboxapp.com/v2/customer/v1/company/subscription/upcoming';
const options = {method: 'GET', headers: {Authorization: 'Api-Key  <apiKey>'}};

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

```go Example
package main

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

func main() {

	url := "https://api.salaryboxapp.com/v2/customer/v1/company/subscription/upcoming"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Api-Key  <apiKey>")

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

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

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

}
```

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

url = URI("https://api.salaryboxapp.com/v2/customer/v1/company/subscription/upcoming")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'

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

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

HttpResponse<String> response = Unirest.get("https://api.salaryboxapp.com/v2/customer/v1/company/subscription/upcoming")
  .header("Authorization", "Api-Key  <apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.salaryboxapp.com/v2/customer/v1/company/subscription/upcoming', [
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
  ],
]);

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

```csharp Example
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/company/subscription/upcoming");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Example
import Foundation

let headers = ["Authorization": "Api-Key  <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/company/subscription/upcoming")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```