# SPS Commerce

> Trade EDI documents with your retailers through SPS Commerce: read new purchase orders, send acknowledgements, ship notices and invoices, and make retailer-compliant shipping labels and packing slips.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/sps-commerce

## Actions

### Delete file

Delete a file from your SPS Commerce file space, such as an order your system has finished processing, so it isn't read again.

**Inputs**

- File path (`path`, text, required): The file's full path, such as /out/PO/PO123456.xml, from 'List files' or a trigger. Paths are case sensitive.

**Outputs**

- `deleted` (true/false): True once SPS has deleted it
- `path` (text): The deleted file's path

**Example output**

```json
{
  "deleted": true,
  "path": "/out/PO/PO584615-1-v7.7-BulkImport.xml"
}
```

### Get file

Read one file from your SPS Commerce file space, such as a purchase order, as text, and as data when it is JSON. It can also be saved as a file for a later step.

**Inputs**

- File path (`path`, text, required): The file's full path, such as /out/PO/PO123456.xml, from 'List files' or a trigger. Paths are case sensitive.
- Save as a file (`save_as_file`, true/false): Turn on to also save it as a file a later step can attach.

**Outputs**

- `content` (text): The file's text, or empty if it isn't text
- `content_type` (text): The type SPS gave the file
- `data` (object): The file read as JSON, when it is JSON; otherwise empty
- `documents` (list): The saved files, to attach in a later step
- `format` (text): json, xml, edi, text or binary
- `name` (text): The file's name
- `path` (text): The file's path
- `size_bytes` (number): The file's size in bytes

**Example output**

```json
{
  "content": "{\"Header\": {\"OrderHeader\": {\"PurchaseOrderNumber\": \"584615\"}}}",
  "content_type": "application/octet-stream",
  "data": {
    "Header": {
      "OrderHeader": {
        "PurchaseOrderNumber": "584615"
      }
    }
  },
  "documents": [],
  "format": "json",
  "name": "PO584615-1-v7.7-BulkImport.json",
  "path": "/out/PO/PO584615-1-v7.7-BulkImport.json",
  "size_bytes": 62
}
```

### Get label batch

Check a label batch: In Progress, Completed or Failed, with what was wrong with the data. Once it has completed, its PDF or ZPL is saved as a file.

**Inputs**

- Batch ID (`batch_id`, text, required): The batch's id, from 'Start label batch'.
- Save the result (`save_result`, true/false): On by default: once it has completed, save its labels as a file. Turn off to get only the link.

**Outputs**

- `batch_id` (text): The batch's id
- `completed` (true/false): True once the labels are ready
- `documents` (list): The saved files, to attach in a later step
- `failed` (true/false): True if the batch failed
- `failure_description` (text): Why it failed, if it did
- `response_type` (text): The kind of result, PDF or ZPL
- `result_url` (text): A short-lived link to the result, once completed
- `status` (text): In Progress, Completed or Failed
- `validation_errors` (list): What was wrong with the data, if anything

**Example output**

```json
{
  "batch_id": "8785d17f-b65e-44fb-a904-be962de8f123",
  "completed": true,
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_0123456789abcdef",
      "filename": "sps-label-batch.pdf",
      "size_bytes": 48211,
      "url": "/actions/core/serve-document/doc_0123456789abcdef?teamId=64b0000000000000000000aa"
    }
  ],
  "failed": false,
  "failure_description": "",
  "response_type": "PDF",
  "result_url": "https://cdn.spscommerce.com/0d14a7f6.pdf",
  "status": "Completed",
  "validation_errors": []
}
```

### Get packing slip sample data

Get sample data for a retailer's packing slip, a starting point for the data you render it with.

**Inputs**

- Packing slip template (`packing_slip_id`, text, required): The retailer's packing slip template, from 'List packing slip templates'.

**Outputs**

- `packing_slip_id` (text): The template's id
- `sample` (object): Sample data, with the Header and Pack the slip reads

**Example output**

