Skip to main content
POST
/
v1
/
platform
/
businesses
/
{business_id}
/
vendor-refunds
/
payments
Create vendor refund payment with allocations
curl --request POST \
  --url https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-refunds/payments/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "total_amount_cents": 2,
  "allocations": [
    {
      "allocation_type": "bill",
      "amount_cents": 2,
      "bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "bill_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "description": "<string>",
      "metadata": "<unknown>"
    }
  ],
  "external_id": "<string>",
  "refund_type": "overpayment",
  "refund_date": "2023-12-25",
  "currency": "<string>",
  "description": "<string>",
  "memo": "<string>",
  "reason": "<string>",
  "metadata": "<unknown>",
  "payment_method": "bank_transfer",
  "processor": "bank_transfer",
  "payment_reference": "<string>",
  "processing_fee_cents": 0
}
'
{
  "refund": {},
  "payment": {},
  "allocations": [
    {}
  ]
}

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 vendor refund payments with embedded allocations.

This serializer handles the unified creation of vendor refunds, payments, and allocations in a single atomic operation.

vendor_id
string<uuid>
required

UUID of the vendor issuing the refund

total_amount_cents
integer
required

Total refund amount in cents (e.g., 100000 for £1000.00)

Required range: x >= 1
allocations
object[]

List of allocations for the refund

external_id
string

External system ID for idempotency

Maximum string length: 255
refund_type
enum<string>
default:overpayment

Type of refund

  • overpayment - Overpayment
  • billing_error - Billing Error
  • goods_return - Goods Return
  • credit_balance - Credit Balance
  • duplicate_payment - Duplicate Payment
  • other - Other
Available options:
overpayment,
billing_error,
goods_return,
credit_balance,
duplicate_payment,
other
refund_date
string<date>

Date of the refund (defaults to today)

currency
string

Currency code (defaults to vendor's currency)

Required string length: 1 - 3
description
string

Refund description

memo
string

Internal memo

reason
string

Reason for the refund

Maximum string length: 500
metadata
any | null

Additional structured data

payment_method
enum<string>
default:bank_transfer

Payment method used for the refund

  • bank_transfer - Bank Transfer
  • ach - ACH Transfer
  • wire - Wire Transfer
  • check - Check
  • credit_card - Credit Card Reversal
  • cash - Cash
  • other - Other
Available options:
bank_transfer,
ach,
wire,
check,
credit_card,
cash,
other
processor
enum<string>
default:bank_transfer

Payment processor used

  • stripe - Stripe
  • wise - Wise (TransferWise)
  • paypal - PayPal
  • bank_transfer - Direct Bank Transfer
  • internal - Internal Processing
Available options:
stripe,
wise,
paypal,
bank_transfer,
internal
payment_reference
string

External payment reference number

Maximum string length: 100
processing_fee_cents
integer
default:0

Processing fee in cents

Required range: x >= 0

Response

Serializer for vendor refund payment create/update responses.

This serializer formats the response data for successful refund payment creation operations. Renamed from VendorRefundPaymentResponseSerializer to avoid naming conflict with vendor_refund_serializers.py.

refund
object
required

Complete refund information

payment
object
required

Payment information

allocations
object[]
required

List of allocations created