# Close purchase order

> Closes a purchase order

`POST https://api.light.inc/v1/purchase-orders/{purchaseOrderId}/close`

## Note

Only from OPEN , giving CLOSE_PENDING (with closedAt set) and then CLOSED in the background. Matched bills are not affected. A bill's submit-for-approval with closePurchaseOrder: true closes the matched order the same way.

## Authorization

- API key
- Bearer token

See https://light.inc/docs/getting-started/authentication.

## Path parameters

- `purchaseOrderId` (string, uuid, required)


## Response

- `erpNumber` — Assigned when the order reaches `OPEN`, after the ERP confirms the lock in the background; `null` before that.
- `editStatus` — `ALL_EDITS_LOCKED` from `lock` onwards; `CORE_EDITS_LOCKED` on drafts created from a purchase request (vendor, entity, currency, line quantities and prices, and adding or removing lines are frozen). Not returned by the list endpoint.

```json
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "purchaseRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "state": "IN_DRAFT",
  "totalAmount": 100000,
  "totalNetAmount": 100000,
  "totalTaxAmount": 100000,
  "erpNumber": "string",
  "description": "string",
  "currency": "USD",
  "ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "vendorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "vendorEmail": "string",
  "deliveryAddress": "string",
  "deliveryDate": "2026-01-15",
  "documentKey": "string",
  "failureContext": {
    "name": "string",
    "type": "BAD_REQUEST",
    "errors": [
      {
        "type": "string",
        "message": "string",
        "path": [
          "string"
        ],
        "context": null
      }
    ]
  },
  "editStatus": "ALL_EDITS_ALLOWED",
  "purchaseOrderDate": "2026-01-15",
  "erpSyncedAt": "2026-01-15T09:30:00Z",
  "lockedAt": "2026-01-15T09:30:00Z",
  "closedAt": "2026-01-15T09:30:00Z",
  "cancelledAt": "2026-01-15T09:30:00Z",
  "createdAt": "2026-01-15T09:30:00Z",
  "updatedAt": "2026-01-15T09:30:00Z",
  "lines": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "purchaseOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "description": "string",
      "costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "quantity": 0,
      "unitPrice": 100000,
      "amount": 100000,
      "netAmount": 100000,
      "createdAt": "2026-01-15T09:30:00Z",
      "updatedAt": "2026-01-15T09:30:00Z",
      "customProperties": [
        {
          "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "groupInternalName": "string",
          "values": [
            {}
          ]
        }
      ]
    }
  ],
  "customProperties": [
    {
      "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "groupInternalName": "string",
      "values": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "groupInternalName": "string",
          "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "internalName": "string",
          "label": "string",
          "context": "string",
          "createdAt": "2026-01-15T09:30:00Z",
          "updatedAt": "2026-01-15T09:30:00Z"
        }
      ]
    }
  ]
}
```

Values above are generated from the schema: the shapes and types are real, the values are placeholders.

## Code

```bash
curl -X POST "https://api.light.inc/v1/purchase-orders/3c90c3cc-0d44-4b50-8888-8dd25736052a/close" \
  -H "Authorization: Basic YOUR_API_KEY"
```

---

Full page: https://light.inc/docs/api-reference/v1--purchase-orders/close-purchase-order · Index: https://light.inc/docs/llms.txt