```json
{
  "packing_slip_id": "1ff23456",
  "sample": {
    "Header": {
      "Address": [
        {
          "Address1": "123 Main Street",
          "AddressName": "William Bill To",
          "AddressTypeCode": "SF",
          "City": "Minneapolis",
          "Country": "USA",
          "PostalCode": "55402",
          "State": "MN"
        }
      ],
      "BillOfLadingNumber": "BOL-Number"
    },
    "Pack": [
      {
        "Item": [
          {
            "UPCCaseCode": "676123123123"
          }
        ],
        "ShippingSerialID": "00001234560014762261"
      }
    ]
  }
}
```

### Get packing slip schema

Get the JSON schema of the data a retailer's packing slip needs, to check what to send before rendering.

**Inputs**

- Packing slip template (`packing_slip_id`, text, required): The retailer's packing slip template, from 'List packing slip templates'.
- Use upcoming requirements (`pending_change`, true/false): Turn on to use the retailer's upcoming packing slip requirements instead of the current ones.

**Outputs**

- `packing_slip_id` (text): The template's id
- `schema` (object): The JSON schema (draft 7) of the packing slip's data

**Example output**

```json
{
  "packing_slip_id": "1ff23456",
  "schema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
      "Header": {
        "type": "object"
      },
      "Pack": {
        "type": "array"
      }
    },
    "type": "object"
  }
}
```

### Get packing slip template

Get one retailer packing slip template with its owner, versions and whether you may print it.

**Inputs**

- Packing slip template (`packing_slip_id`, text, required): The retailer's packing slip template, from 'List packing slip templates'.

**Outputs**

- `packing_slip` (object): A retailer's template

**Example output**

```json
{
  "packing_slip": {
    "aliases": [
      {
        "alias": "",
        "version": "1.00"
      }
    ],
    "canRender": true,
    "createdAt": "Wed, 19 Sep 2018 19:31:35 GMT",
    "description": "Packing Slip details",
    "format": "xsl",
    "id": "1ff23456",
    "name": "SPS Commerce Packing Slip - 1",
    "outputFormat": "",
    "ownerID": "123451927301720471274",
    "ownerName": "SPS Commerce",
    "type": "packing-slip",
    "versions": [
      {
        "createdAt": "2018-09-19 19:31:35.156163",
        "tags": [],
        "version": "1.00",
        "versionNotes": "Initial Version"
      }
    ]
  }
}
```

### Get shipping label sample data

Get sample data for a retailer's shipping label, a starting point for the data you render it with.

**Inputs**

- Shipping label template (`label_id`, text, required): The retailer's label template, from 'List shipping label templates'.

**Outputs**

- `label_id` (text): The template's id
- `sample` (object): Sample data, with the Header and Pack the label reads

**Example output**

```json
{
  "label_id": "1234567",
  "sample": {
    "Header": {
      "Address": [
        {
          "Address1": "123 Main Street",
          "AddressName": "William Bill To",
          "AddressTypeCode": "SF",
          "City": "Minneapolis",
          "Country": "USA",
          "PostalCode": "55402",
          "State": "MN"
        }
      ],
      "BillOfLadingNumber": "BOL-Number"
    },
    "Pack": [
      {
        "Item": [
          {
            "UPCCaseCode": "676123123123"
          }
        ],
        "ShippingSerialID": "00001234560014762261"
      }
    ]
  }
}
```

### Get shipping label schema

Get the JSON schema of the data a retailer's shipping label needs, to check what to send before rendering.

**Inputs**

- Shipping label template (`label_id`, text, required): The retailer's label template, from 'List shipping label templates'.
- Use upcoming requirements (`pending_change`, true/false): Turn on to use the retailer's upcoming label requirements instead of the current ones.

**Outputs**

- `label_id` (text): The template's id
- `schema` (object): The JSON schema (draft 7) of the label's data

**Example output**

```json
{
  "label_id": "1234567",
  "schema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
      "Header": {
        "type": "object"
      },
      "Pack": {
        "type": "array"
      }
    },
    "type": "object"
  }
}
```

### Get shipping label template

Get one retailer shipping label template with its owner, versions and whether you may print it.

**Inputs**

- Shipping label template (`label_id`, text, required): The retailer's label template, from 'List shipping label templates'.

**Outputs**

- `label` (object): A retailer's template

**Example output**

