> ## Documentation Index
> Fetch the complete documentation index at: https://docs.helpgenie.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Print Orders

> Draft, edit, and email print orders for an activation pack's printable assets

Print orders let you bundle printable assets from an activation pack (QR stickers, posters, lookbooks) into an order that can be emailed directly to a print vendor. Admins may target another user's orders by passing `adminMode` with `userId`.

***

## Get or create print order

Returns the pack's existing draft print order, or creates a new one seeded with items for every printable asset already generated on the pack.

<ParamField body="resource" type="string" required>
  Must be `"print-orders"`
</ParamField>

<ParamField body="action" type="string" required>
  Must be `"get-or-create"`
</ParamField>

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="activation_pack_id" type="string" required>
      UUID of the activation pack to build the order for.
    </ParamField>

    <ParamField body="forceNew" type="boolean" default="false">
      Skip draft reuse and always insert a new order.
    </ParamField>

    <ParamField body="adminMode" type="boolean">
      Admin only. Allow targeting another user's orders.
    </ParamField>

    <ParamField body="userId" type="string">
      Admin only. UUID of the user whose orders to operate on.
    </ParamField>
  </Expandable>
</ParamField>

<ResponseField name="success" type="boolean" />

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="printOrder" type="object">
      The print order record.

      <Expandable title="properties">
        <ResponseField name="id" type="string">Print order UUID.</ResponseField>
        <ResponseField name="status" type="string">Order status (e.g. `"draft"`, `"sent"`).</ResponseField>

        <ResponseField name="items" type="object[]">
          Line items — each has `id`, `label`, `url`, `quantity`, `notes`, and `assetType`.
        </ResponseField>

        <ResponseField name="vendor_email" type="string | null">Printer's email address.</ResponseField>
        <ResponseField name="notes" type="string | null">Free-text instructions for the printer.</ResponseField>
        <ResponseField name="sent_at" type="string | null">ISO 8601 timestamp when the order was sent.</ResponseField>
        <ResponseField name="created_at" type="string">ISO 8601 creation timestamp.</ResponseField>
        <ResponseField name="updated_at" type="string">ISO 8601 last-updated timestamp.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```typescript Request theme={null}
  const response = await ApiService.invoke({
    resource: "print-orders",
    action: "get-or-create",
    data: {
      activation_pack_id: "pack-uuid",
    },
  });
  const order = response?.printOrder;
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.helpgenie.ai/v1/print-orders \
    -H "Authorization: Bearer hg_live_YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "resource": "print-orders",
      "action": "get-or-create",
      "data": {
        "activation_pack_id": "pack-uuid"
      }
    }'
  ```

  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "printOrder": {
        "id": "order-uuid",
        "status": "draft",
        "items": [
          { "id": "item-1", "label": "QR Sticker", "url": "https://...", "quantity": 50, "assetType": "qr_sticker" }
        ],
        "vendor_email": null,
        "notes": null,
        "sent_at": null,
        "created_at": "2024-01-15T10:00:00.000Z",
        "updated_at": "2024-01-15T10:00:00.000Z"
      }
    }
  }
  ```
</CodeGroup>

***

## Update print order

Updates a draft print order — its items array, vendor email, or notes.

<Warning>
  Only draft orders can be updated. Sent orders are locked.
</Warning>

<ParamField body="resource" type="string" required>
  Must be `"print-orders"`
</ParamField>

<ParamField body="action" type="string" required>
  Must be `"update"`
</ParamField>

<ParamField body="id" type="string" required>
  The print order UUID.
</ParamField>

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="items" type="object[]">
      Updated order line items. Each item: `{ id, label, url, quantity, notes, assetType }`.
    </ParamField>

    <ParamField body="notes" type="string">
      Free-text instructions for the printer. Maximum 2,000 characters.
    </ParamField>

    <ParamField body="vendor_email" type="string">
      Printer's email address.
    </ParamField>

    <ParamField body="expectedUpdatedAt" type="string" required>
      The `updated_at` timestamp of the draft being edited. Stale writes are rejected.
    </ParamField>

    <ParamField body="expectedAssetInputRevision" type="string">
      Required when `items` is provided. Artwork-input revision used to render the selected files.
    </ParamField>

    <ParamField body="adminMode" type="boolean">
      Admin only. Allow targeting another user's orders.
    </ParamField>

    <ParamField body="userId" type="string">
      Admin only. UUID of the user whose orders to operate on.
    </ParamField>
  </Expandable>
</ParamField>

<ResponseField name="success" type="boolean" />

<ResponseField name="data" type="object">
  The updated print order object.
</ResponseField>

***

## Send print order

Emails the print order to a vendor with each item's asset attached, then marks the order sent.

<ParamField body="resource" type="string" required>
  Must be `"print-orders"`
</ParamField>

<ParamField body="action" type="string" required>
  Must be `"send"`
</ParamField>

<ParamField body="id" type="string" required>
  The print order UUID.
</ParamField>

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="vendorEmail" type="string" required>
      Printer's email address. Must be a valid address.
    </ParamField>

    <ParamField body="notes" type="string">
      Instructions included in the email and saved on the order. Maximum 2,000 characters.
    </ParamField>

    <ParamField body="expectedUpdatedAt" type="string" required>
      The `updated_at` timestamp of the draft being reviewed. Stale versions are rejected before delivery.
    </ParamField>

    <ParamField body="adminMode" type="boolean">
      Admin only. Allow targeting another user's orders.
    </ParamField>

    <ParamField body="userId" type="string">
      Admin only. UUID of the user whose orders to operate on.
    </ParamField>
  </Expandable>
</ParamField>

<ResponseField name="success" type="boolean" />

<ResponseField name="data" type="object">
  The sent print order with updated `sent_at` timestamp.
</ResponseField>

<Note>
  Fails validation if the order has no items. Only `http(s)` item URLs are attached to the email.
</Note>

<CodeGroup>
  ```typescript Request theme={null}
  const response = await ApiService.invoke({
    resource: "print-orders",
    action: "send",
    id: "order-uuid",
    data: {
      vendorEmail: "printer@example.com",
      notes: "Please use matte finish for all stickers.",
      expectedUpdatedAt: "2024-01-15T10:00:00.000Z",
    },
  });
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.helpgenie.ai/v1/print-orders \
    -H "Authorization: Bearer hg_live_YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "resource": "print-orders",
      "action": "send",
      "id": "order-uuid",
      "data": {
        "vendorEmail": "printer@example.com",
        "notes": "Please use matte finish for all stickers.",
        "expectedUpdatedAt": "2024-01-15T10:00:00.000Z"
      }
    }'
  ```
</CodeGroup>

***

## Error codes

| Code               | Meaning                                          |
| ------------------ | ------------------------------------------------ |
| `VALIDATION_ERROR` | Missing required parameter or order has no items |
| `NOT_FOUND`        | Print order or activation pack not found         |
| `FORBIDDEN`        | Non-admin user attempted to target another user  |
| `INTERNAL_ERROR`   | Unexpected server error                          |
