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

# Find a customer's earlier orders

> The MCP's previous_orders. With the email the customer ordered with, ProvenMetal emails them a 6-digit code if it
has orders for that email; with the email and that code, their own paid or requested orders and a history_token
for 60 minutes; with history_token alone, the same list again.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/previous-orders
openapi: 3.1.0
info:
  title: ProvenMetal API
  version: 1.0.0
  description: >-
    Everything the ProvenMetal MCP does, over HTTP with an API key: upload a
    design, get a live JLCPCB quote and checkout link, follow it to delivery,
    pay with saved details, and check parts and designs. Formal quotes for any
    fab or assembler are under Orders.
servers:
  - url: https://api.provenmetal.com
security:
  - ApiKey: []
tags:
  - name: Uploads
  - name: Quotes
  - name: Saved details
  - name: Checks
  - name: Buy links
  - name: Orders
  - name: Account
paths:
  /v1/previous-orders:
    post:
      tags:
        - Ordering again
      summary: Find a customer's earlier orders
      description: >-
        The MCP's previous_orders. With the email the customer ordered with,
        ProvenMetal emails them a 6-digit code if it

        has orders for that email; with the email and that code, their own paid
        or requested orders and a history_token

        for 60 minutes; with history_token alone, the same list again.
      operationId: previous_orders_v1_previous_orders_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreviousOrdersRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreviousOrdersReply'
        '422':
          description: >-
            A field was refused, or the design needs an answer first
            (needs_details...)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorReply'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorReply'
          description: Client Error
        5XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorReply'
          description: Server Error
components:
  schemas:
    PreviousOrdersRequest:
      properties:
        email:
          anyOf:
            - type: string
              maxLength: 254
            - type: 'null'
          title: Email
          description: >-
            The email the customer ordered with, as they gave it; never guess
            one.
        code:
          anyOf:
            - type: string
              maxLength: 12
            - type: 'null'
          title: Code
          description: The 6-digit code from ProvenMetal's email.
        history_token:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: History Token
          description: 'From an earlier reply: lists the orders again for 60 minutes.'
      additionalProperties: false
      type: object
      title: PreviousOrdersRequest
      description: >-
        Everything the MCP previous_orders tool takes: the email alone asks for
        a code, the email and the code list

        the orders, and history_token alone lists them again.
    PreviousOrdersReply:
      properties:
        ok:
          type: boolean
          title: Ok
        sent_to:
          anyOf:
            - type: string
            - type: 'null'
          title: Sent To
          description: 'After the email alone: where the code went, partly hidden.'
        expires_in_minutes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expires In Minutes
        history_token:
          anyOf:
            - type: string
            - type: 'null'
          title: History Token
          description: For POST /v1/reorders and to list the orders again, 60 minutes.
        orders:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Orders
          description: >-
            The customer's own paid or requested orders: each order_id, board
            options, quantity, BOM choices (customer-supplied and unfitted
            parts, approved substitutions, ProvenMetal picking parts), delivery
            and files.
      additionalProperties: true
      type: object
      required:
        - ok
      title: PreviousOrdersReply
    ErrorReply:
      properties:
        ok:
          type: boolean
          const: false
          title: Ok
          default: false
        error:
          type: string
          title: Error
          description: >-
            The MCP's error code, for example needs_details, rate_limited or
            no_files.
        message:
          type: string
          title: Message
          description: What went wrong and what to do, in words to relay.
        questions:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Questions
          description: >-
            needs_details: each open question with its option, choices and usual
            answer. Answer them and send the same quote again with those fields.
        known:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Known
          description: 'needs_details: what the files already said.'
        parts:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Parts
          description: >-
            needs_part_numbers (and needs_details): the BOM lines to name
            exactly.
        off_board_parts:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Off Board Parts
          description: BOM lines with no pick-and-place position.
        retry_after_s:
          anyOf:
            - type: integer
            - type: 'null'
          title: Retry After S
          description: 'rate_limited: seconds to wait. Also in the Retry-After header.'
        checkout_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Checkout Url
          description: >-
            card_declined / authentication_required: where the customer pays
            instead.
        fields:
          anyOf:
            - items:
                additionalProperties:
                  type: string
                type: object
              type: array
            - type: 'null'
          title: Fields
          description: 'invalid_request: each field that was refused and why.'
      additionalProperties: true
      type: object
      required:
        - error
        - message
      title: ErrorReply
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your ProvenMetal API key (`pm_live_...`). `Authorization: Bearer <key>`
        also works.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.