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

# Create a purchase order

> Drafts an order. Nothing is on order and nothing touches availability
until the order is marked as ordered and then received.

`currency` defaults to the store's; set it for a foreign-currency
order. `expected_at` is a calendar date (`yyyy-mm-dd`) — the day the
supplier promised means the same day in every timezone.


**Required scope:** `write_purchasing` (for API-key authentication).



## OpenAPI

````yaml /api-reference/admin.yaml post /api/v3/admin/purchase_orders
openapi: 3.0.3
info:
  title: Admin API
  contact:
    name: Spree Commerce
    url: https://spreecommerce.org
    email: hello@spreecommerce.org
  description: >
    Spree Admin API v3 - Administrative API for managing products, orders, and
    store settings.


    ## Authentication


    The Admin API requires a secret API key passed in the `x-spree-api-key`
    header.

    Secret API keys can be generated in the Spree admin dashboard.


    ## Response Format


    All responses are JSON. List endpoints return paginated responses with
    `data` and `meta` keys.

    Single resource endpoints return a flat JSON object.


    ## Resource IDs


    Every resource is identified by an opaque string ID (e.g. `prod_86Rf07xd4z`,

    `variant_k5nR8xLq`, `or_UkLWZg9DAJ`). Use these IDs everywhere — URL paths,

    request bodies, and Ransack filters all accept them directly.


    ## Error Handling


    Errors return a consistent format:

    ```json

    {
      "error": {
        "code": "validation_error",
        "message": "Validation failed",
        "details": { "name": ["can't be blank"] }
      }
    }

    ```
  version: v3
servers:
  - url: http://{defaultHost}
    variables:
      defaultHost:
        default: localhost:3000
security: []
tags:
  - name: Authentication
    description: Admin user login, logout, token refresh, and current user profile
  - name: Allowed Origins
    description: CORS allowlist for storefront and admin client origins
  - name: API Keys
    description: Secret and publishable API keys
  - name: Categories
    description: >-
      Hierarchical product categories — tree management, repositioning, and
      product assignments
  - name: Channels
    description: >-
      Sales channels, product publication across channels, and per-channel order
      routing rules
  - name: Custom Fields
    description: >-
      Custom field definitions for products, variants, customers, and other
      resources
  - name: Customer Groups
    description: >-
      Customer groups for segmenting customers (e.g. wholesale, VIP) used by
      pricing and promotions
  - name: Customers
    description: Customer profiles, addresses, credit cards, and store credits
  - name: Email Templates
    description: >-
      Customer email templates, the email layout and shared partials: drafts,
      previews, publishing and history
  - name: Exports
    description: Async CSV exports of admin resources
  - name: Files
    description: Uploading the files that product media, imports, logos and documents use
  - name: Fulfillments
    description: Order fulfillments — shipments, fulfill, cancel, resume, split
  - name: Gift Cards
    description: Gift cards and gift card batches
  - name: Imports
    description: >-
      Async CSV imports of admin resources, with per-row status and failed-row
      retry
  - name: Markets
    description: >-
      Markets — geographic groupings of countries used for pricing, tax, and
      fulfillment rules
  - name: Option Types
    description: >-
      Option types and option values used to build product variants (e.g. Size,
      Color)
  - name: Orders
    description: Orders, order items, applied gift cards, and applied store credits
  - name: Payment Methods
    description: Configured payment providers and their available types
  - name: Payments
    description: Order payments — list, capture, void
  - name: Pricing
    description: >-
      Prices and price lists for currency-, market-, and customer-group-specific
      pricing
  - name: Products
    description: >-
      Products, taxons/categories, product custom field values, and bulk product
      operations
  - name: Policies
    description: The store's legal documents — terms of service, privacy, returns, shipping
  - name: Reasons
    description: >-
      Merchant-owned vocabularies for why a return, claim, refund, cancellation
      or tax exemption happened
  - name: Promotions
    description: Promotions, promotion rules, promotion actions, and coupon codes
  - name: Refunds
    description: Order refunds
  - name: Settings
    description: Store-level settings — store profile, tags, and configuration
  - name: Staff
    description: Admin users, roles, and invitations to the store
  - name: Stock Locations
    description: Warehouses and physical fulfillment locations
  - name: Store Credits
    description: Prepaid customer balances across all customers, and each balance's ledger
  - name: Variants
    description: >-
      Product variants — the individual SKUs (size/color combinations) sold
      under a product
  - name: Webhooks
    description: Webhook endpoints and webhook delivery history
