# List batches

List Batches associated with your Shipengine account

Endpoint: GET /v1/batches
Version: 1.1.202604070904
Security: api_key

## Query parameters:

  - `status` (string)
    The possible batch status values
    Enum: "open", "queued", "processing", "completed", "completed_with_errors", "archived", "notifying", "invalid"

  - `page` (integer)
    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.
    Example: 2

  - `page_size` (integer)
    The number of results to return per response.
    Example: 50

  - `sort_dir` (string)
    Controls the sort order of the query.
    Enum: "asc", "desc"

  - `batch_number` (string)
    Batch Number

  - `created_at_start` (string)
    Only return batches that were created on or after a specific date/time
    Example: "2019-03-12T19:24:13.657Z"

  - `created_at_end` (string)
    Only return batches that were created on or before a specific date/time
    Example: "2019-03-12T19:24:13.657Z"

  - `processed_at_start` (string)
    Only return batches that were processed on or after a specific date/time
    Example: "2019-03-12T19:24:13.657Z"

  - `processed_at_end` (string)
    Only return batches that were processed on or before a specific date/time
    Example: "2019-03-12T19:24:13.657Z"

  - `sort_by` (string)
    The possible batches sort by values
    Enum: "ship_date", "processed_at", "created_at"

## Response 200 fields (application/json):

  - `batches` (array, required)
    Batch List

  - `batches.label_layout` (string, required)
    label layout
    Enum: "4x6", "letter", "A4", "A6"

  - `batches.label_format` (string, required)
    The possible file formats in which shipping labels can be downloaded. We recommend pdf format because it is supported by all carriers, whereas some carriers do not support the png or zpl formats.

|Label Format  | Supported Carriers
|--------------|-----------------------------------
|pdf         | All carriers
|png         | fedex  stamps_com  ups  usps
|zpl         | access_worldwide  apc  asendia  dhl_global_mail  dhl_express  dhl_express_australia  dhl_express_canada  dhl_express_worldwide  dhl_express_uk  dpd  endicia  fedex  fedex_uk  firstmile  imex  newgistics  ontrac  rr_donnelley  stamps_com  ups  usps
    Enum: "pdf", "png", "zpl"

  - `batches.batch_id` (string, required)
    A string that uniquely identifies the batch
    Example: "se-28529731"

  - `batches.batch_number` (string, required)
    The batch number.

  - `batches.external_batch_id` (string,null, required)
    A string that uniquely identifies the external batch

  - `batches.batch_notes` (string,null, required)
    Custom notes you can add for each created batch
    Example: "Batch for morning shipment"

  - `batches.assigned_user` (string,null)
    The ID of the user assigned to the batch, or null if no user is assigned.
    Example: "a2df9fa5-b7ee-467f-be4e-9c660542c187"

  - `batches.created_at` (string, required)
    The date and time the batch was created in ShipEngine
    Example: "2018-09-23T15:00:00.000Z"

  - `batches.processed_at` (string,null, required)
    The date and time the batch was processed in ShipEngine
    Example: "2018-09-23T15:00:00.000Z"

  - `batches.errors` (integer, required)
    The number of errors that occurred while generating the batch
    Example: 2

  - `batches.process_errors` (array, required)
    The errors associated with the failed API call

  - `batches.process_errors.error_source` (string, required)
    The source of the error, as indicated by the name this informs us if the API call failed because of the
