Skip to main content

Create Job

POST 

https://api.moltin.com/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

Bodyrequired

    data object
    filterstring
    Example: gt(created_at,2018-09-01):lt(created_at,2018-10-01):eq(payment,refunded)
    job_typestring

    This represents the type of job. For example, order_export.

    Example: order_export
    typestring

    This represents the type of object being returned. Always job.

    Example: job

Responses

OK

Schema
    data Job[]
  • Array [
  • iduuid

    A unique ID generated when a job is created

    Example: 00000000-0000-0000-0000-000000000000
    typestring

    This represents the type of object being returned. Always job.

    Example: job
    job_typestring

    This represents the type of job. For example, order_export.

    Example: order_export
    statusstring

    The status of a job.

    • 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.
    Example: failed
    errorstring

    A message describing the error that caused a job to fail.

    Example: No results matched the supplied filter
    timestamps object

    The date and time a job is created/updated.

    created_atstring

    The date and time a job is created.

    Example: 2018-10-04T11:08:49.156490335Z
    updated_atstring

    The date and time a job is updated.

    Example: 2018-10-04T11:08:49.162867081Z
    links object

    Links are used to allow you to move between requests

    selfstring

    Single entities use a self parameter with a link to that specific resource.

    Example: https://useast.api.elasticpath.com/v2/jobs/974c9db4-38da-4dbf-90c2-33eed5f3e77c
    link object

    A link to the exported data.

    hrefstring

    The publicly available URL for this CSV file that contains the exported data.

  • ]

Authorization: http

name: bearerAuthtype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.moltin.com/v2/jobs");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"filter\": \"gt(created_at,2018-09-01):lt(created_at,2018-10-01):eq(payment,refunded)\",\n \"job_type\": \"order_export\",\n \"type\": \"job\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://api.moltin.com
Auth
Body required
{
  "data": {
    "filter": "gt(created_at,2018-09-01):lt(created_at,2018-10-01):eq(payment,refunded)",
    "job_type": "order_export",
    "type": "job"
  }
}
ResponseClear

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

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.