```json
{
  "label": {
    "aliases": [
      {
        "alias": "",
        "version": "1.00"
      }
    ],
    "canRender": true,
    "createdAt": "Wed, 19 Sep 2018 19:31:35 GMT",
    "description": "Shipping Label details",
    "format": "xsl",
    "id": "1234567",
    "name": "SPS Commerce Shipping Label - 1",
    "outputFormat": "",
    "ownerID": "123451927301720471274",
    "ownerName": "SPS Commerce",
    "type": "label",
    "versions": [
      {
        "createdAt": "2018-09-19 19:31:35.156163",
        "tags": [],
        "version": "1.00",
        "versionNotes": "Initial Version"
      }
    ]
  }
}
```

### List file history

List SPS Commerce's processing reports for the files you sent and received, with each file's status log (uploaded, downloaded, deleted). Reports can take 5 minutes to appear.

**Inputs**

- From (`after`, date and time): Only reports from this time on.
- Until (`until`, date and time): Only reports up to this time.
- Limit (`limit`, number): How many reports to return. SPS's default is 100. From 1 to 1000.
- Skip (`offset`, number): How many reports to skip. Use the next_offset an earlier run gave to read on. At least 0.

**Outputs**

- `count` (number): How many reports this page holds
- `next_offset` (number): The offset for the next page, or 0 at the end
- `reports` (list): The processing reports
- `total_count` (number): How many reports match in all

**Example output**

```json
{
  "count": 1,
  "next_offset": 0,
  "reports": [
    {
      "direction": "out",
      "id": "3f319141-a227-4fac-81f1-ace6f968560d",
      "latest_message": "Deleted by the client.",
      "latest_status": "deleted",
      "latest_status_at": "2026-05-05T19:46:31.259Z",
      "path": "out/CA584615-1-v7.7-BulkImport.xml",
      "status_log": [
        {
          "message": "",
          "status": "uploaded",
          "timestamp": "2026-05-05T19:44:48.626Z"
        },
        {
          "message": "Deleted by the client.",
          "status": "deleted",
          "timestamp": "2026-05-05T19:46:31.259Z"
        }
      ]
    }
  ],
  "total_count": 1
}
```

### List files

List the files and folders in one folder of your SPS Commerce file space, such as new purchase orders in out/PO/. Gets up to 1,000 at a time; to see more, run it again with the cursor it gives.

**Inputs**

- Folder (`folder`, text, required): The folder to list. Documents from trading partners arrive in out (production) and testout (test).
- Document type (`document_type`, text): Only files of this type, by the code their names start with. One of: `PO` (Purchase orders (PO)), `PC` (Purchase order changes (PC)), `PR` (Purchase order acknowledgements (PR)), `CA` (Order change acknowledgements (CA)), `SH` (Shipments and advance ship notices (SH)), `IN` (Invoices (IN)), `IB` (Inventory and item registries (IB)), `PS` (Planning schedules (PS)), `PD` (Product activity (PD)), `OW` (Warehouse shipping orders (OW)), and 3 more.
- Name starts with (`name_prefix`, text): Only files and folders whose names start with this (case sensitive).
- Limit (`limit`, number): How many to return, 1 to 1,000. Defaults to 1,000. From 1 to 1000.
- Cursor (`cursor`, text): The next_cursor an earlier run gave, to read on.

**Outputs**

- `count` (number): How many entries this page holds
- `entries` (list): The files and folders in it
- `file_count` (number): How many of them are files
- `folder` (text): The folder listed
- `next_cursor` (text): The cursor for the next page, or empty at the end

**Example output**

```json
{
  "count": 2,
  "entries": [
    {
      "name": "PO",
      "path": "/out/PO/",
      "type": "directory",
      "url": "https://api.spscommerce.com/transactions/v5/data/out/PO/"
    },
    {
      "name": "PO584615-1-v7.7-BulkImport.xml",
      "path": "/out/PO/PO584615-1-v7.7-BulkImport.xml",
      "type": "file",
      "url": "https://api.spscommerce.com/transactions/v5/data/out/PO/PO584615-1-v7.7-BulkImport.xml"
    }
  ],
  "file_count": 1,
  "folder": "/out/",
  "next_cursor": ""
}
```

### List packing slip templates

List the retailer packing slip templates you can use, and whether you may print each or only preview it.

**Inputs**

