# Create a batch

Products
            Plans
          
        
        
          
            
              
              Formerly ShipEngine
            
            
              Free
              Advanced
              Enterprise
            
          
          
            
              
            
            
              Free
              Starter
              Standard
              Premium
            
          
        
      
      
        
          Learn about products and plans
          
        
      
    

Create a batch containing multiple labels.

Endpoint: POST /v2/batches
Version: 2.0.0
Security: api_keys

## Response 200 fields (application/json):

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

  - `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"

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

  - `batch_number` (string, required)
    The batch number.
    Example: "123456"

  - `external_batch_id` (string,null, required)
    A string that uniquely identifies the external batch
    Example: "12323aaaar"

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

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

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

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

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

  - `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 ShipStation API itself.
    Enum: "carrier", "order_source", "ShipStation"

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

  - `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"

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

  - `process_errors.field_name` (string)
    The name of the field that caused the error (only present for validation errors)
    Example: "inventory_warehouse_id"

  - `process_errors.field_value` (string)
    The invalid value that was provided for the field (only present for validation errors)
    Example: "invalid-id"

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

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

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

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

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

  - `batch_shipments_url.href` (string)
    The URL of the linked resource, if any
    Example: "http://api.shipstation.com/v2/labels/se-28529731"

  - `batch_shipments_url.type` (string)
    The type of resource, or the type of relationship to the parent resource
    Example: "child"

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

  - `batch_labels_url.href` (string)
    The URL of the linked resource, if any
    Example: "http://api.shipstation.com/v2/labels/se-28529731"

  - `batch_labels_url.type` (string)
    The type of resource, or the type of relationship to the parent resource
    Example: "child"

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

  - `batch_errors_url.href` (string)
    The URL of the linked resource, if any
    Example: "http://api.shipstation.com/v2/labels/se-28529731"

  - `batch_errors_url.type` (string)
    The type of resource, or the type of relationship to the parent resource
    Example: "child"

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

  - `label_download.href` (string)
    The URL of the linked resource, if any
    Example: "http://api.shipstation.com/v2/labels/se-28529731"

  - `label_download.pdf` (string)
    The URL for the pdf generated label
    Example: "http://api.shipstation.com/v2/labels/se-28529731"

  - `label_download.png` (string)
    The URL for the png generated label
    Example: "http://api.shipstation.com/v2/labels/se-28529731"

  - `label_download.zpl` (string)
    The URL for the zpl generated label
    Example: "http://api.shipstation.com/v2/labels/se-28529731"

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

  - `form_download.href` (string)
    The URL of the linked resource, if any
    Example: "http://api.shipstation.com/v2/labels/se-28529731"

  - `form_download.type` (string)
    The type of resource, or the type of relationship to the parent resource
    Example: "child"

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

  - `paperless_download.href` (string)
    The URL of the linked resource, if any
    Example: "http://api.shipstation.com/v2/labels/se-28529731"

  - `paperless_download.instructions` (string,null)
    The instructions for the paperless download.
    Example: "any instructions"

  - `paperless_download.handoff_code` (string,null)
    The handoff code for the paperless download.
    Example: "122334"

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

## Response 400 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 ShipStation API itself.
    Enum: "carrier", "order_source", "ShipStation"

  - `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"

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

  - `errors.field_name` (string)
    The name of the field that caused the error (only present for validation errors)
    Example: "inventory_warehouse_id"

  - `errors.field_value` (string)
    The invalid value that was provided for the field (only present for validation errors)
    Example: "invalid-id"


