# Orders

> How orders are validated, customer order identifiers, payloads, payment, the holding bin and cancellation, manufacturing time, tracking numbers, and order limits.

An order is a group of printable products that RPI manufactures and ships to a single destination address.

Before submitting an order, configure the products you intend to order and confirm the available shipping options and
estimated pricing. See [Products](products.md), [Shipping](/documentation/shipping), and
[Create Order Request](first-request.md) for details.

## Order Creation and Validation

RPI Print API validates orders after submission to confirm they meet manufacturing and fulfillment requirements.

Malformed requests or orders submitted to unsupported countries are rejected with HTTP 400, and no order is
created.

Other validation failures, such as selecting an unavailable shipping classification, omitting a required
`retailPrice`, or submitting an order to an unsupported destination, may return HTTP 201, indicating that the order was created. However, the order subsequently transitions to `FAILED`, and
RPI Print API sends an `OrderValidationFailed` webhook.

Orders that successfully complete validation transition to `VALID_AWAITING_PAYMENT`.

For more information about validation of production files, see [Preflighting](preflight.md).

## Customer Order IDs

When creating an order, you can include an optional `customerOrderId` of up to 40 characters. If omitted, RPI Print
API automatically generates one.

This identifier is used in API requests and responses and is displayed in the RPI Print API Dashboard.

Customer Order IDs must be unique across both sandbox and production environments. An identifier previously used in
either environment cannot be reused.

Submitting a create request with an existing `customerOrderId` returns HTTP 400. The API does not create a duplicate
order or return the existing order.

### Handling Uncertain Create Request Results

If a create request fails without confirming whether the order was created, such as during a network timeout, do not
immediately retry the request.

Instead, call `GET /orders/{customerOrderId}` using the same API key:

- If the order is returned, the original request succeeded.
- If the response is HTTP 404 following a duplicate-ID error, the identifier belongs to an order in the other
  environment (sandbox or production). Use a new identifier.

Providing a Customer Order ID does not make order creation idempotent.

## Payload

When creating an order, you can include an optional `payload` field containing up to 512 characters.

RPI Print API returns this value in every webhook notification and GET response for the order, allowing you to
associate RPI orders with records in your own system.

## Payment Processing

After successfully completing validation, an order enters `VALID_AWAITING_PAYMENT` and awaits payment processing.

RPI Print API automatically processes payments approximately once daily, at 02:00 UTC, which is 6:00 p.m. Pacific
Standard Time and 7:00 p.m. Pacific Daylight Time.

Alternatively, you can initiate payment earlier using the Pay Now functionality in the RPI Print API Dashboard.

Once payment succeeds, the order transitions to `VALID_HOLDING_BIN`, where it remains for 2 hours before submission
for manufacturing.

## Holding Bin and Order Cancellation

Cancellation eligibility and applicable charges depend on the order's progress through fulfillment.

### Before Payment Processing

Orders cancelled before payment processing will not be charged.

### During the Holding Period

After successful payment, orders remain in `VALID_HOLDING_BIN` for 2 hours. Cancellation is guaranteed during this
period, and RPI will initiate a full refund of the amount paid.

### After Submission for Manufacturing

Once an order has been submitted to the printer, cancellation is no longer guaranteed. RPI forwards cancellation
requests to the printer, which may accept or reject them based on the order's manufacturing status.

If cancellation is accepted after the printer has accepted the order for manufacturing, the products will be discarded
and will not ship. Applicable manufacturing charges remain the customer's responsibility, but shipping charges paid for
the cancelled shipment will be refunded.

If the cancellation request is rejected, the order proceeds through manufacturing and fulfillment, and all applicable
product, shipping, tax, and other charges remain due.

### After Shipment

Once an order reaches `SHIPPED`, it is no longer eligible for cancellation, and all applicable charges remain the
customer's responsibility.

To request cancellation, call `DELETE /orders/{customerOrderId}`. Cancellation requests are not permitted while an
order is in `VALIDATING`, `CANCELLATION_REQUESTED`, or `EXCEPTION`, or after it reaches a final status. See
[Order States](order-states.md) for status-specific restrictions.

## Manufacturing Time

Manufacturing time begins when an order reaches `RECEIVED_BY_PRINTER` and ends when it reaches `SHIPPED`.

The date the printer receives the order is considered Day Zero, with each subsequent business day counted
sequentially.

### Standard Manufacturing Time

RPI uses commercially reasonable efforts to ship orders within 4 business days after Day Zero.

For example, an order received by the printer on Monday is expected to reach `SHIPPED` by Friday, assuming no RPI
holidays or applicable exceptions.

### Rush Manufacturing Target

Orders submitted with the Rush shipping classification receive an Expected Ship Date calculated using a
3-business-day manufacturing target.

Rush manufacturing is expedited on a commercially reasonable efforts basis. The Expected Ship Date is a target, not a
guarantee, and does not modify the Standard Manufacturing Time.

### Manufacturing Time Exceptions

Standard and Rush manufacturing targets may not apply to orders affected by:

- Non-conforming orders or prohibited content.
- Incomplete or inaccurate customer-provided information.
- Customer actions or omissions that delay manufacturing.
- Payment issues, suspension, or cancellation requests.
- Circumstances outside RPI's reasonable control.
- Other exceptions established in the applicable Terms and Conditions.

If correction of a non-conforming order is permitted, manufacturing time begins when the corrected order reaches
`RECEIVED_BY_PRINTER`.

Manufacturing time excludes shipping transit time. See [Shipping](/documentation/shipping) for available shipping
classifications and transit times.

## Tracking Numbers

When an order reaches `SHIPPED`, RPI Print API sends an `OrderShipped` webhook, and the order's `shipmentTracking`
field contains its tracking information.

This field is available in webhook notifications and through `GET /orders/{customerOrderId}`.

Each tracking entry groups packages sharing a master tracking number. Individual packages may include:

- `trackingNumber`: The package tracking number.
- `altTrackingNumber`: An alternate tracking number, if provided by the carrier.
- `trackingUrl`: A link to the carrier's tracking page.

Tracking information is recorded once the entire order has shipped. Until then, `shipmentTracking` remains empty.
Individual fields may also be empty when the carrier does not provide a value.

See [Webhooks](webhooks.md) for notification details.

## Limits and Quotas

RPI Print API applies account-level limits to order creation.

### Daily Order Limit

By default, an account can create up to 50 orders within a rolling 24-hour period. Reprints and rejected orders do not
count toward this limit.

Orders exceeding the daily limit are accepted with HTTP 201 and placed in `QUEUED`. They are released to `RECEIVED`,
oldest first, as capacity becomes available. A released order counts toward the limit for 24 hours from its release.

Customer Support can adjust your daily order limit. To request a change, contact
[printapicustomersupport@rpiprint.com](mailto:printapicustomersupport@rpiprint.com).

### Queue Limit

The default queue ceiling is 350 orders, including orders that count toward the daily limit and those waiting in the
queue.

With the default daily limit of 50, up to 300 additional orders can be queued.

Orders exceeding the queue ceiling are accepted with HTTP 201 but transition to `REJECTED`. RPI Print API sends an
`OrderExceedsLimitQueue` webhook, and the rejected order is not processed.

In sandbox, orders exceeding the daily limit are immediately assigned `REJECTED` rather than being queued.
