Skip to main content

Cancel a Rule Promotion Job

POST 

https://useast.api.elasticpath.com/v2/rule-promotions/:uuid/jobs/:job-uuid/cancel

Cancels an asynchronous job for a rule promotion if its status is pending or processing.

  • Only jobs that have not yet completed can be canceled.
  • Once canceled, no further processing occurs, and partially completed results may be deleted.

Request

Path Parameters

    uuid stringrequired

    The unique identifier of the rule promotion.

    job-uuid stringrequired

    The unique identifier of the job to be canceled.

Responses

Successfully Canceled the Rule Promotion Job

Schema
    data object
    idstring

    A unique ID generated when a job is created.

    typestring

    Always promotion_job.

    Possible values: [promotion_job]

    rule_promotion_idstring

    A unique ID of a promotion.

    job_typestring

    The type of job you want to run. For example, code_generate to generate codes or code_export to export codes.

    namestring

    The name of the job. The maximum length allowed is 50 characters.

    parametersobject
    statusstring

    The status of the job. Please see Overview.

    errorstring

    The error encountered during job execution, if applicable.

    meta object
    timestamps object
    created_atstring<date-time>

    The creation date of the job.

    updated_atstring<date-time>

    The last updated date of the job.

    generate_result object

    Represents the result of a promotion job, including the number of generated and deleted promotion codes.

    • generated: Total number of successfully generated codes.
    • deleted: Number of codes that were deleted during job cancellation, if applicable.
    generatedinteger

    Number of successfully generated promotion codes.

    Example: 1000
    deletedinteger | nullnullable

    Number of codes deleted due to job cancellation.

    Example: 50

Authorization: http

name: bearerAuthtype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://useast.api.elasticpath.com/v2/rule-promotions/:uuid/jobs/:job-uuid/cancel");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://useast.api.elasticpath.com
Auth
Parameters
— pathrequired
— pathrequired
ResponseClear

Click the Send API Request button above and see the response here!