Skip to main content

Why Integrate AR?

Your platform tracks invoices. Thred turns them into financial intelligence:
  • Revenue recognition - P&L updates as invoices are sent/paid
  • Cash flow tracking - Outstanding invoices = predictable cash inflows
  • Auto-reconciliation - Bank payments match to invoices automatically

What to Send

Invoices - Revenue transactions POST /v1/platform/businesses/{id}/invoices/ When: Invoice created in your system Why: Starts the AR cycle, recognizes revenue Invoice Payments - Customer payments POST /v1/platform/businesses/{id}/invoices/payments/ When: Payment received (bank transfer, card, cash) Why: Reduces AR balance, updates cash position Refunds - Customer credits POST /v1/platform/businesses/{id}/invoices/refunds/ When: Order canceled, overpayment, return Why: Reverses revenue, creates refund payable Refund Payments - Outbound refunds POST /v1/platform/businesses/{id}/invoices/refunds/{refund_id}/payments/ When: Money sent back to customer Why: Clears refund liability

Integration Patterns

Pattern 1: Invoice-first (SaaS, professional services)
1. User creates invoice in your app
2. POST invoice to Thred
3. Customer pays → POST payment
4. Done: Revenue recognized, AR cleared
Pattern 2: Payment-first (e-commerce, retail)
1. Customer pays at checkout
2. POST invoice + payment together
3. Return/cancel → POST refund + refund payment
4. Done: Revenue and refunds tracked

Example: Create Invoice

invoice_data = {
    "external_id": f"invoice-{your_invoice_id}",
    "customer_id": customer_id,
    "invoice_number": "INV-001",
    "sent_at": "2025-01-15",
    "due_at": "2025-02-15",
    "currency": "GBP",
    "line_items": [
        {
            "description": "Monthly Subscription",
            "quantity": 1,
            "unit_price_cents": 9900,  # £99
            "account_code": "4000"
        }
    ]
}

response = requests.post(
    f"https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/",
    headers={"Authorization": f"Bearer {business_token}"},
    json=invoice_data
)

Example: Record Payment

payment_data = {
    "external_id": f"payment-{your_payment_id}",
    "invoice_id": invoice_id,
    "amount_cents": 9900,
    "payment_date": "2025-01-20",
    "payment_method": "bank_transfer"
}

response = requests.post(
    f"https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/payments/",
    headers={"Authorization": f"Bearer {business_token}"},
    json=payment_data
)

Priority

Start with:
  1. Invoices - Essential for revenue tracking
  2. Payments - Track what’s been paid
  3. Refunds (if applicable) - Handle returns
Skip credit notes and write-offs initially. Add later if needed. Next: Connect bank accounts for automated transaction sync.