---
title: "Create purchase order"
method: POST
path: "/v1/purchase-orders"
tags: ["v1 - Purchase Orders"]
---

# Create purchase order

`POST /v1/purchase-orders`

## Request

- Base URL: `https://light.inc` (the document declares no server; this is the origin it was published from)
- URL: `https://light.inc/v1/purchase-orders`
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer

Creates a new purchase order

## Request body

- ExternalCreatePurchaseOrderRequestV1Model
  - `vendorId` string, uuid, nullable
  - `companyEntityId` string, uuid, nullable
  - `ownerId` string, uuid, nullable
  - `currency` string, nullable
  - `purchaseOrderDate` string, date, nullable
  - `deliveryAddress` string, nullable
  - `deliveryDate` string, date, nullable
  - `description` string, nullable
  - `lines` ExternalCreatePurchaseOrderLineRequestV1Model[]
    - `description` string
    - `costCenterId` string, uuid
    - `accountId` string, uuid
    - `taxCodeId` string, uuid
    - `quantity` number
    - `unitPrice` integer
    - `customProperties` ExternalSetCustomPropertyRequestV1Model[]
      - `groupId` string, uuid: ID of the custom property group.
      - `valueIds` string[]: IDs of the selected custom property values. It behaves as a PUT operation, so if empty the existing ones will be effectively deleted.
      - `inlineValues` string[], nullable: Inline custom property values (used for TEXT/NUMERIC/DATE/etc. groups). It behaves as a PUT operation, so if empty or null the existing ones will be effectively deleted.
  - `customProperties` ExternalSetCustomPropertyRequestV1Model[], nullable
    - `groupId` string, uuid: ID of the custom property group.
    - `valueIds` string[]: IDs of the selected custom property values. It behaves as a PUT operation, so if empty the existing ones will be effectively deleted.
    - `inlineValues` string[], nullable: Inline custom property values (used for TEXT/NUMERIC/DATE/etc. groups). It behaves as a PUT operation, so if empty or null the existing ones will be effectively deleted.

## Response `default`

default response

- ExternalPurchaseOrderV1Model
  - `id` string, uuid
  - `companyId` string, uuid
  - `createdBy` string, uuid
  - `companyEntityId` string, uuid
  - `purchaseRequestId` string, uuid
  - `state` 'IN_DRAFT' | 'RESET_PENDING' | 'APPROVED_ACCOUNTING_ENTRY_PENDING' | 'OPEN' | 'CLOSE_PENDING' | 'CLOSED' | 'CANCEL_PENDING' | 'CANCELLED': ⚠️ This enum is not exhaustive; new values may be added in the future.
  - `totalAmount` integer
  - `totalNetAmount` integer
  - `totalTaxAmount` integer
  - `erpNumber` string
  - `description` string
  - `currency` string
  - `ownerId` string, uuid
  - `vendorId` string, uuid
  - `vendorEmail` string
  - `deliveryAddress` string
  - `deliveryDate` string, date
  - `documentKey` string
  - `failureContext` ExternalUiClientExceptionV1Model, nullable: Failure context when vendor onboarding fails.
    - `name` string: The error name
    - `type` 'BAD_REQUEST' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'NOT_FOUND' | 'CONFLICT' | 'UNPROCESSABLE_CONTENT': The error type ⚠️ This enum is not exhaustive; new values may be added in the future.
    - `errors` ExternalUiClientExceptionErrorV1Model[]: List of errors providing details about what went wrong
      - `type` string: A string code identifying the error type
      - `message` string: A human-readable message providing more details about the error
      - `path` string[], nullable: Optional path of the error when the error is for a specific field. Used mostly on BAD_REQUEST errors, that path will match the field name on the request object
      - `context` object, nullable: Optional context providing additional information about the error. This can include any relevant data that might help in understanding or resolving the error
  - `editStatus` 'ALL_EDITS_ALLOWED' | 'ALL_EDITS_LOCKED' | 'CORE_EDITS_LOCKED': ⚠️ This enum is not exhaustive; new values may be added in the future.
  - `purchaseOrderDate` string, date
  - `erpSyncedAt` string, date-time
  - `lockedAt` string, date-time
  - `closedAt` string, date-time
  - `cancelledAt` string, date-time
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `lines` ExternalPurchaseOrderLineV1Model[]
    - `id` string, uuid
    - `companyId` string, uuid
    - `purchaseOrderId` string, uuid
    - `description` string
    - `costCenterId` string, uuid
    - `accountId` string, uuid
    - `taxCodeId` string, uuid
    - `quantity` number
    - `unitPrice` integer
    - `amount` integer
    - `netAmount` integer
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `customProperties` ExternalCustomPropertyV1Model[]
      - `groupId` string, uuid: ID of the custom property group
      - `groupInternalName` string: Internal name of the custom property group
      - `values` ExternalCustomPropertyValueV1Model[]: List of values. Note that this will be a single value unless the group input type supports multiple values
        - `id` string, uuid: Unique identifier for the object
        - `groupId` string, uuid: ID of the custom property group
        - `groupInternalName` string: Internal name of the custom property group
        - `companyId` string, uuid: ID of the company
        - `internalName` string: Internal name of the custom property value
        - `label` string: Label of the custom property value
        - `context` string, nullable: Context/description of the custom property value
        - `createdAt` string, date-time: Timestamp when the custom property value was created
        - `updatedAt` string, date-time: Timestamp when the custom property value was last updated
  - `customProperties` ExternalCustomPropertyV1Model[]
    - `groupId` string, uuid: ID of the custom property group
    - `groupInternalName` string: Internal name of the custom property group
    - `values` ExternalCustomPropertyValueV1Model[]: List of values. Note that this will be a single value unless the group input type supports multiple values
      - `id` string, uuid: Unique identifier for the object
      - `groupId` string, uuid: ID of the custom property group
      - `groupInternalName` string: Internal name of the custom property group
      - `companyId` string, uuid: ID of the company
      - `internalName` string: Internal name of the custom property value
      - `label` string: Label of the custom property value
      - `context` string, nullable: Context/description of the custom property value
      - `createdAt` string, date-time: Timestamp when the custom property value was created
      - `updatedAt` string, date-time: Timestamp when the custom property value was last updated

---

[API](https://skmtc.dev/light/apis/light-api.md) - [All operations](https://skmtc.dev/light/apis/light-api/llms.txt) - [OpenAPI document](https://skmtc.dev/light/apis/light-api/revisions/84f51306f648?raw)
