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

# Get Latest Promotion Task

GET https://api.bigcommerce.com/stores/{store_hash}/v3/promotions/latest-task

Returns the store's latest promotion task. A task tracks a long-running operation, such as a coupon code import started with [Import Coupon Codes](/developer/api-reference/rest/admin/management/promotions/coupon-codes-bulk/import-promotion-codes). Poll this endpoint to follow an import's progress.

**Notes**
* A store has one task record at a time. Starting a new task, such as a coupon code import, replaces the previous one.
* A task expires 7 days after it was created. After that, this endpoint returns a 204 until a new task starts.
* The default rate limit for this endpoint is 40 concurrent requests.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/admin/management/promotions/promotion-tasks/get-latest-promotion-task

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

- `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.

## Response

### 200

The promotion task. **Coupon code import tasks** * `completed` means the import created at least one code. It may not have processed every row. If the import stopped early, for example because the promotion was archived, `codes_created` plus `codes_failed` is less than `codes_total`. * `failed` means the import created no codes. `failure_reason` explains why. * An import that is still `queued` or `processing` more than 24 hours after it was created is treated as abandoned. Its `status` does not change, but a new import can start, including one with the same file.

- `data` (PromotionTask, optional) — A long-running operation performed on a promotion, such as a coupon code import.
- `meta` (PromotionsLatestTaskGetResponsesContentApplicationJsonSchemaMeta, optional) — Empty meta object, which may be used at a later time.

## Errors

### 500 Internal Server Error

An internal error occurred while reading the promotion task.

- `status` (integer, required) — The HTTP status code.
- `title` (string, required) — A description of the error.
- `type` (string, required) — A link to the list of BigCommerce API status codes.
- `errors` (PromotionImportErrorResponseErrors, optional) — The rows that failed validation. Only present on a 422 when one or more rows of the uploaded file fail validation.

## Types

### PromotionTask

A long-running operation performed on a promotion, such as a coupon code import.

- `promotion_id` (integer, required) — The ID of the promotion the task belongs to.
- `status` (enum, required) — The current status of the task. * `queued`: The task is waiting to start. * `processing`: The task is running. * `completed`: The task finished. * `failed`: The task failed. `failure_reason` explains why.
  - Allowed values: `queued`, `processing`, `completed`, `failed`
- `import` (PromotionTaskImport, required) — The progress of a coupon code import.
- `created_at` (datetime, required) — The date and time the task was created, in RFC 3339 format.
- `finished_at` (datetime, required, nullable) — The date and time the task completed or failed, in RFC 3339 format. `null` while the task is queued or processing.
- `failure_reason` (string, required, nullable) — Why the task failed. `null` unless `status` is `failed`. Possible values: * `No codes were created from the uploaded file`: The import read the whole file but created no codes, for example because every code already exists or the file has no rows. * `The promotion no longer exists`: The promotion was deleted before any codes were created. * `The promotion was archived during the import`: The promotion was archived before any codes were created. * `Codes can only be imported into a bulk coupon promotion`: The promotion stopped being a bulk coupon promotion before any codes were created. * `The import file could not be read` * `The import stopped after repeated failures` * `The import could not be started due to invalid parameters`

### PromotionsLatestTaskGetResponsesContentApplicationJsonSchemaMeta

Empty meta object, which may be used at a later time.

### PromotionImportErrorResponseErrors

The rows that failed validation. Only present on a 422 when one or more rows of the uploaded file fail validation.

- `rows` (list of PromotionImportRowError, optional) — The rows that failed validation, in the order they appear in the file. At most 20 rows are reported.
- `errors_truncated` (boolean, optional) — Whether more than 20 rows failed validation.

### PromotionTaskImport

The progress and failure details of a coupon code import.

- `codes_total` (integer, required) — The number of rows of codes in the imported file, not counting the header or blank lines.
- `codes_created` (integer, required) — The number of codes created so far.
- `codes_failed` (integer, required) — The number of codes that were not created, including skipped duplicates.
- `failure_details` (list of PromotionTaskImportFailureDetailsItems, required) — Why codes were not created. Contains at most one entry of each kind.

### PromotionImportRowError

Every validation failure found on one row of the uploaded file.

- `row` (integer, required) — The line number of the row in the uploaded file. The header is line 1, and blank lines are counted.
- `messages` (list of string, required) — The validation failures found on this row.

### PromotionTaskImportFailureDetailsItems

- Promotion Task Import Duplicate Failure Detail: PromotionTaskImportDuplicateFailureDetail
- Promotion Task Import Row Failure Detail: PromotionTaskImportRowFailureDetail

### PromotionTaskImportDuplicateFailureDetail

Codes that were skipped because they already exist in the store or appear earlier in the same file. Codes are compared case-insensitively.

- `message` (enum, required) — A description of the failure.
  - Allowed values: `Duplicate codes found`
- `codes` (list of string, required) — The skipped codes, as written in the file. At most 100 codes are listed. `codes_failed` includes every skipped code.

### PromotionTaskImportRowFailureDetail

Rows that were never processed because the import stopped after repeated failures.

- `message` (enum, required) — A description of the failure.
  - Allowed values: `Some codes could not be imported after repeated failures`
- `first_occurrence_row` (integer, required) — The line number in the imported file of the first row that could not be imported. The header is line 1.
- `count` (integer, required) — The number of rows that could not be imported.

## Examples

### Queued

**Response**

```json
{
  "data": {
    "promotion_id": 678,
    "status": "queued",
    "import": {
      "codes_total": 50000,
      "codes_created": 0,
      "codes_failed": 0,
      "failure_details": []
    },
    "created_at": "2026-09-07T09:12:04+00:00",
    "finished_at": null,
    "failure_reason": null
  },
  "meta": {}
}
```

**SDK Code**

```python Queued
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task"

headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>"
}

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

print(response.json())
```

```javascript Queued
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task';
const options = {
  method: 'GET',
  headers: {Accept: 'application/json', 'X-Auth-Token': '<apiKey>'}
};

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

```go Queued
package main

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

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task"

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

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")

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

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

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

}
```

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

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")

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

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.get("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task', [
  'headers' => [
    'Accept' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp Queued
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Queued
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")! 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()
```

### Processing

**Response**

```json
{
  "data": {
    "promotion_id": 678,
    "status": "processing",
    "import": {
      "codes_total": 50000,
      "codes_created": 31000,
      "codes_failed": 2,
      "failure_details": [
        {
          "codes": [
            "SUMMER10",
            "summer11"
          ],
          "message": "Duplicate codes found"
        }
      ]
    },
    "created_at": "2026-09-07T09:12:04+00:00",
    "finished_at": null,
    "failure_reason": null
  },
  "meta": {}
}
```

**SDK Code**

```python Processing
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task"

headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>"
}

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

print(response.json())
```

```javascript Processing
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task';
const options = {
  method: 'GET',
  headers: {Accept: 'application/json', 'X-Auth-Token': '<apiKey>'}
};

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

```go Processing
package main

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

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task"

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

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")

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

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

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

}
```

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

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")

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

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.get("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task', [
  'headers' => [
    'Accept' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp Processing
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Processing
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")! 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()
```

### Completed

**Response**

```json
{
  "data": {
    "promotion_id": 678,
    "status": "completed",
    "import": {
      "codes_total": 50000,
      "codes_created": 49998,
      "codes_failed": 2,
      "failure_details": [
        {
          "codes": [
            "SUMMER10",
            "summer11"
          ],
          "message": "Duplicate codes found"
        }
      ]
    },
    "created_at": "2026-09-07T09:12:04+00:00",
    "finished_at": "2026-09-07T09:18:41+00:00",
    "failure_reason": null
  },
  "meta": {}
}
```

**SDK Code**

```python Completed
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task"

headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>"
}

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

print(response.json())
```

```javascript Completed
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task';
const options = {
  method: 'GET',
  headers: {Accept: 'application/json', 'X-Auth-Token': '<apiKey>'}
};

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

```go Completed
package main

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

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task"

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

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")

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

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

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

}
```

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

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")

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

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.get("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task', [
  'headers' => [
    'Accept' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp Completed
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Completed
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")! 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()
```

### Completed after stopping early

**Response**

```json
{
  "data": {
    "promotion_id": 678,
    "status": "completed",
    "import": {
      "codes_total": 50000,
      "codes_created": 19000,
      "codes_failed": 0,
      "failure_details": []
    },
    "created_at": "2026-09-07T09:12:04+00:00",
    "finished_at": "2026-09-07T09:12:28+00:00",
    "failure_reason": null
  },
  "meta": {}
}
```

**SDK Code**

```python Completed after stopping early
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task"

headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>"
}

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

print(response.json())
```

```javascript Completed after stopping early
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task';
const options = {
  method: 'GET',
  headers: {Accept: 'application/json', 'X-Auth-Token': '<apiKey>'}
};

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

```go Completed after stopping early
package main

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

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task"

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

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")

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

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

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

}
```

```ruby Completed after stopping early
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")

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

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'

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

```java Completed after stopping early
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .asString();
```

```php Completed after stopping early
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task', [
  'headers' => [
    'Accept' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp Completed after stopping early
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Completed after stopping early
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")! 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()
```

### Failed

**Response**

```json
{
  "data": {
    "promotion_id": 678,
    "status": "failed",
    "import": {
      "codes_total": 3,
      "codes_created": 0,
      "codes_failed": 3,
      "failure_details": [
        {
          "codes": [
            "SUMMER10",
            "summer10",
            "SUMMER11"
          ],
          "message": "Duplicate codes found"
        }
      ]
    },
    "created_at": "2026-09-07T09:12:04+00:00",
    "finished_at": "2026-09-07T09:12:05+00:00",
    "failure_reason": "No codes were created from the uploaded file"
  },
  "meta": {}
}
```

**SDK Code**

```python Failed
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task"

headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>"
}

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

print(response.json())
```

```javascript Failed
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task';
const options = {
  method: 'GET',
  headers: {Accept: 'application/json', 'X-Auth-Token': '<apiKey>'}
};

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

```go Failed
package main

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

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task"

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

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")

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

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

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

}
```

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

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")

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

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.get("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task', [
  'headers' => [
    'Accept' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp Failed
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Failed
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/promotions/latest-task")! 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()
```