> This page is for Developer.

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

# Reschedule Multiple Coupon Codes

PUT https://api.bigcommerce.com/stores/{store_hash}/v3/promotions/{promotion_id}/reschedulecodes
Content-Type: application/json

Sets or clears the custom validity window on up to 250 coupon codes of a bulk coupon promotion in a single atomic operation.

**Notes**
* Only supported for bulk coupon promotions (`coupon_type` of `BULK`); a 422 is returned otherwise.
* `schedule: null` resets the selected codes to inherit the promotion's schedule.
* Batches are limited to 250 coupon code ids; larger batches return a 422.
* The operation is atomic — any invalid id (including ids that do not exist or belong to another promotion) fails the whole request with a 422.
* Dates must be within the promotion's schedule, and `valid_until` must be after `valid_from`.
* You cannot reschedule the codes of an archived promotion.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/admin/management/promotions/coupon-codes-bulk/reschedule-promotion-codes

## Authentication

- `X-Auth-Token` header (required) — ### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Marketing | modify | `store_v2_marketing` | | Marketing | read-only | `store_v2_marketing_read_only` | ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see [API Accounts and OAuth Scopes](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts). For more about BigCommerce OAuth scopes, see [API Accounts and OAuth Scopes](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

## Request

### Path parameters

- `promotion_id` (string, required) — The ID of the associated promotion.
- `store_hash` (string, required) — Permanent ID of the BigCommerce store.

### Headers

- `Accept` (string, required, default: application/json) — The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body.

### Body (application/json)

This endpoint expects an object.

- `ids` (list of integer, required) — The ids of the coupon codes to reschedule. All ids must exist and belong to the promotion. Limited to 250 ids per request.
- `schedule` (CouponCodeSchedule, required, nullable) — The custom schedule to apply to the selected codes. `null` resets the codes to inherit the promotion's schedule.

## Response

### 204

The coupon codes have the new schedule. The change applies to redemption immediately.

## Errors

### 404 Not Found Error

The promotion does not exist.

- `status` (integer, optional)
- `title` (string, optional)
- `type` (string, optional)

### 422 Unprocessable Entity Error

The server cannot process the request. Possible causes: the body is invalid, the window is outside the promotion schedule, one or more ids do not belong to the promotion, the promotion is not a bulk coupon promotion, or the promotion is archived.

- `status` (integer, optional)
- `title` (string, optional)
- `type` (string, optional)

## Types

### CouponCodeSchedule

A custom validity window for a coupon code, independent of (but fully contained within) the parent promotion's schedule.

- `valid_from` (datetime, required) — The date and time from which the code can be redeemed (RFC3339 UTC). Must be within the promotion's schedule.
- `valid_until` (datetime, required, nullable) — The date and time until which the code can be redeemed (RFC3339 UTC). Must be after `valid_from` and within the promotion's schedule. `null` means no end, and is only allowed if the parent promotion does not have an end date. Must not be `null` if the parent promotion has an end date.

## Examples

### Set a custom schedule

**Request**

```json
{
  "ids": [
    1,
    2,
    3
  ],
  "schedule": {
    "valid_from": "2026-09-01T00:00:00+00:00",
    "valid_until": "2026-09-30T23:59:59+00:00"
  }
}
```

**SDK Code**

```python Set a custom schedule
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes"

payload = {
    "ids": [1, 2, 3],
    "schedule": {
        "valid_from": "2026-09-01T00:00:00+00:00",
        "valid_until": "2026-09-30T23:59:59+00:00"
    }
}
headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Set a custom schedule
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes';
const options = {
  method: 'PUT',
  headers: {
    Accept: 'application/json',
    'X-Auth-Token': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"ids":[1,2,3],"schedule":{"valid_from":"2026-09-01T00:00:00+00:00","valid_until":"2026-09-30T23:59:59+00:00"}}'
};

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

```go Set a custom schedule
package main

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

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes"

	payload := strings.NewReader("{\n  \"ids\": [\n    1,\n    2,\n    3\n  ],\n  \"schedule\": {\n    \"valid_from\": \"2026-09-01T00:00:00+00:00\",\n    \"valid_until\": \"2026-09-30T23:59:59+00:00\"\n  }\n}")

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

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")
	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 Set a custom schedule
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes")

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

request = Net::HTTP::Put.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ids\": [\n    1,\n    2,\n    3\n  ],\n  \"schedule\": {\n    \"valid_from\": \"2026-09-01T00:00:00+00:00\",\n    \"valid_until\": \"2026-09-30T23:59:59+00:00\"\n  }\n}"

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

```java Set a custom schedule
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"ids\": [\n    1,\n    2,\n    3\n  ],\n  \"schedule\": {\n    \"valid_from\": \"2026-09-01T00:00:00+00:00\",\n    \"valid_until\": \"2026-09-30T23:59:59+00:00\"\n  }\n}")
  .asString();
```

```php Set a custom schedule
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes', [
  'body' => '{
  "ids": [
    1,
    2,
    3
  ],
  "schedule": {
    "valid_from": "2026-09-01T00:00:00+00:00",
    "valid_until": "2026-09-30T23:59:59+00:00"
  }
}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp Set a custom schedule
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ids\": [\n    1,\n    2,\n    3\n  ],\n  \"schedule\": {\n    \"valid_from\": \"2026-09-01T00:00:00+00:00\",\n    \"valid_until\": \"2026-09-30T23:59:59+00:00\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Set a custom schedule
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "ids": [1, 2, 3],
  "schedule": [
    "valid_from": "2026-09-01T00:00:00+00:00",
    "valid_until": "2026-09-30T23:59:59+00:00"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Reset to the promotion schedule

**Request**

```json
{
  "ids": [
    1,
    2,
    3
  ],
  "schedule": null
}
```

**SDK Code**

```python Reset to the promotion schedule
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes"

payload = {
    "ids": [1, 2, 3],
    "schedule": None
}
headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Reset to the promotion schedule
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes';
const options = {
  method: 'PUT',
  headers: {
    Accept: 'application/json',
    'X-Auth-Token': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"ids":[1,2,3],"schedule":null}'
};

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

```go Reset to the promotion schedule
package main

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

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes"

	payload := strings.NewReader("{\n  \"ids\": [\n    1,\n    2,\n    3\n  ],\n  \"schedule\": null\n}")

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

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")
	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 Reset to the promotion schedule
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes")

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

request = Net::HTTP::Put.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ids\": [\n    1,\n    2,\n    3\n  ],\n  \"schedule\": null\n}"

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

```java Reset to the promotion schedule
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"ids\": [\n    1,\n    2,\n    3\n  ],\n  \"schedule\": null\n}")
  .asString();
```

```php Reset to the promotion schedule
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes', [
  'body' => '{
  "ids": [
    1,
    2,
    3
  ],
  "schedule": null
}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp Reset to the promotion schedule
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ids\": [\n    1,\n    2,\n    3\n  ],\n  \"schedule\": null\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Reset to the promotion schedule
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "ids": [1, 2, 3],
  "schedule": 
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/promotions/promotion_id/reschedulecodes")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```