- Template name (`name`, text): Only templates whose name contains this, such as a retailer's name.
- Owner (`owner_name`, text): Only templates whose owner's name contains this.
- Match names exactly (`exact_match`, true/false): Turn on to match the template name and owner exactly rather than by part.
- Newest first (`newest`, true/false): Turn on to list the newest templates first.
- Limit (`limit`, number): How many templates to return, up to 1,000. From 1 to 1000.
- Skip (`offset`, number): How many templates to skip, to read on past an earlier page. At least 0.

**Outputs**

- `count` (number): How many were returned
- `packing_slips` (list): The packing slip templates

**Example output**

```json
{
  "count": 1,
  "packing_slips": [
    {
      "canRender": true,
      "description": "Packing Slip details",
      "id": "1ff23456",
      "name": "SPS Commerce Packing Slip - 1",
      "ownerID": "123451927301720471274",
      "ownerName": "SPS Commerce",
      "type": "packing-slip"
    }
  ]
}
```

### List shipping label templates

List the retailer shipping label templates (GS1-128 and UCC-128 carton labels) you can use, and whether you may print each or only preview it.

**Inputs**

- Template name (`name`, text): Only templates whose name contains this, such as a retailer's name.
- Owner (`owner_name`, text): Only templates whose owner's name contains this.
- Match names exactly (`exact_match`, true/false): Turn on to match the template name and owner exactly rather than by part.
- Printable (`can_render`, text): Only templates you can print, or only those you can just preview. One of: `true` (Ones you can print), `false` (Ones you can only preview).
- Newest first (`newest`, true/false): Turn on to list the newest templates first.
- Limit (`limit`, number): How many templates to return, up to 1,000. From 1 to 1000.
- Skip (`offset`, number): How many templates to skip, to read on past an earlier page. At least 0.

**Outputs**

- `count` (number): How many were returned
- `labels` (list): The label templates

**Example output**

```json
{
  "count": 1,
  "labels": [
    {
      "canRender": true,
      "description": "Shipping Label details",
      "id": "1234567",
      "name": "SPS Commerce Shipping Label - 1",
      "ownerID": "123451927301720471274",
      "ownerName": "SPS Commerce",
      "type": "label"
    }
  ]
}
```

### Make packing slip PDF

Make a retailer-compliant packing slip as a PDF from your shipment's data. Saved as a file to print or attach.

**Inputs**

- Packing slip template (`packing_slip_id`, text, required): The retailer's packing slip template, from 'List packing slip templates'.
- Data (`data`, object, required): The packing slip's data as JSON: a Header and Pack objects in SPS's layout. 'Get packing slip sample data' gives an example, and 'Get file' can read it from an order.
- Use upcoming requirements (`pending_change`, true/false): Turn on to use the retailer's upcoming packing slip requirements instead of the current ones.

**Outputs**

- `content_type` (text): The saved file's type, such as application/pdf
- `document_ref` (text): The saved file's reference, to attach it in a later step
- `documents` (list): The saved files, to attach in a later step
- `filename` (text): The saved file's name
- `packing_slip_id` (text): The packing slip template's id
- `size_bytes` (number): The saved file's size in bytes
- `url` (text): Where to open the saved file in Lodol

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_ref": "doc_0123456789abcdef",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_0123456789abcdef",
      "filename": "sps-packing-slip-1ff23456.pdf",
      "size_bytes": 48211,
      "url": "/actions/core/serve-document/doc_0123456789abcdef?teamId=64b0000000000000000000aa"
    }
  ],
  "filename": "sps-packing-slip-1ff23456.pdf",
  "packing_slip_id": "1ff23456",
  "size_bytes": 48211,
  "url": "/actions/core/serve-document/doc_0123456789abcdef?teamId=64b0000000000000000000aa"
}
```

### Make sample packing slip PDF

Make a sample PDF of a retailer's packing slip, filled with SPS's sample data, to see what it looks like. Saved as a file.

**Inputs**

- Packing slip template (`packing_slip_id`, text, required): The retailer's packing slip template, from 'List packing slip templates'.
- Use upcoming requirements (`pending_change`, true/false): Turn on to use the retailer's upcoming packing slip requirements instead of the current ones.

**Outputs**

- `content_type` (text): The saved file's type, such as application/pdf
- `document_ref` (text): The saved file's reference, to attach it in a later step
- `documents` (list): The saved files, to attach in a later step
- `filename` (text): The saved file's name
- `packing_slip_id` (text): The packing slip template's id
- `size_bytes` (number): The saved file's size in bytes
- `url` (text): Where to open the saved file in Lodol

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_ref": "doc_0123456789abcdef",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_0123456789abcdef",
      "filename": "sps-packing-slip-1ff23456-sample.pdf",
      "size_bytes": 48211,
      "url": "/actions/core/serve-document/doc_0123456789abcdef?teamId=64b0000000000000000000aa"
    }
  ],
  "filename": "sps-packing-slip-1ff23456-sample.pdf",
  "packing_slip_id": "1ff23456",
  "size_bytes": 48211,
  "url": "/actions/core/serve-document/doc_0123456789abcdef?teamId=64b0000000000000000000aa"
}
```

