Accounting Profit and Loss
Table Name:
payments_invoices_expanded
This data model provides accounting-grade, ledgerized transaction data for 1P vendors. It adds important metadata to Amazon’s payment details, such as agreement types and categorization, that make it easier to aggregate and visualize. It also automatically converts all financial amounts into USD, GBP, and EUR in the same row using the daily spot rate.
- Helps bridge derivative invoices (e.g. INVOICE12345SCRSCR) to the original invoice (e.g. INVOICE12345), making it much easier to track and sequence payment, deduction, and reimbursement activity.
- Includes a ready-to-go P&L structure: everything is categorized in multiple ways, e.g. as an income or expense, transaction type.
- This table powers BASIS Negotiation P&L and Cost of Business reports
Business questions & scenarios
What is this data useful for?
- Profit & loss accounting. “What was our true net profit last quarter, vs. the previous quarter?”
- Reconciliation and auditing. “Did Amazon deduct the correct amounts from our payments, or were we over/underbilled?”
Schema & update details
| UI Report path | N/A |
| Amazon update frequency | Daily |
| Reason update frequency | Daily |
| Time Zone | Country local time zone |
| Granularity [?] | 1 row per:
-Partner UUID -Invoice Number -Payment Number |
Historical data & change management
| Time Period | |
| History available from Amazon | 3 years |
| Reason lookback period | 30 days |
Data dictionary: fields in this table
Report Name: Accounting Profit & Loss · Table: payments_invoices_expanded · Type: Vendor, Derivative
| Column | Data Type | Description |
|---|---|---|
| amount_in_payment_currency | decimal | Amount Amazon pays to vendor in payment currency |
| amount_paid_in_eur | Double Precision | Amount paid by Amazon after the withholding amount and discounts taken, converted to EUR at daily currency rate |
| amount_paid | decimal | Amount paid by Amazon after the withholding amount and discounts taken |
| amount_in_payment_currency_in_usd | Double Precision | Amount paid in Payment Currency by Amazon after the withholding amount and discounts taken, converted to USD at daily currency rate |
| agreement_id | Number | Co-op agreement unique ID |
| agreement_title | Number | Co-op agreement title |
| payment_currency | Number | Currency the payment was made in to the vendor |
| apl_cat_i | Number | P&L category classification |
| _created_on | timestamp with time zone | Date the record was created |
| terms_discount_taken | decimal | Discount taken as a result of negotiation: Amazon pays the vendor early and receives a discount on the cost of products |
| withholding_amount | decimal | Amount of payment withheld by Amazon |
| description | Number | PO invoice description: Invoice number, Shortage Claim - Shipped products differ from Amazon's receipt records, Missed adjustment claim - Deduction based on inventory adjustments and recovered from future invoice payments, Disaster Recovery Claim - Amazon issues payments in error that results in overpayment to vendor, Prep Suffocation Warning, Prep Bagging, Price Claim for Invoice - |
| _input_key | Character Varying | Internal Reason Automation data key |
| funding_type | Number | Funding Type (ex: Accrual, Straight Payment etc.) |
| payment_number | Number | Unique payment number assigned to the payment made by Amazon |
| invoice_number | Number | Invoice number |
| _partneruuid | Character Varying | Partner Unique Identifier |
| amount_paid_in_usd | Double Precision | Amount paid by Amazon after the withholding amount and discounts taken, converted to USD at daily currency rate |
| invoice_amount | decimal | Amount stated on the invoice that Amazon pays to vendor |
| suffix | Number | Information appended to base invoice number when child invoices are created (e.g. SCR) |
| apl_line_i | Number | P&L line-item classification |
| amount_in_payment_currency_in_eur | Double Precision | Amount paid in Payment Currency by Amazon after the withholding amount and discounts taken, converted to EUR at daily currency rate |
| _revision | Integer | Number of times the record has changed |
| payment_type | Number | Method of payment that Amazon uses to pay the vendor: EFT (Electronic Funds Transfer) |
| id | bigint | Unique number assigned to every line in the table |
| remaining_amount | decimal | Remaining amount on the invoice that needs to be paid |
| invoice_date | Number | Date the invoice was submitted to Amazon |
| invoice_currency | Number | Currency the invoice is stated in |
| payment_date | Number | Date the payment was made |
| amount_in_payment_currency_in_gbp | Double Precision | Amount paid in Payment Currency by Amazon after the withholding amount and discounts taken, converted to GBP at daily currency rate |
| credit_debit | Number | Denotes whether a line item is a credit or debit (from Vendor perspective) |
| _last_updated_on | timestamp with time zone | Date the record was last updated |
| invoice_group | Number | Base invoice number to which subsequent child invoices are linked |
| amount_paid_in_gbp | Double Precision | Amount paid by Amazon after the withholding amount and discounts taken, converted to GBP at daily currency rate |
How to query this table
The following query generates a categorized P&L at the monthly level, with transaction-level detail. Note that the table contains both successful and failed payments, and so a filter on payment_status is needed as shown below.
select
date_trunc('Month', invoice_date)::date as invoice_date
, apl_cat_i
, apl_line_i
, credit_debit
, funding_type
, payment_type
, description
, invoice_currency
, sum(amount_paid) as amount_paid
from public.payments_invoices_expanded
where payment_status = 'Successful'
group by 1,2,3,4,5,6,7,8
On this page
Related pages
Invoice PaymentsPaid Invoices