paths:
  /api/v3/admin/purchase_orders:
    post:
      tags:
        - Purchase Orders
      summary: Create a purchase order
      description: |-
        Drafts an order. Nothing is on order and nothing touches availability
        until the order is marked as ordered and then received.

        `currency` defaults to the store's; set it for a foreign-currency
        order. `expected_at` is a calendar date (`yyyy-mm-dd`) — the day the
        supplier promised means the same day in every timezone.


        **Required scope:** `write_purchasing` (for API-key authentication).
      parameters:
        - name: x-spree-api-key
          in: header
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          description: Bearer token for admin authentication
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseOrderCreateParams'
        required: true
      responses:
        '201':
          description: purchase order created
          content:
            application/json:
              example:
                id: po_gbHJdmfrXB
                number: PO1002
                status: draft
                currency: USD
                reference: SUP-8891
                notes: null
                metadata: {}
                close_reason: null
                items_count: 1
                quantity_received_total: 0
                quantity_rejected_total: 0
                ordered_at: null
                received_at: null
                closed_short_at: null
                created_at: '2026-01-15T12:00:00.000Z'
                updated_at: '2026-01-15T12:00:00.000Z'
                expected_at: '2026-10-01'
                cancel_by: null
                closed_short: false
                quantity_ordered_total: 100
                editable: true
                subtotal: '1250.00'
                supplier_id: sup_UkLWZg9DAJ
                destination_location_id: sloc_UkLWZg9DAJ
              schema:
                $ref: '#/components/schemas/PurchaseOrder'
        '404':
          description: supplier belongs to another store
          content:
            application/json:
              example:
                error:
                  code: record_not_found
                  message: Supplier not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key: []
          bearer_auth: []
      x-codeSamples:
        - lang: javascript
          label: Spree Admin SDK
          source: |-
            import { createAdminClient } from '@spree/admin-sdk'

            const client = createAdminClient({
              baseUrl: 'https://your-store.com',
              secretKey: 'sk_xxx',
            })

            const purchaseOrder = await client.purchaseOrders.create({
              supplier_id: 'sup_1234567890',
              destination_location_id: 'sloc_1234567890',
              expected_at: '2026-10-01',
              items: [{ variant_id: 'variant_1234567890', quantity_ordered: 100, unit_cost: '12.50' }],
            })
        - lang: bash
          label: Spree CLI
          source: >-
            spree api post /purchase_orders -d
            '{"supplier_id":"sup_1234567890","destination_location_id":"sloc_1234567890","expected_at":"2026-10-01","items":[{"variant_id":"variant_1234567890","quantity_ordered":100,"unit_cost":"12.50"}]}'
