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

# Validate a provider-neutral prepared-media print order

> Accepts exactly one JSON object up to 2 MiB and rejects unknown fields. This endpoint does not quote, create, pay for, upload media for, or submit an order. Clients must fetch the catalog and use the selected product revision's asset requirements and options.



## OpenAPI

````yaml https://api.batchrelay.com/openapi.json post /v1/print-orders/validate
openapi: 3.1.0
info:
  title: Batch Relay API
  version: 1.0.0
  description: >-
    Provider-neutral print catalog and prepared-media validation. This document
    covers only routes owned by the Go service; it deliberately excludes
    migration-proxied order lifecycle routes and all provider payloads.
servers:
  - url: https://api.batchrelay.com
security: []
tags:
  - name: System
  - name: Catalog
  - name: Print orders
  - name: API accounts
paths:
  /v1/print-orders/validate:
    post:
      tags:
        - Print orders
      summary: Validate a provider-neutral prepared-media print order
      description: >-
        Accepts exactly one JSON object up to 2 MiB and rejects unknown fields.
        This endpoint does not quote, create, pay for, upload media for, or
        submit an order. Clients must fetch the catalog and use the selected
        product revision's asset requirements and options.
      operationId: validatePrintOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRequest'
      responses:
        '200':
          description: Validated, immutable fulfillment plan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationResponse'
        '400':
          $ref: '#/components/responses/InvalidRequestJSON'
        '413':
          $ref: '#/components/responses/RequestTooLarge'
        '422':
          $ref: '#/components/responses/OrderValidationFailed'
