Skip to main content
PATCH
/
v1
/
platform
/
businesses
/
{business_id}
/
invoices
/
payments
/
{payment_id}
Partially update invoice payment
curl --request PATCH \
  --url https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/invoices/payments/{payment_id}/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "total_amount_cents": 2,
  "allocations": [
    {
      "invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "amount_cents": 2
    }
  ],
  "payment_date": "2023-12-25",
  "currency": "<string>",
  "payment_method": "bank_transfer",
  "payment_reference": "<string>",
  "external_id": "<string>",
  "note": "<string>",
  "notes": "<string>",
  "metadata": {},
  "references": {},
  "processor_reference": "<string>",
  "bank_reference": "<string>",
  "status": "pending",
  "transaction_tags": [
    "<string>"
  ],
  "payment_processor": "<string>",
  "processing_fee_cents": 1
}
'
{
  "payment": {
    "id": "7a80c3cc-4g88-8f94-cccc-cgg69180496e",
    "business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "customer_id": "4d90c3cc-1e55-5c61-9999-9ee36847163b",
    "total_amount_cents": 450000,
    "applied_amount_cents": 450000,
    "allocated_amount_cents": 450000,
    "unapplied_amount_cents": 0,
    "remaining_amount_cents": 0,
    "currency": "GBP",
    "status": "completed",
    "payment_method": "bank_transfer",
    "payment_reference": "PAY-2024-0042",
    "external_id": "ext-payment-001",
    "note": "Payment for INV-0042 - monthly beer supply",
    "bank_reference": "FPS-20240320-123456",
    "metadata": {},
    "idempotency_key": null,
    "created_at": "2024-03-20T09:30:00Z",
    "updated_at": "2024-03-20T09:30:00Z",
    "applied_invoices": [
      {
        "id": "5e90c3cc-2f66-6d72-aaaa-aff47958274c",
        "invoice_number": "INV-0042",
        "applied_amount_cents": 450000,
        "status": "paid",
        "outstanding_amount_cents": 0
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Partner-level JWT token (unscoped). Token payload includes partner_id. Business access is validated via partner ownership. Format: Bearer <your-jwt-token>

Use this for: Multi-business operations where the business_id is specified in the URL and partner has access to multiple businesses.

Path Parameters

business_id
string<uuid>
required

Business UUID provided by Thred (unique identifier for the business)

payment_id
string<uuid>
required

A UUID string identifying this payment.

Body

Serializer for updating existing payments. Matches the create endpoint structure (InvoiceRecordPaymentRequestSerializer) to provide consistency between create and update APIs.

customer_id
string<uuid>

Customer UUID (cannot be changed after creation)

total_amount_cents
integer

Updated total payment amount in cents (must not be less than allocated amount)

Required range: x >= 1
allocations
object[]

Updated list of invoice allocations (replaces existing allocations)

payment_date
string<date>

Updated payment date (ISO date format: YYYY-MM-DD)

currency
string

Payment currency (cannot be changed after creation)

Required string length: 1 - 3
payment_method
enum<string>

Updated payment method (bank_transfer, card, cash, cheque, direct_debit)

  • bank_transfer - bank_transfer
  • credit_card - credit_card
  • debit_card - debit_card
  • ach - ach
  • check - check
  • cash - cash
  • paypal - paypal
  • stripe - stripe
  • other - other
Available options:
bank_transfer,
credit_card,
debit_card,
ach,
check,
cash,
paypal,
stripe,
other
payment_reference
string

Updated internal payment reference

external_id
string

Updated external identifier (must remain unique)

note
string

Updated internal notes or description

notes
string

Legacy field for notes (use 'note' instead)

metadata
object

Updated custom key-value pairs

references
object

Updated payment references (bank_reference, end_to_end_id, payment_reference)

processor_reference
string

Updated payment processor reference

Maximum string length: 255
bank_reference
string

Updated bank transaction reference

Maximum string length: 100
status
enum<string>

Updated payment status (pending, processing, completed, failed, cancelled, refunded)

  • pending - Pending
  • processing - Processing
  • completed - Completed
  • failed - Failed
  • cancelled - Cancelled
  • refunded - Refunded
Available options:
pending,
processing,
completed,
failed,
cancelled,
refunded
transaction_tags
string[]

Updated tags for categorization

Minimum string length: 1
payment_processor
string

Updated payment processor name

Maximum string length: 100
processing_fee_cents
integer

Updated processing fee in cents

Required range: x >= 0

Response

Response serializer for create invoice payment endpoint

payment
object
required

Detailed payment information in response - all amounts in cents