{
"payment": {
"id": 4389,
"number": "6312",
"payment_type": {
"id": 1,
"code": "payment",
"label": "Paiement"
},
"customer": {
"id": 105,
"code": "CONSTEX",
"name": "Construction Exemple inc."
},
"payment_date": "2026-08-01",
"reference": "Chèque 12345",
"is_archived": false
},
"summary": {
"lines_count": 3,
"invoices_paid_count": 2,
"unallocated_count": 1,
"total_applied": 7790.94,
"total_discount": 0,
"total_unallocated": 500,
"first_allocation_date": "2026-08-01",
"last_allocation_date": "2026-08-01",
"currency": "CAD"
},
"items": [
{
"line": {
"line_id": 16850,
"unique_code": "20871"
},
"invoice": {
"id": 13117,
"number": "18512",
"type": {
"id": 3,
"code": "invoice",
"label": "Facture"
},
"invoice_date": "2026-07-15",
"amount_invoiced": 4026.01
},
"allocation_date": "2026-08-01",
"amount_applied": 4026.01,
"discount_applied": 0,
"amount_total": 4026.01,
"transaction_type": {
"id": 3,
"code": "invoice",
"label": "Facture"
},
"is_current_day": false,
"is_unallocated": false,
"_links": {
"invoice_detail": "/api/customers/invoice-ar/by-id/13117",
"invoice_payment_allocations": "/api/customers/invoice-ar/by-id/13117/payment-allocations"
}
},
{
"line": {
"line_id": 16851,
"unique_code": "20872"
},
"invoice": {
"id": 13125,
"number": "18520",
"type": {
"id": 3,
"code": "invoice",
"label": "Facture"
},
"invoice_date": "2026-07-22",
"amount_invoiced": 3764.93
},
"allocation_date": "2026-08-01",
"amount_applied": 3764.93,
"discount_applied": 0,
"amount_total": 3764.93,
"transaction_type": {
"id": 3,
"code": "invoice",
"label": "Facture"
},
"is_current_day": false,
"is_unallocated": false,
"_links": {
"invoice_detail": "/api/customers/invoice-ar/by-id/13125",
"invoice_payment_allocations": "/api/customers/invoice-ar/by-id/13125/payment-allocations"
}
},
{
"line": {
"line_id": 16852,
"unique_code": "20873"
},
"allocation_date": "2026-08-01",
"amount_applied": 500,
"discount_applied": 0,
"amount_total": 500,
"transaction_type": {
"id": 1,
"code": "overpayment",
"label": "Excédent"
},
"is_current_day": false,
"is_unallocated": true,
"_links": {}
}
],
"metadata": {
"organisation_id": "construction_demo",
"extracted_at": "2026-10-07T14:05:10-04:00",
"sdk_indexes_used": {
"customer_payment_line": 2,
"customer_payment": "get_card",
"invoice_ar": "get_card"
},
"scope": "all_lines_including_unallocated"
},
"cache": {
"status": "miss",
"key_hash": "sha1:9b1f0e6c2d4a8e3f7c5b1a0d9e8f7a6b5c4d3e2f",
"cached_at": "2026-10-07T14:05:10-04:00",
"expires_at": "2026-10-07T18:05:10-04:00",
"age_seconds": 0,
"ttl_remaining_seconds": 14400,
"ttl_policy": "current_period_4h",
"force_refreshed": false
},
"_links": {
"self": "/api/customers/payments/by-id/4389/invoices-paid",
"payment_detail": "/api/customers/payments/by-id/4389",
"customer_overview": "/api/customers/by-id/105/overview",
"customer_unpaid_invoices": "/api/customers/by-id/105/unpaid-invoices"
}
}