Invoice Jobs

Creating a job that starts an invoice creation

post

Endpoint for creating a job that triggers invoice creation. There are two types of jobs: manual and automatic.

  1. Manual - takes orderIds from which the invoices should be created. The orderIds come from the request payload.

  2. Automatic - performs a query to find orders that are ready for invoice generation based on configured parameters. The query parameters are defined in configuration service.

Path parameters
tenantstring · min: 3 · max: 16Required

The tenant that the caller is acting upon.

Please note that this value is always lowercase.

Pattern: ^[a-z][a-z0-9]+$
Body
orderIdsstring[]Optional

A list of order IDs for which the invoices should be created.

jobTypestring · enumRequired

A job type determines if the orders are searched automatically based on parameters configured in configuration service or are manually provided in orderIds array.

Possible values:
Responses
201
Invoices job created. The job ID is returned.
application/json
post
POST /invoice/{tenant}/jobs/invoices HTTP/1.1
Host: api.emporix.io
Content-Type: application/json
Accept: */*
Content-Length: 67

{
  "orderIds": [
    "sampleOrderId1",
    "sampleOrderId2"
  ],
  "jobType": "MANUAL"
}
{
  "jobId": "sampleJobId"
}

Returning a job status and order details

get

Returns the job status and details about the processed orders.

Path parameters
tenantstring · min: 3 · max: 16Required

The tenant that the caller is acting upon.

Please note that this value is always lowercase.

Pattern: ^[a-z][a-z0-9]+$
jobIdstringRequired

Unique identifier of an invoice job.

Responses
200
Returned when job exists
application/json
get
GET /invoice/{tenant}/jobs/invoices/{jobId} HTTP/1.1
Host: api.emporix.io
Accept: */*
{
  "status": "IN_PROGRESS"
}

Was this helpful?