Create refund (full or partial)
curl --request POST \
--url https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"amount_cents": 2,
"memo": "<string>",
"reference_number": "<string>",
"processor": "<string>",
"refund_processing_fee_cents": 0,
"document": {
"file": "<string>",
"document_type": "refund",
"upload_source": "<string>",
"metadata": "<unknown>",
"tags": "<unknown>"
}
}
'import requests
url = "https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/"
payload = {
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"amount_cents": 2,
"memo": "<string>",
"reference_number": "<string>",
"processor": "<string>",
"refund_processing_fee_cents": 0,
"document": {
"file": "<string>",
"document_type": "refund",
"upload_source": "<string>",
"metadata": "<unknown>",
"tags": "<unknown>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoice_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
completed_at: '2023-11-07T05:31:56Z',
external_id: '<string>',
amount_cents: 2,
memo: '<string>',
reference_number: '<string>',
processor: '<string>',
refund_processing_fee_cents: 0,
document: {
file: '<string>',
document_type: 'refund',
upload_source: '<string>',
metadata: '<unknown>',
tags: '<unknown>'
}
})
};
fetch('https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'invoice_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'completed_at' => '2023-11-07T05:31:56Z',
'external_id' => '<string>',
'amount_cents' => 2,
'memo' => '<string>',
'reference_number' => '<string>',
'processor' => '<string>',
'refund_processing_fee_cents' => 0,
'document' => [
'file' => '<string>',
'document_type' => 'refund',
'upload_source' => '<string>',
'metadata' => '<unknown>',
'tags' => '<unknown>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/"
payload := strings.NewReader("{\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"external_id\": \"<string>\",\n \"amount_cents\": 2,\n \"memo\": \"<string>\",\n \"reference_number\": \"<string>\",\n \"processor\": \"<string>\",\n \"refund_processing_fee_cents\": 0,\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"refund\",\n \"upload_source\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"tags\": \"<unknown>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"external_id\": \"<string>\",\n \"amount_cents\": 2,\n \"memo\": \"<string>\",\n \"reference_number\": \"<string>\",\n \"processor\": \"<string>\",\n \"refund_processing_fee_cents\": 0,\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"refund\",\n \"upload_source\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"tags\": \"<unknown>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"external_id\": \"<string>\",\n \"amount_cents\": 2,\n \"memo\": \"<string>\",\n \"reference_number\": \"<string>\",\n \"processor\": \"<string>\",\n \"refund_processing_fee_cents\": 0,\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"refund\",\n \"upload_source\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"tags\": \"<unknown>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refunded_amount": 123,
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_name": "<string>",
"allocations": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allocation_type": "invoice",
"amount": 123,
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"invoice_outstanding_balance_cents": 123,
"target_description": "<string>",
"description": "<string>",
"allocation_date": "2023-11-07T05:31:56Z"
}
],
"refund_payments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refund_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refunded_amount": 123,
"refund_processing_fee": 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",
"external_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"method": "BANK_TRANSFER",
"processor": "<string>",
"transaction_tags": "<unknown>",
"memo": "<string>",
"metadata": "<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>",
"status": "pending",
"completed_at": "2023-11-07T05:31:56Z",
"is_dedicated": true,
"memo": "<string>",
"reference_number": "<string>",
"metadata": "<unknown>",
"currency": "EUR"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}Refunds
Create refund (full or partial)
Create a simple refund for an invoice. Provide partial_amount to create a partial refund.
POST
/
v1
/
platform
/
businesses
/
{business_id}
/
invoices
/
refunds
/
Create refund (full or partial)
curl --request POST \
--url https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"amount_cents": 2,
"memo": "<string>",
"reference_number": "<string>",
"processor": "<string>",
"refund_processing_fee_cents": 0,
"document": {
"file": "<string>",
"document_type": "refund",
"upload_source": "<string>",
"metadata": "<unknown>",
"tags": "<unknown>"
}
}
'import requests
url = "https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/"
payload = {
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"amount_cents": 2,
"memo": "<string>",
"reference_number": "<string>",
"processor": "<string>",
"refund_processing_fee_cents": 0,
"document": {
"file": "<string>",
"document_type": "refund",
"upload_source": "<string>",
"metadata": "<unknown>",
"tags": "<unknown>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoice_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
completed_at: '2023-11-07T05:31:56Z',
external_id: '<string>',
amount_cents: 2,
memo: '<string>',
reference_number: '<string>',
processor: '<string>',
refund_processing_fee_cents: 0,
document: {
file: '<string>',
document_type: 'refund',
upload_source: '<string>',
metadata: '<unknown>',
tags: '<unknown>'
}
})
};
fetch('https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'invoice_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'completed_at' => '2023-11-07T05:31:56Z',
'external_id' => '<string>',
'amount_cents' => 2,
'memo' => '<string>',
'reference_number' => '<string>',
'processor' => '<string>',
'refund_processing_fee_cents' => 0,
'document' => [
'file' => '<string>',
'document_type' => 'refund',
'upload_source' => '<string>',
'metadata' => '<unknown>',
'tags' => '<unknown>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/"
payload := strings.NewReader("{\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"external_id\": \"<string>\",\n \"amount_cents\": 2,\n \"memo\": \"<string>\",\n \"reference_number\": \"<string>\",\n \"processor\": \"<string>\",\n \"refund_processing_fee_cents\": 0,\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"refund\",\n \"upload_source\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"tags\": \"<unknown>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"external_id\": \"<string>\",\n \"amount_cents\": 2,\n \"memo\": \"<string>\",\n \"reference_number\": \"<string>\",\n \"processor\": \"<string>\",\n \"refund_processing_fee_cents\": 0,\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"refund\",\n \"upload_source\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"tags\": \"<unknown>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/refunds/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"external_id\": \"<string>\",\n \"amount_cents\": 2,\n \"memo\": \"<string>\",\n \"reference_number\": \"<string>\",\n \"processor\": \"<string>\",\n \"refund_processing_fee_cents\": 0,\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"refund\",\n \"upload_source\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"tags\": \"<unknown>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refunded_amount": 123,
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_name": "<string>",
"allocations": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allocation_type": "invoice",
"amount": 123,
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"invoice_outstanding_balance_cents": 123,
"target_description": "<string>",
"description": "<string>",
"allocation_date": "2023-11-07T05:31:56Z"
}
],
"refund_payments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refund_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refunded_amount": 123,
"refund_processing_fee": 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",
"external_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"method": "BANK_TRANSFER",
"processor": "<string>",
"transaction_tags": "<unknown>",
"memo": "<string>",
"metadata": "<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>",
"status": "pending",
"completed_at": "2023-11-07T05:31:56Z",
"is_dedicated": true,
"memo": "<string>",
"reference_number": "<string>",
"metadata": "<unknown>",
"currency": "EUR"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}{
"error_code": "<string>",
"message": "<string>",
"detail": {},
"request_id": "<string>"
}Authorizations
PartnerJWTBusinessScopedJWTBasicAuthBearerUnscopedBearerBusinessScoped
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
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Serializer for creating simple refunds
Payment method for the refund
CASH- CashCHECK- CheckCREDIT_CARD- Credit CardDEBIT_CARD- Debit CardACH- ACHBANK_TRANSFER- Bank TransferPAYPAL- PayPalSTRIPE- StripeOTHER- Other
Available options:
CASH, CHECK, CREDIT_CARD, DEBIT_CARD, ACH, BANK_TRANSFER, PAYPAL, STRIPE, OTHER Response
Serializer for refunds (simple response). All amounts in cents.
Three-letter ISO 4217 currency code (EUR, GBP, USD)
EUR- EuroGBP- British PoundUSD- US DollarSEK- Swedish KronaNOK- Norwegian KroneDKK- Danish KroneISK- Icelandic KrónaMYR- Malaysian RinggitSGD- Singapore Dollar
Available options:
EUR, GBP, USD, SEK, NOK, DKK, ISK, MYR, SGD Was this page helpful?