Sales orders

Explore the Sales Orders endpoints in Swagger.

View the coverage for sales orders in the Data Coverage Explorer.

Overview

A sales order represents a customer's intention to purchase goods or services from a seller and usually includes information such as the expected delivery date and shipping details. This information can be used to provide visibility on a business's expected receivables and to track sales through the full procurement process.

A sales order is typically converted to an invoice after approval.

Data model

Field

Type

Description

id

string

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

salesOrderNumber

string

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

customerPurchaseOrderNumber

string

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

issueDate

date

Date of the sales order as recorded in the accounting platform.

expectedDeliveryDate

date

Expected delivery date for any goods that have been ordered.

note

string

Any additional information associated with the sales order.

shipTo

ShipTo

Delivery details for any goods that have been ordered.

customerRef

customerRef

The customer that the sales order is recorded against in the accounting system.

status

string

Current state of the sales order, either:

  • Draft
  • Open
  • Closed
  • Void
  • Unknown

invoicingStatus

string

If the sales order is converted to an invoice, or will be in future, the invoicingStatus field indicates the current stage of the invoicing process.

Can be one of either:

  • NotInvoiced
  • PartiallyInvoiced
  • Invoiced

currency

string

Currency of the sales order.
See currency

currencyRate

decimal

Rate for converting the total amount of the sales order into the base currency for the company.
See currency rate

lineItems

array

An array of SalesOrderLineItems

totalDiscount

decimal

Total value of any discounts applied to the sales order.

subTotal

decimal

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

totalTaxAmount

decimal

Total amount of tax included in the sales order.

totalAmount

decimal

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

modifiedDate

date

Date the sales order was last updated in the Codat system.

sourceModifiedDate

date

Date the sales order was last changed in the accounting system.

metadata

Metadata

Miscellaneous data about the item.

Lines

Field

Type

Description

description

string

Description of the goods or services that have been ordered.

accountRef

accountRef

Reference to the account to which the line item is linked.

itemRef

itemRef

Reference to the product or inventory item to which the line item is linked.

tracking

array

An array of recordRefs.

unitAmount

decimal

Price of each unit.

quantity

decimal

Number of units that have been ordered.

discountAmount

decimal

Value of any discounts applied.

discountPercentage

decimal

Percentage rate (from 0 to 100) of any discounts applied to the unit amount.

subTotal

decimal

Amount of the line, inclusive of discounts but exclusive of tax.

taxAmount

decimal

Amount of tax for the line.

taxRateRef

TaxRateRef

Reference to the tax rate to which the line item is linked.

totalAmount

decimal

Total amount of the line, inclusive of discounts and tax.

ShipTo

Field

Type

Description

contact

Contact

Details of the named contact at the delivery address.

address

Address

Delivery address for any goods that have been ordered.

Contact

Field

Type

Description

name

string

Name of the contact at the delivery address.

email

string

Email address of the contact at the delivery address.

phone

string

Phone number of the contact at the delivery address.

Metadata

Field

Type

Description

isDeleted

boolean

Whether or not the object has been deleted. Either:

  • null
  • false
  • true

Example sales order

This is a sample sales order from our Sandbox integration. To view more examples, enable sales orders in your sync settings and synchronize data for a company.

{
  "id": "9f3d6a69-f0cb-4152-ab73-42c6eddf7ba2",
  "salesOrderNumber": "d41f457e-a30b-449a-9878-bd659dca1e01",
  "customerPurchaseOrderNumber" : "REF-0001"
  "issueDate": "2021-08-09T00:00:00",
  "expectedDeliveryDate": "2021-08-09T00:00:00",
  "note": "Sales Order with 2 line items, totaling 3903.42",
  "shipTo": {
    "contact": {
      "name": "Orpha Farrell",
      "email": "[email protected]",
      "phone": "055 8086 1319"
    },
    "address": {
      "type": "Delivery",
      "line1": "Suite 491",
      "line2": "0489 Joana Isle",
      "city": "Adalinefurt",
      "region": "Wales",
      "country": "United Kingdom",
      "postalCode": "AP1 3HH"
    }
  },
  "customerRef": {
    "id": "c0cead49-e33c-4caa-b64d-dd79f6856f78",
    "companyName": "Pagac Inc"
  },
  "status": "Void",
  "invoicingStatus": "PartiallyInvoiced",
  "currency": "GBP",
  "currencyRate": 1,
  "lineItems": [
    {
      "description": "Grease Trap",
      "accountRef": {
        "id": "72df89d2-512b-4455-af51-a6b563733842",
        "name": "Sales"
      },
      "itemRef": {
        "id": "9409d23d-1011-432e-98a4-591fcd8d5404",
        "name": "300 Litre Grease Trap"
      },
      "tracking": {
        "recordRefs": [
          {
            "id": "costcode_9",
            "dataType": "trackingCategories"
          },
          {
            "id": "costcode_B13",
            "dataType": "trackingCategories"
          }
        ]
      },
      "unitAmount": 1371.39,
      "quantity": 2,
      "discountAmount": 0,
      "discountPercentage": 0,
      "subTotal": 2742.78,
      "taxAmount": 274.28,
      "taxRateRef": {
        "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498",
        "name": "Sales Tax (10%)",
        "effectiveTaxRate": 10
      },
      "totalAmount": 3017.06
    },
    {
      "description": "Underground - Trapped Road Gully 450mm x 450mm",
      "accountRef": {
        "id": "72df89d2-512b-4455-af51-a6b563733842",
        "name": "Sales"
      },
      "itemRef": {
        "id": "3abf0883-03f7-44c6-bc15-1372522d25e1",
        "name": "Heavy Duty Hinged Gully Grating"
      },
      "unitAmount": 402.89,
      "quantity": 2,
      "discountAmount": 0,
      "discountPercentage": 0,
      "subTotal": 805.78,
      "taxAmount": 80.58,
      "taxRateRef": {
        "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498",
        "name": "Sales Tax (10%)",
        "effectiveTaxRate": 10
      },
      "totalAmount": 886.36
    }
  ],
  "totalDiscount": 0,
  "subTotal": 3548.56,
  "totalTaxAmount": 354.86,
  "totalAmount": 3903.42,
  "modifiedDate": "2022-08-09T14:00:53Z",
  "sourceModifiedDate": "2021-11-12T01:16:06",
  "metadata": {
    "isDeleted": false
  }
}

Did this page help you?