### Make sample shipping label PDF

Make a sample PDF of a retailer's shipping label, filled with SPS's sample data, to see what it looks like. Saved as a file.

**Inputs**

- Shipping label template (`label_id`, text, required): The retailer's label template, from 'List shipping label templates'.
- Labels per page (`labels_per_page`, text): One label a page, or four. SPS's default is one. One of: `1` (One label a page), `4` (Four labels a page).
- Use upcoming requirements (`pending_change`, true/false): Turn on to use the retailer's upcoming label requirements instead of the current ones.

**Outputs**

- `content_type` (text): The saved file's type, such as application/pdf
- `document_ref` (text): The saved file's reference, to attach it in a later step
- `documents` (list): The saved files, to attach in a later step
- `filename` (text): The saved file's name
- `label_id` (text): The label template's id
- `size_bytes` (number): The saved file's size in bytes
- `url` (text): Where to open the saved file in Lodol

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_ref": "doc_0123456789abcdef",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_0123456789abcdef",
      "filename": "sps-label-1234567-sample.pdf",
      "size_bytes": 48211,
      "url": "/actions/core/serve-document/doc_0123456789abcdef?teamId=64b0000000000000000000aa"
    }
  ],
  "filename": "sps-label-1234567-sample.pdf",
  "label_id": "1234567",
  "size_bytes": 48211,
  "url": "/actions/core/serve-document/doc_0123456789abcdef?teamId=64b0000000000000000000aa"
}
```

### Make shipping label PDF

Make retailer-compliant shipping labels as a PDF from your shipment's data, up to 200 packs at a time. Saved as a file to print or attach.

**Inputs**

- Shipping label template (`label_id`, text, required): The retailer's label template, from 'List shipping label templates'.
- Data (`data`, object, required): The label's data as JSON: a Header and Pack objects in SPS's layout. 'Get shipping label sample data' gives an example, and 'Get file' can read it from an order.
- Labels per page (`labels_per_page`, text): One label a page, or four. SPS's default is one. One of: `1` (One label a page), `4` (Four labels a page).
- Use upcoming requirements (`pending_change`, true/false): Turn on to use the retailer's upcoming label requirements instead of the current ones.
- First pack number (`start_pack_count`, number): The pack number on the first label, so labels read 'Pack 5 of 20'. Defaults to 1. At least 1.
- Total packs (`total_pack_count`, number): The total number of packs in the shipment, if more than this data holds. At least 1.
- Copies (`copies`, number): How many copies of each label, 1 to 100. Defaults to 1. From 1 to 100.
- Collate copies (`collate`, true/false): Turn on to print copies as A B C, A B C rather than A A, B B, C C.
- Pages (`pages`, text): Only these pages, as numbers separated by commas, such as 2, 5. Leave empty for all.

**Outputs**

- `content_type` (text): The saved file's type, such as application/pdf
- `document_ref` (text): The saved file's reference, to attach it in a later step
- `documents` (list): The saved files, to attach in a later step
- `filename` (text): The saved file's name
- `label_id` (text): The label template's id
- `size_bytes` (number): The saved file's size in bytes
- `url` (text): Where to open the saved file in Lodol

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_ref": "doc_0123456789abcdef",
  "documents": [
    {
      "content_type": "application/pdf",
      "document_ref": "doc_0123456789abcdef",
      "filename": "sps-label-1234567.pdf",
      "size_bytes": 48211,
      "url": "/actions/core/serve-document/doc_0123456789abcdef?teamId=64b0000000000000000000aa"
    }
  ],
  "filename": "sps-label-1234567.pdf",
  "label_id": "1234567",
  "size_bytes": 48211,
  "url": "/actions/core/serve-document/doc_0123456789abcdef?teamId=64b0000000000000000000aa"
}
```

