---
updatedAt: 2026-04-28T02:11:24.000Z
agentTools:
  projectIndex: https://docs.shipscience.com/llms.txt
---

# Bulk create manifest shipments

Create multiple manifest shipments in a single request, optionally
with their nested line items.

### Limits & semantics
- **Maximum 30** shipments per request. Requests exceeding this limit
  are rejected with `422` and an error in the `manifest_shipments` field.
- **All-or-nothing.** The entire batch runs inside a database transaction;
  if **any** shipment fails validation (or a unique-constraint check),
  no shipments are persisted and the response lists every offending
  entry by its array `index`.
- **Duplicate detection within the batch.** Tracking numbers are
  compared case-insensitively (matching the database collation). If the
  same tracking number appears twice in one request, every offending
  entry is returned with `Tracking number is duplicated within this batch`.
- **Per-account uniqueness.** Beyond intra-batch detection, each shipment
  is also validated against existing rows for the authenticated account;
  a collision returns `Tracking number has already been taken`.

### Request shape
Pass a JSON object with a top-level `manifest_shipments` array. Each
element supports the same fields as a single `POST /api/v1/manifest/shipments`,
including the nested `shipment_items_attributes` array. **Required per
item:** `tracking_number`, `carrier`. The server assigns the `id`; do
not supply one.

### Response shape
- `201 Created` — `{ manifest_shipments: [<full shipment object>, ...] }`.
  Each entry mirrors the shape returned by the single-create endpoint
  and includes the server-assigned `id` plus all nested items.
- `422 Unprocessable Entity` — `{ errors: [{ index, tracking_number, messages }, ...] }`,
  one entry per offending shipment. `index` is the position in the
  request array; `tracking_number` is the value supplied (or `null`);
  `messages` is the list of validation errors as strings.


# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Shipscience API",
    "version": "v1",
    "description": "ShipScience's REST API for partners and customers.\n\n## Authentication\n\nMost endpoints require a bearer JWT in the `Authorization` header. Tokens\nare issued by the ShipScience login flow and are valid for 4 hours.\nClients are responsible for refreshing tokens before expiry. The\n`/api/v1/tokens` endpoint is an exception — it authenticates with the\n`api-key` header rather than a bearer JWT, since its purpose is to\nissue the JWT itself.\n\n## Partner endpoints\n\nThe **Sub Accounts** section is only available to accounts explicitly\nenabled as partners. If you receive `403 Forbidden`, contact\n**support@shipscience.com** to request access.\n"
  },
  "tags": [
    {
      "name": "Manifest Shipments",
      "description": "CRUD endpoints for shipments captured from your shipping platform's manifest\n(pre-invoice). Useful for matching carrier-billed shipments back to your\nsource-of-truth orders. Lookup is keyed by `tracking_number`. The nested\n`shipment_items_attributes` array supports inline create/update/destroy of\nline items in a single request.\n"
    }
  ],
  "paths": {
    "/api/v1/manifest/shipments/bulk_create": {
      "post": {
        "summary": "Bulk create manifest shipments",
        "tags": [
          "Manifest Shipments"
        ],
        "description": "Create multiple manifest shipments in a single request, optionally\nwith their nested line items.\n\n### Limits & semantics\n- **Maximum 30** shipments per request. Requests exceeding this limit\n  are rejected with `422` and an error in the `manifest_shipments` field.\n- **All-or-nothing.** The entire batch runs inside a database transaction;\n  if **any** shipment fails validation (or a unique-constraint check),\n  no shipments are persisted and the response lists every offending\n  entry by its array `index`.\n- **Duplicate detection within the batch.** Tracking numbers are\n  compared case-insensitively (matching the database collation). If the\n  same tracking number appears twice in one request, every offending\n  entry is returned with `Tracking number is duplicated within this batch`.\n- **Per-account uniqueness.** Beyond intra-batch detection, each shipment\n  is also validated against existing rows for the authenticated account;\n  a collision returns `Tracking number has already been taken`.\n\n### Request shape\nPass a JSON object with a top-level `manifest_shipments` array. Each\nelement supports the same fields as a single `POST /api/v1/manifest/shipments`,\nincluding the nested `shipment_items_attributes` array. **Required per\nitem:** `tracking_number`, `carrier`. The server assigns the `id`; do\nnot supply one.\n\n### Response shape\n- `201 Created` — `{ manifest_shipments: [<full shipment object>, ...] }`.\n  Each entry mirrors the shape returned by the single-create endpoint\n  and includes the server-assigned `id` plus all nested items.\n- `422 Unprocessable Entity` — `{ errors: [{ index, tracking_number, messages }, ...] }`,\n  one entry per offending shipment. `index` is the position in the\n  request array; `tracking_number` is the value supplied (or `null`);\n  `messages` is the list of validation errors as strings.\n",
        "security": [
          {
            "bearer_auth": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "created - ignores supplied source_system",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/bulk_manifest_shipments_response"
                }
              }
            }
          },
          "400": {
            "description": "bad request - missing required key"
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          },
          "422": {
            "description": "unprocessable entity - blank strings get presence error not duplicate error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/bulk_manifest_shipments_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "manifest_shipments"
                ],
                "properties": {
                  "manifest_shipments": {
                    "type": "array",
                    "maxItems": 30,
                    "items": {
                      "type": "object",
                      "required": [
                        "tracking_number",
                        "carrier"
                      ],
                      "properties": {
                        "account_number": {
                          "type": "string",
                          "nullable": true
                        },
                        "order_number": {
                          "type": "string",
                          "nullable": true
                        },
                        "service": {
                          "type": "string",
                          "nullable": true
                        },
                        "shipment_created_date": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        },
                        "shipped_date": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        },
                        "quoted_shipment_cost": {
                          "type": "number",
                          "nullable": true
                        },
                        "declared_value": {
                          "type": "number",
                          "nullable": true
                        },
                        "dimensions_height": {
                          "type": "number",
                          "nullable": true
                        },
                        "dimensions_length": {
                          "type": "number",
                          "nullable": true
                        },
                        "dimensions_width": {
                          "type": "number",
                          "nullable": true
                        },
                        "dimensions_units": {
                          "type": "string",
                          "nullable": true
                        },
                        "weight_value": {
                          "type": "number",
                          "nullable": true
                        },
                        "weight_units": {
                          "type": "string",
                          "nullable": true
                        },
                        "from_name": {
                          "type": "string",
                          "nullable": true
                        },
                        "from_company": {
                          "type": "string",
                          "nullable": true
                        },
                        "from_address_line_1": {
                          "type": "string",
                          "nullable": true
                        },
                        "from_address_line_2": {
                          "type": "string",
                          "nullable": true
                        },
                        "from_address_line_3": {
                          "type": "string",
                          "nullable": true
                        },
                        "from_city": {
                          "type": "string",
                          "nullable": true
                        },
                        "from_state": {
                          "type": "string",
                          "nullable": true
                        },
                        "from_zip": {
                          "type": "string",
                          "nullable": true
                        },
                        "from_country": {
                          "type": "string",
                          "nullable": true
                        },
                        "to_name": {
                          "type": "string",
                          "nullable": true
                        },
                        "to_company": {
                          "type": "string",
                          "nullable": true
                        },
                        "to_address_line_1": {
                          "type": "string",
                          "nullable": true
                        },
                        "to_address_line_2": {
                          "type": "string",
                          "nullable": true
                        },
                        "to_address_line_3": {
                          "type": "string",
                          "nullable": true
                        },
                        "to_city": {
                          "type": "string",
                          "nullable": true
                        },
                        "to_state": {
                          "type": "string",
                          "nullable": true
                        },
                        "to_zip": {
                          "type": "string",
                          "nullable": true
                        },
                        "to_country": {
                          "type": "string",
                          "nullable": true
                        },
                        "zone_code": {
                          "type": "string",
                          "nullable": true
                        },
                        "package_code": {
                          "type": "string",
                          "nullable": true
                        },
                        "reference_1": {
                          "type": "string",
                          "nullable": true
                        },
                        "reference_2": {
                          "type": "string",
                          "nullable": true
                        },
                        "reference_3": {
                          "type": "string",
                          "nullable": true
                        },
                        "brand": {
                          "type": "string",
                          "nullable": true
                        },
                        "is_perishable": {
                          "type": "boolean",
                          "nullable": true
                        },
                        "shipment_items_attributes": {
                          "type": "array",
                          "nullable": true,
                          "items": {
                            "type": "object",
                            "properties": {
                              "order_number": {
                                "type": "string"
                              },
                              "order_line": {
                                "type": "integer",
                                "nullable": true
                              },
                              "item_description": {
                                "type": "string"
                              },
                              "item_value": {
                                "type": "number",
                                "nullable": true
                              },
                              "item_units": {
                                "type": "integer",
                                "nullable": true
                              },
                              "item_sku": {
                                "type": "string",
                                "nullable": true
                              }
                            },
                            "required": [
                              "order_number",
                              "item_description"
                            ]
                          }
                        },
                        "tracking_number": {
                          "type": "string"
                        },
                        "carrier": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "manifest_shipment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "mns_AbC123dEf456GhI789jKlM"
          },
          "tracking_number": {
            "type": "string"
          },
          "carrier": {
            "type": "string"
          },
          "account_number": {
            "type": "string",
            "nullable": true
          },
          "order_number": {
            "type": "string",
            "nullable": true
          },
          "service": {
            "type": "string",
            "nullable": true
          },
          "shipment_created_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "shipped_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "quoted_shipment_cost": {
            "type": "number",
            "nullable": true
          },
          "declared_value": {
            "type": "number",
            "nullable": true
          },
          "dimensions_height": {
            "type": "number",
            "nullable": true
          },
          "dimensions_length": {
            "type": "number",
            "nullable": true
          },
          "dimensions_width": {
            "type": "number",
            "nullable": true
          },
          "dimensions_units": {
            "type": "string",
            "nullable": true
          },
          "weight_value": {
            "type": "number",
            "nullable": true
          },
          "weight_units": {
            "type": "string",
            "nullable": true
          },
          "from_name": {
            "type": "string",
            "nullable": true
          },
          "from_company": {
            "type": "string",
            "nullable": true
          },
          "from_address_line_1": {
            "type": "string",
            "nullable": true
          },
          "from_address_line_2": {
            "type": "string",
            "nullable": true
          },
          "from_address_line_3": {
            "type": "string",
            "nullable": true
          },
          "from_city": {
            "type": "string",
            "nullable": true
          },
          "from_state": {
            "type": "string",
            "nullable": true
          },
          "from_zip": {
            "type": "string",
            "nullable": true
          },
          "from_country": {
            "type": "string",
            "nullable": true
          },
          "to_name": {
            "type": "string",
            "nullable": true
          },
          "to_company": {
            "type": "string",
            "nullable": true
          },
          "to_address_line_1": {
            "type": "string",
            "nullable": true
          },
          "to_address_line_2": {
            "type": "string",
            "nullable": true
          },
          "to_address_line_3": {
            "type": "string",
            "nullable": true
          },
          "to_city": {
            "type": "string",
            "nullable": true
          },
          "to_state": {
            "type": "string",
            "nullable": true
          },
          "to_zip": {
            "type": "string",
            "nullable": true
          },
          "to_country": {
            "type": "string",
            "nullable": true
          },
          "zone_code": {
            "type": "string",
            "nullable": true
          },
          "package_code": {
            "type": "string",
            "nullable": true
          },
          "reference_1": {
            "type": "string",
            "nullable": true
          },
          "reference_2": {
            "type": "string",
            "nullable": true
          },
          "reference_3": {
            "type": "string",
            "nullable": true
          },
          "brand": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "shipment_items": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/manifest_shipment_item"
                }
              ]
            }
          }
        }
      },
      "manifest_shipment_item": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true,
            "example": "mnsi_AbC123dEf456GhI789jKlM"
          },
          "manifest_shipment_id": {
            "type": "integer",
            "nullable": true
          },
          "order_number": {
            "type": "string"
          },
          "order_line": {
            "type": "integer",
            "nullable": true
          },
          "item_description": {
            "type": "string"
          },
          "item_value": {
            "type": "number",
            "nullable": true
          },
          "item_units": {
            "type": "integer",
            "nullable": true
          },
          "item_sku": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "_destroy": {
            "type": "boolean",
            "nullable": true
          }
        }
      },
      "bulk_manifest_shipments_response": {
        "type": "object",
        "properties": {
          "manifest_shipments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/manifest_shipment"
            }
          }
        }
      },
      "bulk_manifest_shipments_error": {
        "type": "object",
        "description": "Error envelope returned from `POST /api/v1/manifest/shipments/bulk_create` when one or more shipments fail validation. The whole batch is rolled back on any error.",
        "properties": {
          "errors": {
            "type": "array",
            "description": "One entry per offending shipment, in the order they appeared in the request.",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "nullable": true,
                  "description": "Zero-based position of the offending shipment in the original `manifest_shipments` request array. `null` for top-level errors that are not tied to a specific entry (e.g. `manifest_shipments must be an array`, `Maximum 30 shipments per request`).",
                  "example": 0
                },
                "tracking_number": {
                  "type": "string",
                  "nullable": true,
                  "description": "The tracking number supplied by the client for this entry, or `null` if it was missing or the error is not tied to a single shipment.",
                  "example": "BULK001"
                },
                "messages": {
                  "type": "array",
                  "description": "Human-readable validation messages for this entry.",
                  "items": {
                    "type": "string"
                  },
                  "example": [
                    "Tracking number is duplicated within this batch"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearer_auth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "servers": [
    {
      "url": "https://app.shipscience.com",
      "variables": {
        "defaultHost": {
          "default": "app.shipscience.com"
        }
      }
    }
  ]
}
```