Sales orders

Get sales order

The Get sales order endpoint returns a single sales order for a given salesOrderId.

Sales orders represent a customer's intention to purchase goods or services from the SMB.

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

get/companies/{companyId}/data/salesOrders/{salesOrderId}

Response

Success

idstring

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

salesOrderNumberstring nullable

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

customerPurchaseOrderNumberstring nullable

A customer-supplied identifier for the purchase order in the customer's system.

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.

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.

notestring nullable

Any additional information associated with the sales order.

customerRefAccountingCustomerRef — unresolved $ref
statusSalesOrderStatus — unresolved $ref
invoicingStatusSalesOrderInvoiceStatus — unresolved $ref
currencyCurrency — unresolved $ref
currencyRateCurrencyRate — unresolved $ref
lineItemsSalesOrderLineItem[] nullable— unresolved $ref

An array of line items.

totalDiscountnumber

Total value of any discounts applied to the sales order.

subTotalnumber

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

totalTaxAmountnumber

Total amount of tax included in the sales order.

totalAmountnumber

Total amount of the sales 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": "string",
  "salesOrderNumber": "string",
  "customerPurchaseOrd erNumber": "string",
  "issueDate": "2022-10-23T00:00:00Z",
  "expectedDeliveryDate": "2022-10-23T00:00:00Z",
  "note": "string",
  "shipTo": {
    "contact": {
      "name": "string",
      "email": "string",
      "phone": "string"
    },
    "address": {
      "type": "Unknown",
      "line1": "string",
      "line2": "string",
      "city": "string",
      "region": "string",
      "country": "string",
      "postalCode": "string"
    }
  },
  "customerRef": {
    "id": "string",
    "companyName": "string"
  },
  "status": "Unknown",
  "invoicingStatus": "Unknown",
  "currency": "GBP",
  "currencyRate": 0,
  "lineItems": [
    {
      "description": "string",
      "accountRef": {
        "id": "string",
        "name": "string"
      },
      "itemRef": {
        "id": "string",
        "name": "string"
      },
      "tracking": {
        "recordRefs": [
          "string"
        ]
      },
      "unitAmount": 0,
      "quantity": 0,
      "discountAmount": 0,
      "discountPercentage": 0,
      "subTotal": 0,
      "taxAmount": 0,
      "taxRateRef": {
        "id": "string",
        "name": "string",
        "effectiveTaxRate": 0
      },
      "totalAmount": 0
    }
  ],
  "totalDiscount": 0,
  "subTotal": 0,
  "totalTaxAmount": 0,
  "totalAmount": 0,
  "metadata": {
    "isDeleted": true
  },
  "modifiedDate": "2022-10-23T00:00:00Z",
  "sourceModifiedDate": "2022-10-23T00:00:00Z"
}