### Make shipping label ZPL

Make retailer-compliant shipping labels as ZPL, the language Zebra label printers take, from your shipment's data. Returns one ZPL text per label.

**Inputs**

- Shipping label template (`label_id`, text, required): The retailer's label template, from 'List shipping label templates'.
- Data (`data`, object, required): The label's data as JSON: a Header and Pack objects in SPS's layout. 'Get shipping label sample data' gives an example, and 'Get file' can read it from an order.
- Labels per page (`labels_per_page`, text): One label a page, or four. SPS's default is one. One of: `1` (One label a page), `4` (Four labels a page).
- Media type (`media_type`, text): The kind of labels in the printer. SPS's default is thermal transfer. One of: `T` (Thermal transfer), `D` (Direct thermal).
- Print mode (`print_mode`, text): What the printer does after each label. SPS's default is tear off. One of: `T` (Tear off), `P` (Peel off), `R` (Rewind), `A` (Applicator), `C` (Cutter), `D` (Delayed cutter), `F` (RFID), `K` (Kiosk).
- Print resolution (`dpi`, text): The printer's resolution. SPS's default is 203 dpi; 600 needs the Compressed command. One of: `152` (152 dpi), `203` (203 dpi), `300` (300 dpi), `600` (600 dpi (Compressed only)).
- ZPL command (`zpl_command`, text): How images are drawn. Pick one your printer supports; SPS's default is Standard. One of: `DG` (Standard (DG)), `DY` (Compressed, smaller files (DY)), `GFA` (Fast printing (GFA)).
- Use upcoming requirements (`pending_change`, true/false): Turn on to use the retailer's upcoming label requirements instead of the current ones.
- First pack number (`start_pack_count`, number): The pack number on the first label, so labels read 'Pack 5 of 20'. Defaults to 1. At least 1.
- Total packs (`total_pack_count`, number): The total number of packs in the shipment, if more than this data holds. At least 1.
- Copies (`copies`, number): How many copies of each label, 1 to 100. Defaults to 1. From 1 to 100.
- Collate copies (`collate`, true/false): Turn on to print copies as A B C, A B C rather than A A, B B, C C.
- Pages (`pages`, text): Only these pages, as numbers separated by commas, such as 2, 5. Leave empty for all.

**Outputs**

- `count` (number): How many labels
- `label_id` (text): The template's id
- `zpl` (text): All the labels' ZPL, one after another, to send to a printer
- `zpl_data` (list): The ZPL for each label

**Example output**

```json
{
  "count": 1,
  "label_id": "1234567",
  "zpl": "^XA^FO50,50^A0N,50,50^FDPack 1 of 1^FS^XZ",
  "zpl_data": [
    "^XA^FO50,50^A0N,50,50^FDPack 1 of 1^FS^XZ"
  ]
}
```

### Send document

Send a document, such as an order acknowledgement, ship notice or invoice in RSX XML or JSON, to SPS Commerce for your trading partners. A file with the same name is replaced.

**Inputs**

- Send to (`folder`, text, required): Test sends it through your test connections; Production sends it to your trading partners. One of: `testin/` (Test (testin)), `in/` (Production (in)).
- Document (`content`, text, required): The document's content, such as RSX XML or JSON.
- Document type (`document_type`, text): What the document is. Used to name the file when File name is empty. One of: `PO` (Purchase orders (PO)), `PC` (Purchase order changes (PC)), `PR` (Purchase order acknowledgements (PR)), `CA` (Order change acknowledgements (CA)), `SH` (Shipments and advance ship notices (SH)), `IN` (Invoices (IN)), `IB` (Inventory and item registries (IB)), `PS` (Planning schedules (PS)), `PD` (Product activity (PD)), `OW` (Warehouse shipping orders (OW)), and 3 more.
- File name (`file_name`, text): The file's name, starting with its document type code, such as IN123456.xml. Leave empty to have one made.
- Metadata (`metadata`, object): Names and values stored with the file, if your setup uses them.

