Create Job
POST/v2/jobs
Create a Job to export orders to a CSV file. Jobs automatically expire one week after creation. You must fetch the exported data before the jobs expire.
Request
- application/json
Body
required
data object
This represents the type of job. For example, order_export.
This represents the type of object being returned. Always job.
Responses
- 202
- 500
OK
- application/json
- Schema
- Example (from schema)
- default
Schema
- Array [
- PENDING - Commerce has received the request but is currently busy processing other requests.
- STARTED - Commerce has started processing the job.
- SUCCESS - The job has successfully completed.
- FAILED - The job has failed.
- ]
data Job[]
A unique ID generated when a job is created
This represents the type of object being returned. Always job.
This represents the type of job. For example, order_export.
The status of a job.
A message describing the error that caused a job to fail.
timestamps object
The date and time a job is created/updated.
The date and time a job is created.
The date and time a job is updated.
links object
Links are used to allow you to move between requests
Single entities use a self parameter with a link to that specific resource.
link object
A link to the exported data.
The publicly available URL for this CSV file that contains the exported data.
{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "job",
      "job_type": "order_export",
      "status": "failed",
      "error": "No results matched the supplied filter",
      "timestamps": {
        "created_at": "2018-10-04T11:08:49.156490335Z",
        "updated_at": "2018-10-04T11:08:49.162867081Z"
      },
      "links": {
        "self": "https://useast.api.elasticpath.com/v2/jobs/974c9db4-38da-4dbf-90c2-33eed5f3e77c"
      },
      "link": {
        "href": "string"
      }
    }
  ]
}
{
  "data": [
    {
      "id": "974c9db4-38da-4dbf-90c2-33eed5f3e77c",
      "type": "job",
      "job_type": "order_export",
      "status": "failed",
      "error": "No results matched the supplied filter",
      "link": {
        "href": ""
      },
      "links": {
        "self": "https://useast.api.elasticpath.com/v2/jobs/974c9db4-38da-4dbf-90c2-33eed5f3e77c"
      },
      "timestamps": {
        "created_at": "2018-10-04T11:08:49.156490335Z",
        "updated_at": "2018-10-04T11:08:49.162867081Z"
      }
    }
  ]
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (from schema)
- internal-server-error
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Internal request ID.
Additional supporting meta data for the error.
{
  "errors": [
    {
      "status": 500,
      "title": "Internal server error",
      "detail": "An internal error has occurred.",
      "request_id": "00000000-0000-0000-0000-000000000000",
      "meta": {
        "missing_ids": [
          "e7d50bd5-1833-43c0-9848-f9d325b08be8"
        ]
      }
    }
  ]
}
{
  "errors": [
    {
      "status": 500,
      "title": "Internal Server Error",
      "detail": "There was an internal server error, you can report with your request id.",
      "request_id": "635da56d-75a1-43cd-b696-7ab119756b3a"
    }
  ]
}