Skip to main content
POST
/
v1
/
platform
/
businesses
/
{business_id}
/
bills
/
payments
Create bill payment with allocations
curl --request POST \
  --url https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/bills/payments/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amount_cents": 2,
  "currency": "GBP",
  "payment_method": "bank_transfer",
  "payment_date": "2023-12-25",
  "payment_reference": "<string>",
  "check_number": "<string>",
  "description": "<string>",
  "memo": "<string>",
  "processing_fee_cents": 0,
  "external_id": "<string>",
  "metadata": "<unknown>",
  "allocations": [
    {
      "bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "amount_cents": 2,
      "description": "<string>"
    }
  ]
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "vendor_name": "<string>",
  "payment_reference": "<string>",
  "external_id": "<string>",
  "processor_payment_id": "<string>",
  "check_number": "<string>",
  "amount_cents": 123,
  "currency": "<string>",
  "processing_fee_cents": 123,
  "net_amount_cents": 123,
  "allocated_amount_cents": 123,
  "unallocated_amount_cents": 123,
  "is_fully_allocated": true,
  "payment_method": "<string>",
  "status": "<string>",
  "payment_date": "2023-12-25",
  "value_date": "2023-12-25",
  "submitted_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "failed_at": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "memo": "<string>",
  "failure_reason": "<string>",
  "metadata": "<unknown>",
  "allocations": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "bill_number": "<string>",
      "vendor_bill_number": "<string>",
      "bill_status": "<string>",
      "amount_cents": 123,
      "allocation_date": "2023-11-07T05:31:56Z",
      "created_at": "2023-11-07T05:31:56Z",
      "description": "<string>"
    }
  ],
  "vendor_refund_allocations": [
    {
      "vendor_refund_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "amount_cents": 123,
      "allocated_at": "2023-11-07T05:31:56Z",
      "reference_number": "<string>"
    }
  ],
  "reconciled_bank_transactions": [
    {
      "bank_transaction_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "bank_transaction_date": "2023-11-07T05:31:56Z",
      "bank_transaction_amount_cents": 123,
      "bank_transaction_direction": "<string>",
      "reconciled_amount_cents": 123,
      "reconciliation_link_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "reconciled_at": "2023-11-07T05:31:56Z",
      "currency": "<string>",
      "payment_type": "<string>",
      "bank_account_name": "<string>",
      "notes": "<string>"
    }
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Business-scoped JWT token. Token payload includes business_id to automatically scope requests. Format: Bearer <your-jwt-token>

Use this for: Business-specific operations where the business context is embedded in the token.

Headers

Idempotency-Key
string

Unique key for idempotent request processing

Path Parameters

business_id
string<uuid>
required

Business UUID

Body

Serializer for creating bill payments with allocations.

This follows the same pattern as vendor refund payments and invoice payments, where allocations are embedded in the payment creation request.

vendor_id
string<uuid>
required

UUID of the vendor receiving the payment (must exist in business)

amount_cents
integer
required

Total payment amount in cents (e.g., 450000 for £4,500.00)

Required range: x >= 1
currency
string
default:GBP

Payment currency (must match business base currency, defaults to GBP)

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

Payment method: bank_transfer, ach, wire, check, credit_card, cash, or other

  • bank_transfer - bank_transfer
  • ach - ach
  • wire - wire
  • check - check
  • credit_card - credit_card
  • cash - cash
  • other - other
Available options:
bank_transfer,
ach,
wire,
check,
credit_card,
cash,
other
payment_date
string<date>

Date when payment was made (ISO date format: YYYY-MM-DD)

payment_reference
string

Your internal payment reference or transaction ID

Maximum string length: 100
check_number
string

Check number (required if payment_method is check)

Maximum string length: 50
description
string

Description of the payment

memo
string

Additional notes or memo for the payment

processing_fee_cents
integer
default:0

Processing fee in cents (defaults to 0)

Required range: x >= 0
external_id
string

Your unique identifier for idempotency (prevents duplicate payments)

Maximum string length: 255
metadata
any

Custom key-value pairs for additional payment context

allocations
object[]

Array of bills to allocate this payment to

Response

Detailed response serializer for bill payment with all related data.

Returns payment details along with vendor info and allocations. All amounts in cents.

id
string<uuid>
required

Unique bill payment identifier

business_id
string<uuid>
required

Business this payment belongs to

vendor_id
string<uuid>
required

Vendor receiving the payment

vendor_name
string
required

Vendor display name

payment_reference
string
required

Payment reference or transaction ID

external_id
string
required

Your external identifier for this payment

processor_payment_id
string
required

Payment processor transaction ID (e.g., Stripe ID)

check_number
string
required

Check number if payment method is check

amount_cents
integer
required

Payment amount in cents

currency
string
required

Payment currency (e.g., GBP, EUR, USD)

processing_fee_cents
integer
required

Processing fee in cents

net_amount_cents
integer
required

Net amount after fees in cents

allocated_amount_cents
integer
required

Allocated amount in cents

unallocated_amount_cents
integer
required

Unallocated amount in cents

is_fully_allocated
boolean
required

Whether payment is fully allocated to bills

payment_method
string
required

Payment method used (bank_transfer, check, wire, etc.)

status
string
required

Payment status (pending, processing, completed, failed, cancelled)

payment_date
string<date>
required

Date payment was made

value_date
string<date>
required

Value date for accounting purposes

submitted_at
string<date-time>
required

When payment was submitted for processing

completed_at
string<date-time>
required

When payment processing completed

failed_at
string<date-time>
required

When payment failed (if applicable)

description
string
required

Payment description

memo
string
required

Additional notes or memo

failure_reason
string
required

Reason for failure (if status=failed)

metadata
any
required

Custom key-value pairs

allocations
object[]
required

Bill allocations for this payment

vendor_refund_allocations
object[]
required

Vendor refund allocations linked to this payment

reconciled_bank_transactions
object[]
required

Bank transactions this payment is reconciled to

created_at
string<date-time>
required

Payment creation timestamp

updated_at
string<date-time>
required

Last update timestamp