Rebrand 2023 Learn more 

  • Promotions/
    Promotion Codes/
    Jobs API/
    Create Promotion Codes Export Job

    Create Promotion Codes Export Job

    POST Create Promotion Codes Export Job

    https://useast.api.elasticpath.com/v2/promotions/:promotionID/jobs
    

    Use this endpoint to create an asynchronous job to export promotion codes.

    Parameters

    Path parameters

    NameRequiredTypeDescription
    promotionIDRequiredstringThe unique identifier of a promotion.

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token required to get access to the API.

    Body

    NameRequiredTypeDescription
    typeRequiredstringMust be set to promotion_job.
    job_typeRequiredstringSpecifies the type of task you want to run. For example, code_generate to generate codes or code_export to export codes.
    nameOptionalstringRepresents the name of the job. The maximum allowed value is 50.

    Request Example - Curl

    curl -X POST https://useast.api.elasticpath.com/v2/promotions/:promotionID/jobs \
         -H "Authorization: Bearer XXXX"
         -d $'{
           "data": {
             "type": "promotion_job",
             "job_type": "code_export",
             "name": "export codes job",
        }
    }
    

    Response Example

    201 Created

    {
        "data": {
            "type": "promotion_job",
            "id": "2bfd0a50-f915-4164-a65e-26e42fcfe2c8",
            "promotion_id": "19c08913-cc8c-47d8-a211-450c9e945970",
            "job_type": "code_export",
            "name": "export codes job",
            "status": "pending",
            "meta": {
                "timestamps": {
                    "created_at": "2023-08-01T23:27:51.343960201Z",
                    "updated_at": "2023-08-01T23:27:51.343960201Z"
                }
            }
        }
    }
    

    Was this helpful?

    Previous
    Create Promotion Codes Generation Job