POST
/
v1
/
batch_job

What’s a batch job?

A batch job is a group of packages that are delivered by same courier (and thus same provider). A batch job has N packages where N > 1, in contrast with single jobs (non-batch) which have a single package.

Batch types

  • pattern 1: single pickup, multiple dropoffs = same pickup address, name and phone-number for all packages
  • pattern 2: multiple pickups, single dropoff = same dropoff address, name and phone-number for all packages
  • pattern 3: multiple pickups, multiple dropoff
    • multiple pickups then multiple dropoffs. note: there’s no pickup after a dropoff (interleaving)

The response is similar to Create Job, but with the addition of two new fields: isBatch, and batch field:

batch field:

  • batch.id: unique id for this batch
  • batch.type: one of these values:
    • SINGLE_PICKUP_MULTIPLE_DROPOFFS
    • MULTIPLE_PICKUPS_SINGLE_DROPOFF
    • MULTIPLE_PICKUPS_MULTIPLE_DROPOFFS
  • batch.objectSequence: list of jobConfigurations (which container package information) in order:
  • batch.stopTypes: list of stop representing actions sequence: PICKUP or DROPOFF
  • batch.quotes, batch.winnerQuote, batch.failedQuotes: same as task.quotes, task.winnerQuote, task.failedQuotes from non-batch jobs
{
	"batch": {
		"id": "bth_...",
		"type": "MULTIPLE_PICKUPS_MULTIPLE_DROPOFFS",
		"objectSequence": [],
		"stopTypes": [
			"PICKUP",
			"DROPOFF",
			"DROPOFF"
		],
		"providerId": "FleetSimulatorFast",
		"winnerQuote": {
			"id": "qot_..",
			"providerId": "FleetSimulatorFast",
			"providerName": "FleetSimulator (4TestRunner)"
		},
		"quotes": [],
		"failedQuotes": []
	},
        ...
}

For this and all other endpoints, if you are parsing the response we provide, please assume that any field can be null.

Body

application/json

Expected input for creating a batch job.

packages
object[]
required
jobMetadata
object | null
optionsGroupId
string | null
externalIdentifier
string | null
inputDatetimesLocalizedToPickupTz
boolean
default: false

Response

200 - application/json

The format for a returned batch job used in many endpoints.

id
string
required
createdAt
string
required
portalUrl
string
required
isActive
boolean
required
isBatch
boolean
required
batch
object
required

Generic serializer for batches used in many endpoints.

jobConfigurations
object[]
required
externalIdentifier
string | null
jobMetadata
object | null
optionsGroup
object | null

Generic serializer for options groups used in many endpoints.

shortReferenceCode
string | null

Short, non-unique human-readable reference code for the job.