components:
  schemas:
    PurchaseOrderCreateParams:
      type: object
      properties:
        supplier_id:
          type: string
          example: sup_1234567890
        destination_location_id:
          type: string
          example: sloc_1234567890
        currency:
          allOf:
            - $ref: '#/components/schemas/CurrencyCode'
          description: >-
            Defaults to the store's currency; set it for a foreign-currency
            order.
          example: USD
          nullable: true
        expected_at:
          type: string
          format: date
          description: The day the supplier promised. `null` clears it.
          example: '2026-10-01'
          nullable: true
        cancel_by:
          type: string
          format: date
          description: >-
            The day after which the goods are no longer wanted. `null` clears
            it.
          nullable: true
        reference:
          type: string
          description: The supplier's own order number. `null` clears it.
          nullable: true
        notes:
          type: string
          nullable: true
        items:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseOrderItemParams'
          description: Sending the list replaces whatever the order currently holds.
        metadata:
          type: object
          additionalProperties: true
          nullable: true
      required:
        - supplier_id
        - destination_location_id
    PurchaseOrder:
      type: object
      properties:
        id:
          type: string
        number:
          type: string
        status:
          anyOf:
            - type: string
              enum:
                - draft
                - ordered
                - partially_received
                - received
                - over_received
                - canceled
            - type: string
          description: The values listed are the built-in ones; extensions may add more.
        currency:
          type: string
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - ANG
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BRL
            - BSD
            - BTN
            - BWP
            - BYN
            - BYR
            - BZD
            - CAD
            - CDF
            - CHF
            - CLF
            - CLP
            - CNY
            - COP
            - CRC
            - CUC
            - CUP
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EEK
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GTQ
            - GYD
            - HKD
            - HNL
            - HRK
            - HTG
            - HUF
            - IDR
            - ILS
            - INR
            - IQD
            - IRR
            - ISK
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LTL
            - LVL
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRO
            - MRU
            - MTL
            - MUR
            - MVR
            - MWK
            - MXN
            - MYR
            - MZN
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - RWF
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SKK
            - SLE
            - SLL
            - SOS
            - SRD
            - SSP
            - STD
            - STN
            - SVC
            - SYP
            - SZL
            - THB
            - TJS
            - TMM
            - TMT
            - TND
            - TOP
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UGX
            - USD
            - UYI
            - UYU
            - UYW
            - UZS
            - VED
            - VEF
            - VES
            - VND
            - VUV
            - WST
            - XAF
            - XCD
            - XCG
            - XOF
            - XPF
            - YER
            - ZAR
            - ZMK
            - ZMW
            - ZWD
            - ZWG
            - ZWL
            - ZWN
            - ZWR
        reference:
          type: string
          nullable: true
        notes:
          type: string
          nullable: true
        metadata:
          type: object
        close_reason:
          type: string
          nullable: true
        items_count:
          type: number
        quantity_received_total:
          type: number
        quantity_rejected_total:
          type: number
        ordered_at:
          type: string
          nullable: true
        received_at:
          type: string
          nullable: true
        closed_short_at:
          type: string
          nullable: true
        created_at:
          type: string
        updated_at:
          type: string
        expected_at:
          type: string
          nullable: true
        cancel_by:
          type: string
          nullable: true
        closed_short:
          type: boolean
        quantity_ordered_total:
          type: number
        editable:
          type: boolean
        subtotal:
          type: string
        supplier_id:
          type: string
          nullable: true
        destination_location_id:
          type: string
          nullable: true
        items:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseOrderItem'
        stock_receipts:
          type: array
          items:
            $ref: '#/components/schemas/StockReceipt'
        supplier:
          $ref: '#/components/schemas/Supplier'
        destination_location:
          $ref: '#/components/schemas/StockLocation'
      required:
        - id
        - number
        - status
        - currency
        - reference
        - notes
        - metadata
        - close_reason
        - items_count
        - quantity_received_total
        - quantity_rejected_total
        - ordered_at
        - received_at
        - closed_short_at
        - created_at
        - updated_at
        - expected_at
        - cancel_by
        - closed_short
        - quantity_ordered_total
        - editable
        - subtotal
        - supplier_id
        - destination_location_id
      x-typelizer: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: record_not_found
            message:
              type: string
              example: Record not found
            details:
              type: object
              description: Field-specific validation errors
              nullable: true
              example:
                name:
                  - is too short
                  - is required
                email:
                  - is invalid
          required:
            - code
            - message
      required:
        - error
      example:
        error:
          code: validation_error
          message: Validation failed
          details:
            name:
              - is too short
            email:
              - is invalid
    CurrencyCode:
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BYR
        - BZD
        - CAD
        - CDF
        - CHF
        - CLF
        - CLP
        - CNY
        - COP
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EEK
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - IRR
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LTL
        - LVL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRO
        - MRU
        - MTL
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SKK
        - SLE
        - SLL
        - SOS
        - SRD
        - SSP
        - STD
        - STN
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMM
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYI
        - UYU
        - UYW
        - UZS
        - VED
        - VEF
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XCG
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMK
        - ZMW
        - ZWD
        - ZWG
        - ZWL
        - ZWN
        - ZWR
    PurchaseOrderItemParams:
      type: object
      properties:
        variant_id:
          type: string
          example: variant_1234567890
        quantity_ordered:
          type: integer
          example: 100
        unit_cost:
          type: string
          format: decimal
          pattern: ^-?\d+(\.\d+)?$
          description: What the merchant agreed to pay per unit.
          example: '12.50'
      required:
        - variant_id
        - quantity_ordered
        - unit_cost
    PurchaseOrderItem:
      type: object
      properties:
        id:
          type: string
        quantity_ordered:
          type: number
        quantity_received:
          type: number
        quantity_rejected:
          type: number
        quantity_over:
          type: number
        outstanding:
          type: number
        currency:
          type: string
          nullable: true
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - ANG
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BRL
            - BSD
            - BTN
            - BWP
            - BYN
            - BYR
            - BZD
            - CAD
            - CDF
            - CHF
            - CLF
            - CLP
            - CNY
            - COP
            - CRC
            - CUC
            - CUP
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EEK
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GTQ
            - GYD
            - HKD
            - HNL
            - HRK
            - HTG
            - HUF
            - IDR
            - ILS
            - INR
            - IQD
            - IRR
            - ISK
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LTL
            - LVL
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRO
            - MRU
            - MTL
            - MUR
            - MVR
            - MWK
            - MXN
            - MYR
            - MZN
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - RWF
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SKK
            - SLE
            - SLL
            - SOS
            - SRD
            - SSP
            - STD
            - STN
            - SVC
            - SYP
            - SZL
            - THB
            - TJS
            - TMM
            - TMT
            - TND
            - TOP
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UGX
            - USD
            - UYI
            - UYU
            - UYW
            - UZS
            - VED
            - VEF
            - VES
            - VND
            - VUV
            - WST
            - XAF
            - XCD
            - XCG
            - XOF
            - XPF
            - YER
            - ZAR
            - ZMK
            - ZMW
            - ZWD
            - ZWG
            - ZWL
            - ZWN
            - ZWR
        created_at:
          type: string
        updated_at:
          type: string
        unit_cost:
          type: string
        total_cost:
          type: string
        purchase_order_id:
          type: string
          nullable: true
        variant_id:
          type: string
          nullable: true
        product_id:
          type: string
          nullable: true
        variant_name:
          type: string
          nullable: true
        variant_sku:
          type: string
          nullable: true
        options_text:
          type: string
          nullable: true
        thumbnail_url:
          type: string
          nullable: true
      required:
        - id
        - quantity_ordered
        - quantity_received
        - quantity_rejected
        - quantity_over
        - outstanding
        - currency
        - created_at
        - updated_at
        - unit_cost
        - total_cost
        - purchase_order_id
        - variant_id
        - product_id
        - variant_name
        - variant_sku
        - options_text
        - thumbnail_url
      x-typelizer: true
    StockReceipt:
      type: object
      properties:
        id:
          type: string
        number:
          type: string
        reference:
          type: string
          nullable: true
        notes:
          type: string
          nullable: true
        metadata:
          type: object
        quantity_accepted_total:
          type: number
        quantity_rejected_total:
          type: number
        received_at:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
        receivable_type:
          type: string
          enum:
            - purchase_order
            - stock_transfer
        receivable_id:
          type: string
        received_by_id:
          type: string
          nullable: true
        received_by_type:
          anyOf:
            - type: string
              enum:
                - admin_user
                - api_key
            - type: string
              nullable: true
          description: The values listed are the built-in ones; extensions may add more.
        received_by:
          $ref: '#/components/schemas/Actor'
        items_count:
          type: number
        items:
          type: array
          items:
            $ref: '#/components/schemas/StockReceiptItem'
      required:
        - id
        - number
        - reference
        - notes
        - metadata
        - quantity_accepted_total
        - quantity_rejected_total
        - received_at
        - created_at
        - updated_at
        - receivable_type
        - receivable_id
        - received_by_id
        - received_by_type
        - items_count
      x-typelizer: true
    Supplier:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        contact_name:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        notes:
          type: string
          nullable: true
        address1:
          type: string
          nullable: true
        address2:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        state_name:
          type: string
          nullable: true
        state_code:
          type: string
          nullable: true
        country_code:
          type: string
          nullable: true
          enum:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AR
            - AS
            - AT
            - AU
            - AW
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BF
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GT
            - GU
            - GW
            - GY
            - HK
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IM
            - IN
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - YE
            - YT
            - ZA
            - ZM
            - ZW
        postal_code:
          type: string
          nullable: true
        purchase_orders_count:
          type: number
        metadata:
          type: object
        created_at:
          type: string
        updated_at:
          type: string
        deleted_at:
          type: string
          nullable: true
        can_be_deleted:
          type: boolean
      required:
        - id
        - name
        - contact_name
        - email
        - phone
        - notes
        - address1
        - address2
        - city
        - state_name
        - state_code
        - country_code
        - postal_code
        - purchase_orders_count
        - metadata
        - created_at
        - updated_at
        - deleted_at
        - can_be_deleted
      x-typelizer: true
    StockLocation:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        address1:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        zipcode:
          type: string
          nullable: true
        country_code:
          type: string
          nullable: true
          enum:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AR
            - AS
            - AT
            - AU
            - AW
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BF
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GT
            - GU
            - GW
            - GY
            - HK
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IM
            - IN
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - YE
            - YT
            - ZA
            - ZM
            - ZW
        country_name:
          type: string
          nullable: true
        state_code:
          type: string
          nullable: true
        state_text:
          type: string
          nullable: true
        pickup_ready_in_minutes:
          type: number
          nullable: true
        pickup_instructions:
          type: string
          nullable: true
        external_references:
          type: object
        admin_name:
          type: string
          nullable: true
        address2:
          type: string
          nullable: true
        state_name:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        company:
          type: string
          nullable: true
        active:
          type: boolean
        default:
          type: boolean
        backorderable_default:
          type: boolean
        propagate_all_variants:
          type: boolean
        kind:
          anyOf:
            - type: string
              enum:
                - warehouse
                - store
                - fulfillment_center
            - type: string
          description: The values listed are the built-in ones; extensions may add more.
        pickup_enabled:
          type: boolean
        pickup_stock_policy:
          type: string
          enum:
            - local
            - any
        returns_enabled:
          type: boolean
        created_at:
          type: string
        updated_at:
          type: string
        seller_id:
          type: string
          nullable: true
        seller_name:
          type: string
          nullable: true
        seller:
          $ref: '#/components/schemas/Seller'
      required:
        - id
        - name
        - address1
        - city
        - zipcode
        - country_code
        - country_name
        - state_code
        - state_text
        - pickup_ready_in_minutes
        - pickup_instructions
        - external_references
        - admin_name
        - address2
        - state_name
        - phone
        - company
        - active
        - default
        - backorderable_default
        - propagate_all_variants
        - kind
        - pickup_enabled
        - pickup_stock_policy
        - returns_enabled
        - created_at
        - updated_at
        - seller_id
        - seller_name
      x-typelizer: true
    Actor:
      type: object
      properties:
        id:
          type: string
        type:
          anyOf:
            - type: string
              enum:
                - admin_user
                - api_key
            - type: string
          description: The values listed are the built-in ones; extensions may add more.
        label:
          type: string
          nullable: true
      required:
        - id
        - type
        - label
      x-typelizer: true
    StockReceiptItem:
      type: object
      properties:
        id:
          type: string
        quantity_accepted:
          type: number
        quantity_rejected:
          type: number
        rejection_reason:
          type: string
          nullable: true
          enum:
            - damaged
            - wrong_item
            - expired
            - other
        notes:
          type: string
          nullable: true
        line_type:
          type: string
          enum:
            - purchase_order_item
            - stock_transfer_item
        line_id:
          type: string
          nullable: true
        variant_id:
          type: string
          nullable: true
        product_id:
          type: string
          nullable: true
        variant_name:
          type: string
          nullable: true
        variant_sku:
          type: string
          nullable: true
        thumbnail_url:
          type: string
          nullable: true
      required:
        - id
        - quantity_accepted
        - quantity_rejected
        - rejection_reason
        - notes
        - line_type
        - line_id
        - variant_id
        - product_id
        - variant_name
        - variant_sku
        - thumbnail_url
      x-typelizer: true
    Seller:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        about:
          type: string
        about_html:
          type: string
        logo_url:
          type: string
          nullable: true
        square_logo_url:
          type: string
          nullable: true
        cover_photo_url:
          type: string
          nullable: true
        status:
          anyOf:
            - type: string
              enum:
                - pending
                - invited
                - canceled
                - onboarding
                - ready_for_review
                - approved
                - rejected
                - suspended
            - type: string
          description: The values listed are the built-in ones; extensions may add more.
        contact_email:
          type: string
          nullable: true
        billing_email:
          type: string
          nullable: true
        tax_remittance:
          type: string
          enum:
            - seller
            - platform
        payouts_schedule_interval:
          type: string
          nullable: true
          enum:
            - daily
            - weekly
            - biweekly
            - monthly
            - manual
        metadata:
          type: object
          nullable: true
        holiday_mode_until:
          type: string
          nullable: true
        terms_accepted_at:
          type: string
          nullable: true
        created_at:
          type: string
        updated_at:
          type: string
        deleted_at:
          type: string
          nullable: true
        minimum_payout_amount:
          type: string
          nullable: true
        on_holiday:
          type: boolean
        sellable:
          type: boolean
        products_count:
          type: number
        users_count:
          type: number
        onboarding_progress:
          type: object
        onboarding_complete:
          type: boolean
        legal_name:
          type: string
          nullable: true
        registration_number:
          type: string
          nullable: true
        billing_address:
          $ref: '#/components/schemas/Address'
        returns_address:
          $ref: '#/components/schemas/Address'
      required:
        - id
        - name
        - slug
        - about
        - about_html
        - logo_url
        - square_logo_url
        - cover_photo_url
        - status
        - contact_email
        - billing_email
        - tax_remittance
        - payouts_schedule_interval
        - metadata
        - holiday_mode_until
        - terms_accepted_at
        - created_at
        - updated_at
        - deleted_at
        - minimum_payout_amount
        - on_holiday
        - sellable
        - products_count
        - users_count
        - onboarding_progress
        - onboarding_complete
        - legal_name
        - registration_number
      x-typelizer: true
    Address:
      type: object
      properties:
        id:
          type: string
        label:
          type: string
          nullable: true
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
        full_name:
          type: string
        address1:
          type: string
          nullable: true
        address2:
          type: string
          nullable: true
        postal_code:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        company:
          type: string
          nullable: true
        country_name:
          type: string
        country_code:
          type: string
          enum:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AR
            - AS
            - AT
            - AU
            - AW
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BF
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GT
            - GU
            - GW
            - GY
            - HK
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IM
            - IN
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - YE
            - YT
            - ZA
            - ZM
            - ZW
        state_text:
          type: string
          nullable: true
        state_code:
          type: string
          nullable: true
        quick_checkout:
          type: boolean
        is_default_billing:
          type: boolean
        is_default_shipping:
          type: boolean
        state_name:
          type: string
          nullable: true
        owner:
          allOf:
            - $ref: '#/components/schemas/AddressOwner'
          nullable: true
        metadata:
          type: object
        created_at:
          type: string
        updated_at:
          type: string
        latitude:
          type: number
          nullable: true
        longitude:
          type: number
          nullable: true
        customer_id:
          type: string
          nullable: true
      required:
        - id
        - label
        - first_name
        - last_name
        - full_name
        - address1
        - address2
        - postal_code
        - city
        - phone
        - company
        - country_name
        - country_code
        - state_text
        - state_code
        - quick_checkout
        - is_default_billing
        - is_default_shipping
        - state_name
        - owner
        - metadata
        - created_at
        - updated_at
        - latitude
        - longitude
        - customer_id
      x-typelizer: true
    AddressOwner:
      type: object
      properties:
        id:
          type: string
        type:
          anyOf:
            - type: string
              enum:
                - customer
                - company
                - seller
            - type: string
          description: The values listed are the built-in ones; extensions may add more.
        name:
          type: string
          nullable: true
      required:
        - id
        - type
        - name
      x-typelizer: true
  securitySchemes:
    api_key:
      type: apiKey
      name: x-spree-api-key
      in: header
      description: Secret API key for admin access
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token for admin user authentication

````

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