Skip to main content
POST
/
v1
/
platform
/
businesses
/
{business_id}
/
vendor-refunds
Create vendor refund
curl --request POST \
  --url https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-refunds/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "total_refunded_amount_cents": 2,
  "external_id": "<string>",
  "refund_type": "overpayment",
  "reference_number": "<string>",
  "currency": "EUR",
  "refund_date": "2023-12-25",
  "description": "<string>",
  "memo": "<string>",
  "reason": "<string>",
  "metadata": "<unknown>",
  "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>"
    }
  ],
  "payments": [
    {
      "refunded_amount_cents": 2,
      "payment_reference": "<string>",
      "processing_fee_cents": 0,
      "payment_method": "bank_transfer",
      "processor": "bank_transfer",
      "payment_date": "2023-12-25",
      "description": "<string>",
      "memo": "<string>",
      "metadata": "<unknown>"
    }
  ],
  "document": {
    "file": "<string>",
    "document_type": "vendor_refund",
    "upload_source": "<string>",
    "metadata": "<unknown>",
    "tags": "<unknown>"
  }
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "vendor_name": "<string>",
  "total_refunded_amount": 123,
  "allocated_amount": 123,
  "unallocated_amount": 123,
  "allocations": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "amount": 123,
      "bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "bill_number": "<string>",
      "bill_outstanding_balance_cents": 123,
      "bill_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "target_description": "<string>",
      "allocation_type": "bill",
      "allocation_date": "2023-11-07T05:31:56Z",
      "description": "<string>",
      "metadata": "<unknown>"
    }
  ],
  "vendor_refund_payments": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "vendor_refund_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "refunded_amount": 123,
      "processing_fee": 123,
      "net_amount": 123,
      "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",
      "payment_reference": "<string>",
      "processor_payment_id": "<string>",
      "payment_date": "2023-12-25",
      "payment_method": "bank_transfer",
      "processor": "stripe",
      "status": "pending",
      "submitted_at": "2023-11-07T05:31:56Z",
      "completed_at": "2023-11-07T05:31:56Z",
      "failed_at": "2023-11-07T05:31:56Z",
      "failure_reason": "<string>",
      "description": "<string>",
      "memo": "<string>",
      "metadata": "<unknown>",
      "transaction_tags": "<unknown>"
    }
  ],
  "document": {
    "url": "<string>",
    "expires_in": 123,
    "document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "file_name": "<string>",
    "file_size": 123,
    "mime_type": "<string>"
  },
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "external_id": "<string>",
  "refund_type": "overpayment",
  "reference_number": "<string>",
  "refund_date": "2023-12-25",
  "expected_completion_date": "2023-12-25",
  "currency": "EUR",
  "status": "pending",
  "description": "<string>",
  "memo": "<string>",
  "reason": "<string>",
  "metadata": "<unknown>"
}

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.

Path Parameters

business_id
string
required

Body

Serializer for creating vendor refunds. Handles validation and conversion of amounts from base units to cents.

vendor_id
string<uuid>
required

Vendor UUID

total_refunded_amount_cents
integer
required

Total refunded amount in cents (e.g., 10050 for €100.50)

Required range: x >= 1
external_id
string

External/partner refund ID for idempotency

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

Type/reason for the refund

  • overpayment - overpayment
  • credit_balance - credit_balance
  • duplicate_payment - duplicate_payment
  • billing_error - billing_error
  • goods_return - goods_return
  • service_cancellation - service_cancellation
  • other - other
Available options:
overpayment,
credit_balance,
duplicate_payment,
billing_error,
goods_return,
service_cancellation,
other
reference_number
string

External reference number

Maximum string length: 100
currency
enum<string>
default:EUR

ISO 4217 currency code

  • EUR - EUR
  • GBP - GBP
  • USD - USD
Available options:
EUR,
GBP,
USD
refund_date
string<date>

Date when refund was issued (ISO date: YYYY-MM-DD)

description
string

Description of the refund reason or context

memo
string

Internal memo or notes about this refund

reason
string

Detailed explanation for the refund (max 500 characters)

Maximum string length: 500
metadata
any | null

Custom key-value pairs for additional refund context (max 10kb)

allocations
object[] | null
payments
object[] | null
document
object

Optional document upload

Response

Comprehensive serializer for vendor refund responses. Includes all refund details plus related allocations and payments.

id
string<uuid>
required

Unique vendor refund identifier

vendor_id
string<uuid>
required

UUID of the vendor who issued the refund

vendor_name
string
required

Vendor company name

total_refunded_amount
integer
required

Total refunded amount in cents

allocated_amount
integer
required

Total allocated amount in cents

unallocated_amount
integer
required

Remaining unallocated amount in cents

allocations
object[]
required
vendor_refund_payments
object[]
required
document
object
required

Latest document linked to this vendor refund

created_at
string<date-time>
required

Refund creation timestamp

updated_at
string<date-time>
required

Last update timestamp

external_id
string

Your external system identifier for idempotency

Maximum string length: 255
refund_type
enum<string>

Refund type: overpayment, credit_balance, billing_error, goods_return, duplicate_payment, service_cancellation, other

  • overpayment - Overpayment Refund
  • credit_balance - Credit Balance Refund
  • duplicate_payment - Duplicate Payment
  • billing_error - Billing Error
  • goods_return - Goods Return
  • service_cancellation - Service Cancellation
  • other - Other
Available options:
overpayment,
credit_balance,
duplicate_payment,
billing_error,
goods_return,
service_cancellation,
other
reference_number
string

External reference number for this refund

Maximum string length: 100
refund_date
string<date>

Date when refund was issued

expected_completion_date
string<date> | null

Expected date for refund completion

currency
enum<string>

Refund currency (EUR, GBP, USD)

  • EUR - Euro
  • GBP - British Pound
  • USD - US Dollar
  • SEK - Swedish Krona
  • NOK - Norwegian Krone
  • DKK - Danish Krone
  • ISK - Icelandic Króna
  • MYR - Malaysian Ringgit
  • SGD - Singapore Dollar
Available options:
EUR,
GBP,
USD,
SEK,
NOK,
DKK,
ISK,
MYR,
SGD
status
enum<string>

Refund status: pending, partially_allocated, allocated, completed, cancelled (computed from allocations)

  • pending - Pending
  • partially_allocated - Partially Allocated
  • allocated - Allocated
  • completed - Completed
  • cancelled - Cancelled
Available options:
pending,
partially_allocated,
allocated,
completed,
cancelled
description
string

Description of the refund reason or context

memo
string

Internal memo or notes

reason
string

Detailed explanation for the refund

Maximum string length: 500
metadata
any

Custom key-value pairs