**Outputs**

- `name` (text): The file's name
- `path` (text): The file's path in SPS Commerce
- `size_bytes` (number): How many bytes were sent
- `url` (text): The file's address in the Transaction API

**Example output**

```json
{
  "name": "IN9f2c4b7e1a3d4c5b8e6f7a8b9c0d1e2f.xml",
  "path": "/testin/IN9f2c4b7e1a3d4c5b8e6f7a8b9c0d1e2f.xml",
  "size_bytes": 1450,
  "url": "https://api.spscommerce.com/transactions/v5/data/testin/IN9f2c4b7e1a3d4c5b8e6f7a8b9c0d1e2f.xml"
}
```

### Start label batch

Start making a large set of shipping labels (more than 200 packs) as a PDF or ZPL in the background. Check on it with 'Get label batch'.

**Inputs**

- Shipping label template (`label_id`, text, required): The retailer's label template, from 'List shipping label templates'.
- Data (`data`, object, required): The label's data as JSON: a Header and Pack objects in SPS's layout. 'Get shipping label sample data' gives an example, and 'Get file' can read it from an order.
- Format (`output_format`, text): PDF, or ZPL for label printers. Defaults to PDF. One of: `pdf`, `zpl` (ZPL for label printers). Default: `pdf`.
- Labels per page (`labels_per_page`, text): One label a page, or four. SPS's default is one. One of: `1` (One label a page), `4` (Four labels a page).
- Media type (`media_type`, text): The kind of labels in the printer. SPS's default is thermal transfer. Only when Format is ZPL for label printers. One of: `T` (Thermal transfer), `D` (Direct thermal).
- Print mode (`print_mode`, text): What the printer does after each label. SPS's default is tear off. Only when Format is ZPL for label printers. One of: `T` (Tear off), `P` (Peel off), `R` (Rewind), `A` (Applicator), `C` (Cutter), `D` (Delayed cutter), `F` (RFID), `K` (Kiosk).
- Print resolution (`dpi`, text): The printer's resolution. SPS's default is 203 dpi; 600 needs the Compressed command. Only when Format is ZPL for label printers. One of: `152` (152 dpi), `203` (203 dpi), `300` (300 dpi), `600` (600 dpi (Compressed only)).
- ZPL command (`zpl_command`, text): How images are drawn. Pick one your printer supports; SPS's default is Standard. Only when Format is ZPL for label printers. One of: `DG` (Standard (DG)), `DY` (Compressed, smaller files (DY)), `GFA` (Fast printing (GFA)).
- Use upcoming requirements (`pending_change`, true/false): Turn on to use the retailer's upcoming label requirements instead of the current ones.
- First pack number (`start_pack_count`, number): The pack number on the first label, so labels read 'Pack 5 of 20'. Defaults to 1. At least 1.
- Total packs (`total_pack_count`, number): The total number of packs in the shipment, if more than this data holds. At least 1.
- Copies (`copies`, number): How many copies of each label, 1 to 100. Defaults to 1. From 1 to 100.
- Collate copies (`collate`, true/false): Turn on to print copies as A B C, A B C rather than A A, B B, C C.
- Pages (`pages`, text): Only these pages, as numbers separated by commas, such as 2, 5. Leave empty for all.
- Check the data in the background (`validate_later`, true/false): On by default: SPS checks the data while it works and reports problems in 'Get label batch'. Turn off to have it checked before the batch starts.

**Outputs**

- `batch_id` (text): The batch's id, for 'Get label batch'
- `label_id` (text): The template's id
- `output_format` (text): pdf or zpl
- `status_url` (text): The batch's status address

**Example output**

```json
{
  "batch_id": "8785d17f-b65e-44fb-a904-be962de8f123",
  "label_id": "1234567",
  "output_format": "pdf",
  "status_url": "https://api.spscommerce.com/label/v1/batches/8785d17f-b65e-44fb-a904-be962de8f123"
}
```