carrier, the order source, or the ShipEngine API itself.
    Enum: "carrier", "order_source", "shipengine"

  - `batches.process_errors.error_type` (string, required)
    The type of error
    Enum: "account_status", "business_rules", "validation", "security", "system", "integrations"

  - `batches.process_errors.error_code` (string, required)
    The error code specified for the failed API Call
    Enum: "auto_fund_not_supported", "batch_cannot_be_modified", "carrier_conflict", "carrier_disconnected", "carrier_not_connected", "carrier_not_supported", "confirmation_not_supported", "default_warehouse_cannot_be_deleted", "field_conflict", "field_value_required", "forbidden", "identifier_conflict", "identifiers_must_match", "insufficient_funds", "invalid_address", "invalid_billing_plan", "invalid_field_value", "invalid_identifier", "invalid_status", "invalid_string_length", "label_images_not_supported", "meter_failure", "order_source_not_active", "rate_limit_exceeded", "refresh_not_supported", "request_body_required", "return_label_not_supported", "settings_not_supported", "subscription_inactive", "terms_not_accepted", "tracking_not_supported", "trial_expired", "unauthorized", "unknown", "unspecified", "verification_failure", "warehouse_conflict", "webhook_event_type_conflict", "customs_items_required", "incompatible_paired_labels", "invalid_charge_event", "invalid_object", "no_rates_returned", "file_not_found", "shipping_rule_not_found", "service_not_determined", "no_rates_returned", "funding_source_registration_in_progress", "insurance_failure", "funding_source_missing_configuration", "funding_source_error", "freight_connection_inactive", "freight_provider_id_required", "freight_provider_already_connected", "freight_shipment_not_found", "freight_tracking_not_available", "freight_tracking_not_found", "freight_shipment_not_batchable"

  - `batches.process_errors.message` (string, required)
    An error message associated with the failed API call
    Example: "Body of request cannot be null."

  - `batches.process_errors.carrier_id` (string)
    A string that uniquely identifies the carrier that generated the error.
    Example: "se-28529731"

  - `batches.process_errors.carrier_code` (string)
    The name of the shipping carrier that generated the error, such as fedex, dhl_express, stamps_com, etc.
    Example: "dhl_express"

  - `batches.process_errors.field_name` (string)
    The name of the field that caused the error
    Example: "shipment.ship_to.phone_number"

  - `batches.warnings` (integer, required)
    The number of warnings that occurred while generating the batch
    Example: 1

  - `batches.completed` (integer, required)
    The number of labels generated in the batch
    Example: 1

  - `batches.forms` (integer, required)
    The number of forms for customs that are available for download
    Example: 3

  - `batches.count` (integer, required)
    The total of errors, warnings, and completed properties
    Example: 2

  - `batches.batch_shipments_url` (object, required)
    The batch shipments endpoint

  - `batches.batch_shipments_url.href` (string)
    The URL of the linked resource, if any
    Example: "https://example.com/resource"

  - `batches.batch_shipments_url.type` (string)
    The type of resource, or the type of relationship to the parent resource

  - `batches.batch_labels_url` (object, required)
    Link to batch labels query

  - `batches.batch_labels_url.href` (string)
    The URL of the linked resource, if any
    Example: "https://example.com/resource"

  - `batches.batch_labels_url.type` (string)
    The type of resource, or the type of relationship to the parent resource

  - `batches.batch_errors_url` (object, required)
    Link to batch errors endpoint

  - `batches.batch_errors_url.href` (string)
    The URL of the linked resource, if any
    Example: "https://example.com/resource"

  - `batches.batch_errors_url.type` (string)
    The type of resource, or the type of relationship to the parent resource

  - `batches.label_download` (object, required)
    The label download for the batch

  - `batches.label_download.href` (string)
    The URL of the linked resource, if any
    Example: "https://example.com/resource"

  - `batches.label_download.pdf` (string)
    The URL for the pdf generated label
    Example: "https://example.com/resource"

  - `batches.label_download.png` (string)
    The URL for the png generated label
    Example: "https://example.com/resource"

  - `batches.label_download.zpl` (string)
    The URL for the zpl generated label
    Example: "https://example.com/resource"

  - `batches.form_download` (object, required)
    The form download for any customs that are needed

  - `batches.form_download.href` (string)
    The URL of the linked resource, if any
    Example: "https://example.com/resource"

  - `batches.form_download.type` (string)
    The type of resource, or the type of relationship to the parent resource

  - `batches.paperless_download` (object, required)
    The paperless details which may contain elements like href, instructions and handoff_code.

  - `batches.paperless_download.href` (string)
    The URL of the linked resource, if any
    Example: "https://example.com/resource"

  - `batches.paperless_download.instructions` (string,null)
    The instructions for the paperless download.

  - `batches.paperless_download.handoff_code` (string,null)
    The handoff code for the paperless download.

  - `batches.status` (string, required)
    The possible batch status values
    Enum: "open", "queued", "processing", "completed", "completed_with_errors", "archived", "notifying", "invalid"

  - `total` (integer, required)
    The total number of batches the API call returned
    Example: 10

  - `page` (integer, required)
    The page that is currently being read
    Example: 1

  - `pages` (integer, required)
    The total number of batch pages the API call returned
    Example: 10

  - `links` (object, required)
    Helpful links to other pages of results

  - `links.first` (object, required)
    The link to the first page of results.  This object will _always_ have an href field. If there are no results, then the first page will contain an empty array of items.

  - `links.first.href` (string, required)
    The URL of the linked resource, if any
    Example: "https://example.com/resource"

  - `links.first.type` (string)
    The type of resource, or the type of relationship to the parent resource

  - `links.last` (object, required)
    The link to the final page of results.  This object will _always_ have an href field. If there are no results, then the final page will contain an empty array of items.

  - `links.last.href` (string, required)
    The URL of the linked resource, if any
    Example: "https://example.com/resource"

  - `links.last.type` (string)
    The type of resource, or the type of relationship to the parent resource

  - `links.prev` (object, required)
    The link to the previous page of results.  The href field will only be set when the page is 2 or greater.

  - `links.prev.href` (string)
    The URL of the linked resource, if any
    Example: "https://example.com/resource"

  - `links.prev.type` (string)
    The type of resource, or the type of relationship to the parent resource

  - `links.next` (object, required)
    The link to the next page of results.  The href field will only be set when the page is less than pages.

  - `links.next.href` (string)
    The URL of the linked resource, if any
    Example: "https://example.com/resource"

  - `links.next.type` (string)
    The type of resource, or the type of relationship to the parent resource