components:
  schemas:
    OrderRequest:
      type: object
      required:
        - schema_version
        - environment
        - external_order_id
        - ship_to
        - ship_from
        - items
      properties:
        schema_version:
          type: integer
          const: 1
        environment:
          type: string
          enum:
            - sandbox
            - production
        external_order_id:
          type: string
          minLength: 1
        ship_to:
          $ref: '#/components/schemas/Address'
        ship_from:
          $ref: '#/components/schemas/Address'
        items:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/OrderLine'
      additionalProperties: false
    ValidationResponse:
      type: object
      required:
        - plan
      properties:
        plan:
          $ref: '#/components/schemas/FulfillmentPlan'
      additionalProperties: false
    Address:
      type: object
      required:
        - name
        - address_1
        - city
        - state
        - postal_code
        - country
        - phone
      properties:
        name:
          type: string
          minLength: 1
        address_1:
          type: string
          minLength: 1
        address_2:
          type: string
        city:
          type: string
          minLength: 1
        state:
          type: string
          minLength: 1
        postal_code:
          type: string
          minLength: 1
        country:
          type: string
          minLength: 1
        phone:
          type: string
          pattern: ^\+[1-9][0-9]{1,14}$
          description: E.164 phone number, for example +16516468263
      additionalProperties: false
    OrderLine:
      type: object
      required:
        - product
        - quantity
        - assets
      properties:
        product:
          $ref: '#/components/schemas/ProductReference'
        quantity:
          type: integer
          minimum: 1
        options:
          type: array
          items:
            $ref: '#/components/schemas/OptionSelection'
        assets:
          type: array
          items:
            $ref: '#/components/schemas/PreparedAsset'
      additionalProperties: false
    FulfillmentPlan:
      type: object
      required:
        - schema_version
        - environment
        - external_order_id
        - ship_to
        - ship_from
        - lines
      properties:
        schema_version:
          type: integer
          const: 1
        environment:
          type: string
          enum:
            - sandbox
            - production
        external_order_id:
          type: string
        ship_to:
          $ref: '#/components/schemas/Address'
        ship_from:
          $ref: '#/components/schemas/Address'
        lines:
          type: array
          items:
            $ref: '#/components/schemas/PlannedLine'
      additionalProperties: false
    Error:
      type: object
      required:
        - error
        - code
        - message
        - docs_url
        - request_id
      properties:
        error:
          type: string
          description: Backward-compatible human-readable error.
        code:
          type: string
          description: Stable machine-readable error code.
        message:
          type: string
        docs_url:
          type: string
          format: uri
        request_id:
          type: string
      additionalProperties: false
    ProductReference:
      type: object
      required:
        - id
        - revision
      properties:
        id:
          type: string
          minLength: 1
        revision:
          type: integer
          minimum: 1
      additionalProperties: false
    OptionSelection:
      type: object
      required:
        - option_id
        - value
      properties:
        option_id:
          type: string
          minLength: 1
        value:
          type: string
          minLength: 1
      additionalProperties: false
    PreparedAsset:
      type: object
      required:
        - role
        - url
        - pixel_width
        - pixel_height
      properties:
        role:
          $ref: '#/components/schemas/AssetRole'
        url:
          type: string
          format: uri
          pattern: ^https://
        pixel_width:
          type: integer
          minimum: 1
        pixel_height:
          type: integer
          minimum: 1
        hash:
          type: string
        printed_file_name:
          type: string
      additionalProperties: false
    PlannedLine:
      type: object
      required:
        - request
        - product
      properties:
        request:
          $ref: '#/components/schemas/OrderLine'
        product:
          $ref: '#/components/schemas/Product'
      additionalProperties: false
    AssetRole:
      type: string
      enum:
        - artwork
        - background
        - individual
        - team
        - logo
        - front
        - back
    Product:
      type: object
      required:
        - id
        - revision
        - name
        - description
        - category
        - fulfillment_type
        - tax_category
        - physical_output
        - units_per_quantity
        - options
        - unit_costs
        - asset_requirements
      properties:
        id:
          type: string
          description: Stable canonical product identifier.
        revision:
          type: integer
          minimum: 1
          description: Immutable fulfillment-contract revision.
        name:
          type: string
        description:
          type: string
        category:
          type: string
          enum:
            - prints
            - keepsakes
            - trader-products
            - composites
        fulfillment_type:
          type: string
          const: print
        tax_category:
          type: string
          const: physical_print
        physical_output:
          $ref: '#/components/schemas/PhysicalOutput'
        units_per_quantity:
          type: integer
          minimum: 1
          description: Physical units produced by one line quantity.
        options:
          type: array
          items:
            $ref: '#/components/schemas/ProductOption'
        unit_costs:
          type: array
          items:
            $ref: '#/components/schemas/UnitCost'
        asset_requirements:
          type: array
          items:
            $ref: '#/components/schemas/AssetRequirement'
      additionalProperties: false
    PhysicalOutput:
      type: object
      required:
        - width
        - height
        - unit
      properties:
        width:
          type: number
          exclusiveMinimum: 0
        height:
          type: number
          exclusiveMinimum: 0
        unit:
          type: string
          const: inches
      additionalProperties: false
    ProductOption:
      type: object
      required:
        - id
        - name
        - values
        - default_value
      properties:
        id:
          type: string
        name:
          type: string
        values:
          type: array
          items:
            type: string
        default_value:
          type: string
      additionalProperties: false
    UnitCost:
      type: object
      required:
        - option_values
      properties:
        option_values:
          type: array
          items:
            $ref: '#/components/schemas/OptionSelection'
        unit_cost_cents:
          type:
            - integer
            - 'null'
          minimum: 0
      additionalProperties: false
    AssetRequirement:
      type: object
      required:
        - role
        - aspect_ratio
        - required
      properties:
        role:
          $ref: '#/components/schemas/AssetRole'
        aspect_ratio:
          $ref: '#/components/schemas/AspectRatio'
        required:
          type: boolean
      additionalProperties: false
    AspectRatio:
      type: object
      required:
        - width
        - height
      properties:
        width:
          type: integer
          minimum: 1
        height:
          type: integer
          minimum: 1
      additionalProperties: false
  responses:
    InvalidRequestJSON:
      description: >-
        The body was malformed, contained unknown fields, or was not exactly one
        JSON object.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RequestTooLarge:
      description: The body exceeded 2 MiB.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    OrderValidationFailed:
      description: >-
        The order did not satisfy the catalog, option, quantity, address, or
        prepared-media requirements.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

````