Skip to navigation

Get Latest Promotion 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. 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.

Authentication

X-Auth-Tokenstring

OAuth scopes

UI NamePermissionParameter
Marketingmodifystore_v2_marketing
Marketingread-onlystore_v2_marketing_read_only

Authentication header

HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see API Accounts and OAuth Scopes.

Further reading

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see API Accounts and OAuth Scopes.

For a list of API status codes, see API Status Codes.

Path parameters

store_hashstringRequired
Permanent ID of the BigCommerce store.

Headers

AcceptstringRequiredDefaults to application/json

The MIME type of the response body.

Response

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

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

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

Errors

500
Internal Server Error