## Response 404 fields (application/json):

  - `request_id` (string, required)
    A UUID that uniquely identifies the request id.
This can be given to the support team to help debug non-trivial issues that may occur
    Example: "aa3d8e8e-462b-4476-9618-72db7f7b7009"

  - `errors` (array, required)
    The errors associated with the failed API call

  - `errors.error_source` (string, required)
    The source of the error, as indicated by the name this informs us if the API call failed because of the
carrier, the order source, or the ShipEngine API itself.
    Enum: "carrier", "order_source", "shipengine"

  - `errors.error_type` (string, required)
    The type of error
    Enum: "account_status", "business_rules", "validation", "security", "system", "integrations"

  - `errors.error_code` (string, required)
    The error code specified for the failed API Call
    Enum: "auto_fund_not_supported", "batch_cannot_be_modified", "carrier_conflict", "carrier_disconnected", "carrier_not_connected", "carrier_not_supported", "confirmation_not_supported", "default_warehouse_cannot_be_deleted", "field_conflict", "field_value_required", "forbidden", "identifier_conflict", "identifiers_must_match", "insufficient_funds", "invalid_address", "invalid_billing_plan", "invalid_field_value", "invalid_identifier", "invalid_status", "invalid_string_length", "label_images_not_supported", "meter_failure", "order_source_not_active", "rate_limit_exceeded", "refresh_not_supported", "request_body_required", "return_label_not_supported", "settings_not_supported", "subscription_inactive", "terms_not_accepted", "tracking_not_supported", "trial_expired", "unauthorized", "unknown", "unspecified", "verification_failure", "warehouse_conflict", "webhook_event_type_conflict", "customs_items_required", "incompatible_paired_labels", "invalid_charge_event", "invalid_object", "no_rates_returned", "file_not_found", "shipping_rule_not_found", "service_not_determined", "no_rates_returned", "funding_source_registration_in_progress", "insurance_failure", "funding_source_missing_configuration", "funding_source_error", "freight_connection_inactive", "freight_provider_id_required", "freight_provider_already_connected", "freight_shipment_not_found", "freight_tracking_not_available", "freight_tracking_not_found", "freight_shipment_not_batchable"

  - `errors.message` (string, required)
    An error message associated with the failed API call
    Example: "Body of request cannot be null."

  - `errors.carrier_id` (string)
    A string that uniquely identifies the carrier that generated the error.
    Example: "se-28529731"

  - `errors.carrier_code` (string)
    The name of the shipping carrier that generated the error, such as fedex, dhl_express, stamps_com, etc.
    Example: "dhl_express"

  - `errors.field_name` (string)
    The name of the field that caused the error
    Example: "shipment.ship_to.phone_number"


