Canonical payload reference
This is l3lint's own gateway-neutral payload. Lint it directly with --format canonical, or let an adapter build it from a gateway request (see Adapters and field mappings). l3lint convert <file> --to canonical prints the canonical form of any supported input.
Schema: canonical.schema.json (JSON Schema draft 2020-12, $id https://brimatt16219.github.io/l3lint/schemas/canonical.schema.json). l3lint schema canonical prints the same file.
A commercial card transaction with Level 2 and Level 3 data in l3lint's gateway-neutral shape. Absent and null both mean the value was not sent. Business constraints that a rule checks (positive amount, currency code, field lengths by brand, line-item counts, sequence order) are left to those rules so each problem is reported once.
Types read "string or null" when a property may also be null. In the tables, an object that has its own table links to it.
Root object
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
schemaVersion |
string | yes | always 1.0 |
Canonical schema version. |
id |
string or null | no | at least 1 character; at most 64 characters | The merchant's own reference for the transaction. |
amount |
number or null | no | Transaction amount in major units. | |
currency |
string or null | no | ISO 4217 alpha-3 currency code. | |
transactionDate |
string or null | no | pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ |
Date of the transaction; drives rule effective dates. |
channel |
string or null | no | one of cardPresent, cardNotPresent |
Whether the card was present. Visa asks for a billing postal code when it was not. |
card |
object, see card or null | no | What l3lint knows about the card. Gateways rarely send brand and product, so pass them with --brand and --card-product when they are missing. | |
merchant |
object, see merchant or null | no | The merchant. | |
customer |
object, see customer or null | no | The buyer. | |
order |
object, see order or null | no | Order references. | |
tax |
object, see tax or null | no | Transaction-level tax. | |
amounts |
object, see amounts or null | no | Summary amounts, in major units. | |
shipping |
object, see shipping or null | no | Where the goods ship from and to. | |
billing |
object, see billing or null | no | The card's billing address. | |
amex |
object, see amex or null | no | Data only American Express uses. | |
lineItems |
array of lineItem or null | no | The invoice lines (Level 3 data). |
No other properties are allowed.
card
What l3lint knows about the card. Gateways rarely send brand and product, so pass them with --brand and --card-product when they are missing.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
brand |
string or null | no | one of visa, mastercard, amex, discover, unknown |
Card brand. It decides which brand rule packs run. |
product |
string or null | no | one of consumer, business, corporate, purchasing, fleet, commercialPrepaid, unknown |
Card product. It decides eligibility for enhanced-data rates. |
productCode |
string or null | no | Brand product code such as MBS or MEF. | |
isFederalGovernment |
boolean or null | no | True for a US federal government card, which Visa excludes from Product 3 at some medical MCCs. | |
last4 |
string or null | no | pattern ^[0-9]{4}$ |
Last four digits of the card number. Never a full card number. |
No other properties are allowed.
merchant
The merchant.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
mcc |
string or null | no | pattern ^[0-9]{4}$ |
Merchant category code, 4 digits. Some MCCs are excluded from enhanced-data rates. |
name |
string or null | no | Merchant name. The data quality rules flag line descriptions that repeat it. | |
country |
string or null | no | pattern ^[A-Z]{2}$ |
Merchant country, ISO 3166-1 alpha-2. |
taxId |
string or null | no | Merchant tax ID. One processor lists it as required for Mastercard Level 2. |
No other properties are allowed.
customer
The buyer.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
reference |
string or null | no | Customer code, often the buyer's purchase order number. |
No other properties are allowed.
order
Order references.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
purchaseOrderNumber |
string or null | no | The buyer's purchase order number. | |
invoiceNumber |
string or null | no | The merchant's invoice number. | |
orderDate |
string or null | no | pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ |
Date of the order. |
No other properties are allowed.
tax
Transaction-level tax.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
amount |
number or null | no | at least 0 | Total tax in major units. |
indicator |
string or null | no | one of taxable, exempt, notProvided |
Whether the sale is taxable or exempt. Visa wants an explicit exempt flag, not a bare zero tax amount. |
rate |
number or null | no | at least 0; at most 1 | Tax rate as a fraction: 0.07 means 7%. |
exemptionId |
string or null | no | Tax registration or exemption ID. Amex asks for it when the sale is exempt. |
No other properties are allowed.
amounts
Summary amounts, in major units.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
discount |
number or null | no | at least 0 | Header-level discount. Visa wants 0 when there is none. |
freight |
number or null | no | at least 0 | Freight or shipping amount. Visa wants 0 when nothing ships. |
duty |
number or null | no | at least 0 | Duty amount. Visa wants 0 when there is none. |
shippingTax |
number or null | no | at least 0 | Tax on shipping. |
handling |
number or null | no | at least 0 | Handling amount. Not part of the transaction total formula; the total check says so when it is above 0. |
No other properties are allowed.
shipping
Where the goods ship from and to.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
fromPostalCode |
string or null | no | Ship-from postal code. | |
toPostalCode |
string or null | no | Ship-to postal code. | |
toCountry |
string or null | no | pattern ^[A-Z]{2}$ |
Destination country, ISO 3166-1 alpha-2. |
No other properties are allowed.
billing
The card's billing address.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
postalCode |
string or null | no | Billing postal code, used for address verification. |
No other properties are allowed.
amex
Data only American Express uses.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
requestorName |
string or null | no | Name of the person who placed the order. Amex Level 3 asks for it under structured acquirer profiles. | |
adviceText |
array of string or null | no | Transaction advice text lines. Some processors send at most 4 lines of 40 characters. |
No other properties are allowed.
lineItem
One invoice line.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
sequence |
integer or null | no | at least 1 | 1-based line number. Adapters fill it from array order. |
description |
string or null | no | Item descriptor: the real product or service name. | |
productCode |
string or null | no | SKU or part number. | |
commodityCode |
string or null | no | Commodity code, usually an 8-digit UNSPSC code. | |
commodityScheme |
string or null | no | one of unspsc, nigp, hs, naics, other, unknown |
The code system of commodityCode. |
quantity |
number or null | no | Quantity, greater than 0. | |
unitOfMeasure |
string or null | no | Unit of measure, such as EA or BX. Mastercard and Amex accept only codes from their lists. | |
unitCost |
number or null | no | a multiple of 0.000001 | Unit price before discount. At most 6 decimal places. |
discountAmount |
number or null | no | at least 0 | Discount on this line. Visa wants 0 when there is none. |
discountIndicator |
boolean or null | no | True when a discount applies to this line. | |
taxAmount |
number or null | no | at least 0 | Tax on this line. |
taxRate |
number or null | no | at least 0; at most 1 | Tax rate on this line as a fraction: 0.07 means 7%. |
taxable |
boolean or null | no | Line tax indicator: true when the line is taxable. | |
taxTypeCode |
string or null | no | Processor tax type code for the line. | |
amountIncludesTax |
boolean or null | no | True when total includes the line tax. Absent means false. It changes the arithmetic. | |
total |
number or null | no | Line total (extended amount): quantity times unit cost, less the line discount, plus the line tax when amountIncludesTax is true. | |
debitCreditIndicator |
string or null | no | one of debit, credit |
debit adds to the total, credit (a return) subtracts from it. Absent means debit. |
detailIndicator |
string or null | no | at most 1 character | Visa line-item detail indicator, 1 character. Often set by the processor. |
No other properties are allowed.