latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-041351024.8 MB

21d41189c461

Purchase orders

Get purchase order

The Get purchase order endpoint returns a single purchase order for a given purchaseOrderId.

Purchase orders represent a business's intent to purchase goods or services from a supplier.

Before using this endpoint, you must have retrieved data for the company.

get/companies/{companyId}/data/purchaseOrders/{purchaseOrderId}

Response

Success

idstring

Identifier for the purchase order, unique for the company in the accounting software.

purchaseOrderNumberstring nullable

Friendly reference for the purchase order, commonly generated by the accounting software.

issueDatestring

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:

2020-10-08T22:40:50Z
2021-01-01T00:00:00

When syncing data that contains DateTime fields from Codat, make sure you support the following cases when reading time information:

  • Coordinated Universal Time (UTC): 2021-11-15T06:00:00Z
  • Unqualified local time: 2021-11-15T01:00:00
  • UTC time offsets: 2021-11-15T01:00:00-05:00

Time zones

Not all dates from Codat will contain information about time zones.
Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced.

paymentDueDatestring

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:

2020-10-08T22:40:50Z
2021-01-01T00:00:00

When syncing data that contains DateTime fields from Codat, make sure you support the following cases when reading time information:

  • Coordinated Universal Time (UTC): 2021-11-15T06:00:00Z
  • Unqualified local time: 2021-11-15T01:00:00
  • UTC time offsets: 2021-11-15T01:00:00-05:00

Time zones

Not all dates from Codat will contain information about time zones.
Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced.

expectedDeliveryDatestring

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:

2020-10-08T22:40:50Z
2021-01-01T00:00:00

When syncing data that contains DateTime fields from Codat, make sure you support the following cases when reading time information:

  • Coordinated Universal Time (UTC): 2021-11-15T06:00:00Z
  • Unqualified local time: 2021-11-15T01:00:00
  • UTC time offsets: 2021-11-15T01:00:00-05:00

Time zones

Not all dates from Codat will contain information about time zones.
Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced.

deliveryDatestring

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:

2020-10-08T22:40:50Z
2021-01-01T00:00:00

When syncing data that contains DateTime fields from Codat, make sure you support the following cases when reading time information:

  • Coordinated Universal Time (UTC): 2021-11-15T06:00:00Z
  • Unqualified local time: 2021-11-15T01:00:00
  • UTC time offsets: 2021-11-15T01:00:00-05:00

Time zones

Not all dates from Codat will contain information about time zones.
Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced.

notestring nullable

Any additional information associated with the purchase order.

shipToShipTo — unresolved $ref
supplierRefSupplierRef — unresolved $ref
statusPurchaseOrderStatus — unresolved $ref
currencyCurrency — unresolved $ref
currencyRateCurrencyRate — unresolved $ref
lineItemsPurchaseOrderLineItem[] nullable— unresolved $ref

Array of line items.

totalDiscountnumber

Total value of any discounts applied to the purchase order.

subTotalnumber

Total amount of the purchase order, including discounts but excluding tax.

totalTaxAmountnumber

Total amount of tax included in the purchase order.

totalAmountnumber

Total amount of the purchase order, including discounts and tax.

modifiedDatestring

The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache.

Use it to identify and retrieve records that have changed since your last fetch. For example, filtering modifiedDate to today will provide new records updated in Codat today.

This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports (read more).

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>.

sourceModifiedDatestring

The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated (read more) when:

  • Pulling attachments
  • The accounting software does not provide modification dates for a data type
  • A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
  • A record has been voided. For certain platforms that soft delete records, isDeleted metadata is used to identify void records

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>.

Example response

{
  "id": "7e2380af-b51f-4393-92d7-6ff0382da26c",
  "purchaseOrderNumber": "89443280",
  "issueDate": "2020-10-24T00:00:00Z",
  "deliveryDate": "2021-02-02T00:00:00Z",
  "expectedDeliveryDate": "2021-01-29T00:00:00Z",
  "paymentDueDate": "2021-09-13T00:00:00Z",
  "note": "purchaseorder with 1 line items, totalling 1138.5",
  "supplierRef": {
    "id": "7ff6add1-b0e7-496f-b655-48e20c8fdb2e",
    "supplierName": "Carlton Innovations"
  },
  "shipTo": {
    "contact": {
      "name": "Carlton Innovations",
      "email": "sales@carltoninnov.com",
      "phone": ""
    },
    "address": {
      "type": "Billing",
      "line1": "1 Carolyns Circle",
      "line2": "",
      "city": "Dallas",
      "region": "Texas",
      "country": "USA",
      "postalCode": "511210"
    }
  },
  "status": "Closed",
  "currency": "GBP",
  "currencyRate": 1,
  "lineItems": [
    {
      "description": "Electric Eye purchase",
      "accountRef": {
        "id": "13931cbf-ea06-4d6e-9538-a8457fa66011",
        "name": "Cost of Goods Sold"
      },
      "itemRef": {
        "id": "9409d23d-1011-432e-98a4-591fcd8d5404",
        "name": "ACME Electric Eye"
      },
      "trackingCategoryRefs": [],
      "unitAmount": 115,
      "quantity": 9,
      "discountAmount": 0,
      "discountPercentage": 0,
      "subTotal": 1035,
      "taxAmount": 103.5,
      "taxRateRef": {
        "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498",
        "name": "ACME Sales Tax (10%)"
      },
      "totalAmount": 1138.5
    }
  ],
  "totalDiscount": 0,
  "subTotal": 1035,
  "totalTaxAmount": 103.5,
  "totalAmount": 1138.5,
  "createdBy": {
    "firstName": "John",
    "lastName": "Smith",
    "email": "john.smith@codat.io"
  },
  "modifiedDate": "2020-11-17T21:11:20Z",
  "sourceModifiedDate": "2020-10-25T06:37:33Z"
}