---
title: "Submit Order"
method: POST
path: "/api/mfg/orders"
tags: ["manufacturing"]
---

# Submit Order

`POST /api/mfg/orders`

## Request

- Base URL: `https://api.pigeonly.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pigeonly.com/api/mfg/orders`
- Auth: none declared

`SubmitOrder`. Idempotent on `centrics_order_id`.

⛔A REPUSH IS NOT A SECOND ORDER. He retries on his own schedule, and a
duplicate that created a twin could be printed twice -- which is real
mail to a real person, twice, with no undo. Answers 200 with
`already_existed` either way rather than a conflict, because a retry
succeeding is what he needs to see.

⛔APPENDED 2026-10-08: a repush of an order that has never printed also
REPLACES its recipient and sender with the repush's (his orders now carry
the inmate number in `recipient.attention`, consumer/api#112); the answer's
`address` says `updated` or `unchanged`. An order that printed, has a print
job or had an envelope scanned is never changed.

⛔APPENDED 2026-10-09 (Frederick, new print templates backfilled by repush;
OPEN_ITEMS RPA-1): the same repush also REPLACES the document of each pushed
line that has not printed and has no live job; the answer's `documents` and
`document_lines` say what happened to each line and why anything was
refused. A line that printed, is on a press or belongs to an order whose
envelope was scanned is never changed.

⛔APPENDED 2026-10-09 (OPEN_ITEMS RPA-6; Jonathan: "something that replaces an
order's lines and drops the receipt"; Frederick: "We can only take your file so
you have to update your file"): a repush that carries the order and leaves out
its retired receipt (`receipt.pdf`, `greeting-card-receipt.jpg`) WITHDRAWS that
line, keeping the row; `document_lines` gains an entry for it, `receipt_withdrawn`
or a refusal. A photo receipt is never dropped; no other line is ever removed.

⛔APPENDED 2026-10-11 (OPEN_ITEMS ROD-1; Frederick: "the backlog is addressed
first, and then we catch up"): the push may carry `retailer_order_date`, when
the order was placed (RFC 3339 with an offset; a time with no offset is a 422).
A new order stores it. A repush of an order with NO stored date fills it; a
repush whose date differs from the stored one changes nothing and says so on
the order's trail and in the answer's `order_date` (`differs`). The ready list
and the floor work the oldest order first by it (`print_order.order_clock_sql`).

⛔APPENDED 2026-10-11 (the lead; `print.order_duplicates`, FLR-25 History): a NEW
order whose lines are the same document for the same parcel code as an order
Roost already holds (the signed link may differ) is recorded as a DUPLICATE and
never printed. It is still a 200 with `already_existed` true, the original's
`OrderStatus`, `duplicate` true and `duplicate_of` naming the original: a retry
of a parcel under a new order id is received, not refused, and nothing is lost.

## Headers

- `authorization` string, nullable

## Request body

- SubmitOrderRequest
  - `centrics_order_id` string, required
  - `retailer_order_number` string, nullable
  - `source_service` string, nullable
  - `retailer_job_number` string, nullable
  - `recipient` object
  - `sender` object
  - `shipping_method` string, nullable
  - `shipping_carrier` string, nullable
  - `retailer_affiliate` string, nullable
  - `manual_review` boolean, nullable
  - `qr_code` string, nullable
  - `manufacturing_priority` string, nullable
  - `retailer_order_date` string, date-time, nullable
  - `line_items` LineItem[], required
    - `line_item_id` string, required
    - `product_id` string, nullable
    - `quantity` integer
    - `document_url` string, nullable
    - `document` DocumentRefIn, nullable: Issue #2608: where to fetch this line's document BY IDENTITY, regardless of GCP project (Marc, 2026-09-30, verbatim: "update the API so that clients send the required information to grab the file regardless of GCP project"). `storage`/`bucket`/`object` are required and load-bearing; `project` is required but is NOT what makes the fetch work -- see the design doc's own "the project id is not what makes the fetch work" section: bucket names are globally unique in GCS and the grant is per-bucket, so one service account with one grant per bucket reads across any number of projects. `project` still earns its place for a 403's own IAM-page pointer, a future requester-pays billing project, and a future per-project credential map (none of those three are wired by this build). `generation` is OPTIONAL but strongly wanted: pinned, a later overwrite of the same path cannot silently change what prints.
      - `storage` string, required
      - `bucket` string, required
      - `object` string, required
      - `project` string, required
      - `generation` string, nullable
      - `content_type` string, nullable
      - `size_bytes` integer, nullable
      - `md5` string, nullable
      - `crc32c` string, nullable
    - `parcel_code` string, nullable
    - `first_scanned_at` string, date-time, nullable

## Response `200`

Successful Response

- SubmitOrderReply: `POST /api/mfg/orders`, the answer to a push. A repush of a known order is `already_existed` true, not an error. `duplicate` is true when Roost already holds this document for this parcel code under another order (`duplicate_of` names it, or `duplicate_of_piece` when the copy is of a piece with no order id); the push is still answered 200 and the order is never printed.
  - `centrics_order_id` string, required
  - `retailer_order_number` string, nullable
  - `OrderStatus` string, required
  - `already_existed` boolean, required
  - `shadow` boolean, required
  - `warnings` string[]
  - `duplicate` boolean
  - `duplicate_of` string, nullable
  - `duplicate_of_piece` string, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-11-17** `b7efd1c3801c`: 9 info
  - added the optional property `duplicate` to the response with the `200` status
  - added the optional property `duplicate_of` to the response with the `200` status
  - added the optional property `duplicate_of_piece` to the response with the `200` status
  - added the optional property `retailer_order_number` to the response with the `200` status
  - …5 more
- **2026-11-04** `86221b47c790`: 1 info
  - added the new optional request property `line_items/items/first_scanned_at`

[Operation history](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/changes/api/mfg/orders/post.md)

---

[API](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os.md) - [All operations](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/llms.txt) - [OpenAPI document](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/revisions/14571c4b7007?raw)
