Functional examples of data

This document aims to give you an understanding of how Codat uses Orders, Payments, and Transactions data that you push to us in order to represent it in the SMB’s accounting platform.

If you want to see some examples of how the data is represented in the accounting platforms’ UI, you can read our Xero mapping specification or QuickBooks Online mapping specification.

Our Sync for Commerce Postman collection already includes some sample Orders, Payments, and Transactions POST requests that you can use as an example.

Sales

The Sales feature represents all sales made in the course of a company’s normal business activities during a set period of time.

For the correct representation of the SMB’s commerce data in their accounting platform, Sync for Commerce requires you to push the following data types to Codat:

  • Orders that represent the sales made during the day.
  • Payments associated with these sales.
  • Transactions that allow reconciling the payments with the orders in the accounting platform.
  • Transactions that represent the payment fees associated with the sales. This only applies if you take payment fees.

❗️

If you fail to push any of these required data types, no data will be displayed in the SMB’s accounting platform.

👍

To check whether the data has been mapped to the accounting platform successfully, follow the steps outlined in the Data pushing section.

Step 1: Submit an Order

{
  "id": "1f463dc2-51c2-46a1-891d-bb4b279f8e36",
  "orderNumber": "1f463dc2-51c2-46a1-891d-bb4b279f8e36",
  "country": "GB ",
  "currency": "GBP",
  "createdDate": "2022-02-14T15:46:18Z",
  "closedDate": "2022-02-14T15:46:18Z",
  "totalAmount": 85,
  "totalRefund": 0,
  "totalTaxAmount": 0,
  "totalDiscount": 0,
  "totalGratuity": 0,
  "orderLineItems": [
  //Tax information
    {
      "id": "01e1f4f6-2e5d-4e24-908c-2f46e7456928",
      "quantity": 1,
      "taxPercentage": 0,
      "totalAmount": 85,
      "totalTaxAmount": 0,
      "unitPrice": 85,
      "discountAllocations": []
    }
  ],
  //End of tax information
  "payments": [],
  "serviceCharges": [],
  "locationRef": {
      "id": "52a50627-c0f5-42c3-90d5-8bf42ae6020b"
  },
  "sourceModifiedDate": "2022-02-14T15:46:18Z"
}

To learn more about how Codat’s Order data model, read Orders.

Step 2: Submit the associated Payment

Here is a Payment that represents the Sale from step 1 of this guide:

{
  "id": "0944c8e6-eb01-4b28-a842-d0693f459395",
  "amount": 85,
  "currency": "GBP",
  "type": "Card",
  "status": "Paid",
  "dueDate": "2022-02-14T15:46:17Z",
  "createdDate": "2022-02-14T15:46:17Z",
  "modifiedDate": "2022-02-15T06:53:11Z",
  "sourceModifiedDate": "2022-02-14T15:46:20Z"
}

This example represents a card payment. Including the payment type in the Payment allows the SMB to reconcile payments of different types with different asset accounts.

To learn more about how Codat’s Payment data model, read Payments.

Step 3: Enable Order and Payment reconciliation

Push the Transaction associated with the Order and Payment that represent the Sale.

Sync for Commerce uses the transactionSourceRef to reconcile them in the SMB’s accounting platform, so make sure the id of the Payment’s transactionSourceRef matches the id of the associated order.

{
  "id": "0944c8e6-eb01-4b28-a842-d0693f459395",
  "totalAmount": 85,
  "currency": "GBP",
  "type": "Payment",
  "transactionSourceRef": {
      "id": "1f463dc2-51c2-46a1-891d-bb4b279f8e36",
      "type": "Order"
  },
  "createdDate": "2022-02-14T15:46:17Z",
  "modifiedDate": "2022-02-15T06:53:11Z",
  "sourceModifiedDate": "2022-02-14T15:46:20Z"
}

To learn more about how Codat’s Transaction data model, read Transactions.

Step 4 (optional): Push the Payment fee transaction

This step is only required if you have charged your SMB a payment processing fee.

  1. Push a transaction with a type of PaymentFee.
  2. Specify the In the id of the related payment in the transactionSourceRef object, similar to Step 3 of this guide.
{
  "id": "0944c8e6-eb01-4b28-a842-d0693f459395",
  "totalAmount": -1.49,
  "currency": "GBP",
  "type": "PaymentFee",
  "transactionSourceRef": {
      "id": "0944c8e6-eb01-4b28-a842-d0693f459395",
      "type": "Payment"
  },
  "createdDate": "2022-02-14T15:46:17Z",
  "modifiedDate": "2022-02-15T06:53:11Z",
  "sourceModifiedDate": "2022-02-14T15:46:20Z"
}

Did this page help you?