batches

List Batches associated with your Shipengine account

get/v1/batches

Request

  • Base URL
    https://api.shipengine.com
  • URL
    https://api.shipengine.com/v1/batches
  • Auth
    API key in header API-Key

Query parameters

status'open' | 'queued' | 'processing' | 'completed' | 'completed_with_errors' | 'archived' | 'notifying' | 'invalid'

The possible batch status values

pageinteger

Return a specific page of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page is returned.

page_sizeinteger

The number of results to return per response.

sort_dir'asc' | 'desc'

Controls the sort order of queries

ValueDescription
ascReturn results in ascending order
descReturn results in descending order

Controls the sort order of the query.

batch_numberstring

Batch Number

created_at_startstring date-time

Only return batches that were created on or after a specific date/time

created_at_endstring date-time

Only return batches that were created on or before a specific date/time

processed_at_startstring date-time

Only return batches that were processed on or after a specific date/time

processed_at_endstring date-time

Only return batches that were processed on or before a specific date/time

sort_by'ship_date' | 'processed_at' | 'created_at'

The possible batches sort by values

Response

The request was a success.

totalinteger required

The total number of batches the API call returned

pageinteger required

The page that is currently being read

pagesinteger required

The total number of batch pages the API call returned

Example response

{
  "batches": [
    {
      "batch_id": "se-28529731",
      "batch_notes": "Batch for morning shipment",
      "created_at": "2018-09-23T15:00:00.000Z",
      "processed_at": "2018-09-23T15:00:00.000Z",
      "errors": 2,
      "process_errors": [
        {
          "message": "Body of request cannot be null.",
          "carrier_id": "se-28529731",
          "carrier_code": "dhl_express",
          "field_name": "shipment.ship_to.phone_number"
        }
      ],
      "warnings": 1,
      "completed": 1,
      "forms": 3,
      "count": 2,
      "batch_shipments_url": {
        "href": "http://api.shipengine.com/v1/labels/se-28529731"
      },
      "batch_labels_url": {
        "href": "http://api.shipengine.com/v1/labels/se-28529731"
      },
      "batch_errors_url": {
        "href": "http://api.shipengine.com/v1/labels/se-28529731"
      },
      "label_download": {
        "href": "http://api.shipengine.com/v1/labels/se-28529731",
        "pdf": "http://api.shipengine.com/v1/labels/se-28529731",
        "png": "http://api.shipengine.com/v1/labels/se-28529731",
        "zpl": "http://api.shipengine.com/v1/labels/se-28529731"
      },
      "form_download": {
        "href": "http://api.shipengine.com/v1/labels/se-28529731"
      },
      "paperless_download": {
        "href": "http://api.shipengine.com/v1/labels/se-28529731"
      }
    }
  ],
  "total": 10,
  "page": 1,
  "pages": 10,
  "links": {
    "first": {
      "href": "http://api.shipengine.com/v1/labels/se-28529731"
    },
    "last": {
      "href": "http://api.shipengine.com/v1/labels/se-28529731"
    },
    "prev": {
      "href": "http://api.shipengine.com/v1/labels/se-28529731"
    },
    "next": {
      "href": "http://api.shipengine.com/v1/labels/se-28529731"
    }
  }
}

Changes

    • info

      added the new optional query request parameter created_at_end

    • info

      added the new optional query request parameter created_at_start

    • info

      added the new optional query request parameter processed_at_end

    • info

      added the new optional query request parameter processed_at_start

    • warning

      added the new A4 enum value to the //// response property for the response status

    • warning

      added the new A6 enum value to the //// response property for the response status