Skip to main content

Get Promotion Jobs

GET 

/v2/promotions/:promotionID/jobs

Retrieves the list of jobs for a specific promotion.

In the response example, you can see the result.generated field, which indicates the number of codes generated during the job processing. Additionally, you may also see the optional result.deleted field, indicating the number of codes deleted during the job cancellation. The parameters and result objects are shown only when job_type is code_generate.

Filtering

The following operators and attributes are available when filtering on this endpoint.

AttributeTypeOperatorExample
job_typestringeqeq(job_type, code_export)
statusstringeqeq(status, complete)

Errors

If an error occurs during job processing, the response includes an optional error field. For example, when you GET promotion jobs, the following response shows the details within the error field if an error occurred during job processing.

{
"data": [
{
"type": "promotion_job",
"id": "84d86114-a92d-4c34-92f1-3e36ef6cabeb",
"promotion_id": "ad386702-e780-42c6-b190-0527ad768917",
"job_type": "code_generate",
"name": "job",
"parameters": {
"number_of_codes": 1000,
"consume_unit": "per_cart",
"max_uses_per_code": 1,
"code_length": 8,
"code_prefix": "promo-"
},
"status": "failed",
"error": "codes limit exceeded",
"meta": {
"timestamps": {
"created_at": "2023-12-06T13:52:29.587Z",
"updated_at": "2023-12-06T13:54:49.133Z"
}
}
}
],
"links": {
"current": "https://useast.api.elasticpath.com/v2/promotions/ad386702-e780-42c6-b190-0527ad768917/jobs?page[offset]=0&page[limit]=25",
"first": "https://useast.api.elasticpath.com/v2/promotions/ad386702-e780-42c6-b190-0527ad768917/jobs?page[offset]=0&page[limit]=25",
"last": "https://useast.api.elasticpath.com/v2/promotions/ad386702-e780-42c6-b190-0527ad768917/jobs?page[offset]=0&page[limit]=25",
"prev": "https://useast.api.elasticpath.com/v2/promotions/ad386702-e780-42c6-b190-0527ad768917/jobs?page[offset]=0&page[limit]=25",
"next": "https://useast.api.elasticpath.com/v2/promotions/ad386702-e780-42c6-b190-0527ad768917/jobs?page[offset]=0&page[limit]=25"
},
"meta": {
"page": {
"limit": 25,
"offset": 0,
"current": 1,
"total": 1
},
"results": {
"total": 1
}
}
}

Request

Path Parameters

    promotionID stringrequired

    The unique identifier of a promotion.

Query Parameters

    filter string

    Specifies the filter attributes.

Header Parameters

    Authorization Bearerrequired

    The Bearer token required to get access to the API.

Responses

Successful response

Schema
    data undefined[]
Loading...