Payments
Details of payments made by customers to a company
Explore the Commerce Payments endpoints in Swagger.
You can use data from the Payments endpoints to calculate key metrics, such as gross sales and monthly recurring revenue (MRR).
View the coverage for payments in the Data Coverage Explorer.
Overview
Payments contain details of all payments made by customers to a company, including: amounts, currency used, payment method, payment provider, 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 a payment has been completed, the payment shows 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 | Currency in which the payment was made |
paymentMethodRef | See Reference types | The Payment Methods the payment is linked to in the commerce platform. |
type | string | Payment method: |
status | string | Status of the payment: |
paymentProvider | string | Service provider of the payment, if applicable. |
dueDate | string | Date by which payment must be made |
createdDate | string | Date on which the payment was made and recorded in the commerce or point of sale platform |
modifiedDate | string | Date the payment was last updated in the Codat system |
sourceModifiedDate | string | Date the payment was last changed in the commerce or point of sale platform |
Example data
{
"id": "000951f2-81f5-4618-bb6f-684e6ec7a00b",
"amount": 2.2,
"currency": "CAD",
"paymentMethodRef": {
"id": "2e4aaf71-0784-4c26-b870-eb5e14b5ee6e",
"name": "Stripe"
},
"status": "Failed",
"paymentProvider": "Braintree",
"dueDate": "2022-06-20T05:10:28",
"createdDate": "2021-07-22T21:27:04",
"modifiedDate": "2022-05-03T15:45:34Z",
"sourceModifiedDate": "2021-07-22T21:27:04"
}
{
"id": "f26a112b-d383-487e-8d66-62d3164f81f5",
"amount": -6,
"currency": "GBP",
"paymentMethodRef": {
"id": "ad23848c-5ee7-4e4a-b1d0-40ef402c3ad8",
"name": "Square"
},
"type": "Vipps",
"status": "Paid",
"dueDate": "2021-10-18T16:26:27",
"createdDate": "2021-10-11T16:26:27"
}
Updated 2 months ago