You can use data from the Payments endpoints to calculate key metrics, such as gross sales and monthly recurring revenue (MRR).

Overview

Payments contain details of all payments made by customers to the company, including amounts, the currency used, the payment method used, and payment status.

Refunds are recorded as separate, negative payments. Note that a refund can only occur in relation to a payment that has been completed (i.e. has a status of Paid). When a customer cancels an order before the payment has been completed, the payment will show as Cancelled.

From the Payments endpoints you can retrieve:

  • A list of all commerce payments available for a company
    GET /companies/{companyId}/connections/{connectionId}/data/commerce-payments

  • A single commerce payment for a given company
    GET /companies/{companyId}/connections/{connectionId}/data/commerce-payments/{paymentId}

Data model

Field

Type

Description

id

string

Identifier of the payment

amount

decimal

Payment amount (including gratuity)

currency

string
See currency

Currency in which the payment was made

type

string

Payment method:

  • Unknown

  • Cash

  • Card

  • Custom

  • Invoice

  • OnlineCard

  • Swish

  • Vipps

  • Mobile

  • StoreCredit

  • Paypal

  • Prepaid

status

string

Status of the payment:

  • Unknown

  • Pending

  • Authorised

  • Paid

  • Failed

  • Cancelled

dueDate

string
See date

Date by which payment must be made

createdDate

string
See date

Date on which the payment was made and recorded in the commerce or point of sale platform

modifiedDate

string
See date

Date the payment was last updated in the Codat system

sourceModifiedDate

string
See date

Date the payment was last changed in the commerce or point of sale platform

Example data

{
    "Payments": [
        {
            "id": "00207a93-257d-42f8-930c-f47a8851e559",
            "amount": 37.10,
            "currency": "USD",
            "type": "Mobile",
            "status": "Paid",
            "dueDate": "2021-04-20T13:54:32.418Z",
            "createdDate": "2021-04-20T13:54:32.418Z",
            "modifiedDate": "2021-04-20T13:54:32.418Z",
            "sourceModifiedDate": "2021-04-20T13:54:32.418Z"
        }
    ]
}
{
    "Payments": [
        {
            "id": "0021e461-b300-462e-8404-d0e3d256fc87",
            "amount": -32.28,
            "currency": "USD",
            "type": "Custom",
            "status": "Paid",
            "dueDate": "0001-01-01T00:00:00",
            "createdDate": "2018-01-07T02:02:26",
            "modifiedDate": "2021-04-20T11:36:48",
            "sourceModifiedDate": "2018-01-07T02:02:26"
        }
    ]
}

Did this page help you?