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, as Nash processes fields from different providers, please assume that any field in the response we provide may be null.

Body

application/json

Expected input for creating a batch job.

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

Response

200 - application/json

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

batch
object
required

Generic serializer for batches used in many endpoints.

createdAt
string
required
id
string
required
isActive
boolean
required
isBatch
boolean
required
jobConfigurations
object[]
required
portalUrl
string
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.