curl --request PATCH \
--url https://dev-backend.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_reference": "<string>",
"external_id": "<string>",
"note": "<string>",
"notes": "<string>",
"metadata": {},
"references": {},
"processor_reference": "<string>",
"bank_reference": "<string>",
"transaction_tags": [
"<string>"
],
"payment_processor": "<string>",
"processing_fee_cents": 1
}
'import requests
url = "https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/payments/{payment_id}/"
payload = {
"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_reference": "<string>",
"external_id": "<string>",
"note": "<string>",
"notes": "<string>",
"metadata": {},
"references": {},
"processor_reference": "<string>",
"bank_reference": "<string>",
"transaction_tags": ["<string>"],
"payment_processor": "<string>",
"processing_fee_cents": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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_reference: '<string>',
external_id: '<string>',
note: '<string>',
notes: '<string>',
metadata: {},
references: {},
processor_reference: '<string>',
bank_reference: '<string>',
transaction_tags: ['<string>'],
payment_processor: '<string>',
processing_fee_cents: 1
})
};
fetch('https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/payments/{payment_id}/', 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/payments/{payment_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'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_reference' => '<string>',
'external_id' => '<string>',
'note' => '<string>',
'notes' => '<string>',
'metadata' => [
],
'references' => [
],
'processor_reference' => '<string>',
'bank_reference' => '<string>',
'transaction_tags' => [
'<string>'
],
'payment_processor' => '<string>',
'processing_fee_cents' => 1
]),
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/payments/{payment_id}/"
payload := strings.NewReader("{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"total_amount_cents\": 2,\n \"allocations\": [\n {\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount_cents\": 2\n }\n ],\n \"payment_date\": \"2023-12-25\",\n \"currency\": \"<string>\",\n \"payment_reference\": \"<string>\",\n \"external_id\": \"<string>\",\n \"note\": \"<string>\",\n \"notes\": \"<string>\",\n \"metadata\": {},\n \"references\": {},\n \"processor_reference\": \"<string>\",\n \"bank_reference\": \"<string>\",\n \"transaction_tags\": [\n \"<string>\"\n ],\n \"payment_processor\": \"<string>\",\n \"processing_fee_cents\": 1\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/payments/{payment_id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"total_amount_cents\": 2,\n \"allocations\": [\n {\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount_cents\": 2\n }\n ],\n \"payment_date\": \"2023-12-25\",\n \"currency\": \"<string>\",\n \"payment_reference\": \"<string>\",\n \"external_id\": \"<string>\",\n \"note\": \"<string>\",\n \"notes\": \"<string>\",\n \"metadata\": {},\n \"references\": {},\n \"processor_reference\": \"<string>\",\n \"bank_reference\": \"<string>\",\n \"transaction_tags\": [\n \"<string>\"\n ],\n \"payment_processor\": \"<string>\",\n \"processing_fee_cents\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/payments/{payment_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"total_amount_cents\": 2,\n \"allocations\": [\n {\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount_cents\": 2\n }\n ],\n \"payment_date\": \"2023-12-25\",\n \"currency\": \"<string>\",\n \"payment_reference\": \"<string>\",\n \"external_id\": \"<string>\",\n \"note\": \"<string>\",\n \"notes\": \"<string>\",\n \"metadata\": {},\n \"references\": {},\n \"processor_reference\": \"<string>\",\n \"bank_reference\": \"<string>\",\n \"transaction_tags\": [\n \"<string>\"\n ],\n \"payment_processor\": \"<string>\",\n \"processing_fee_cents\": 1\n}"
response = http.request(request)
puts response.read_body{
"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
}
]
}
}Partially update invoice payment
Partially update an existing payment’s metadata, references, amounts, allocations, and status. Only provided fields will be updated. Amount changes are validated to ensure they don’t break existing allocations.
curl --request PATCH \
--url https://dev-backend.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_reference": "<string>",
"external_id": "<string>",
"note": "<string>",
"notes": "<string>",
"metadata": {},
"references": {},
"processor_reference": "<string>",
"bank_reference": "<string>",
"transaction_tags": [
"<string>"
],
"payment_processor": "<string>",
"processing_fee_cents": 1
}
'import requests
url = "https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/payments/{payment_id}/"
payload = {
"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_reference": "<string>",
"external_id": "<string>",
"note": "<string>",
"notes": "<string>",
"metadata": {},
"references": {},
"processor_reference": "<string>",
"bank_reference": "<string>",
"transaction_tags": ["<string>"],
"payment_processor": "<string>",
"processing_fee_cents": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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_reference: '<string>',
external_id: '<string>',
note: '<string>',
notes: '<string>',
metadata: {},
references: {},
processor_reference: '<string>',
bank_reference: '<string>',
transaction_tags: ['<string>'],
payment_processor: '<string>',
processing_fee_cents: 1
})
};
fetch('https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/payments/{payment_id}/', 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/payments/{payment_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'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_reference' => '<string>',
'external_id' => '<string>',
'note' => '<string>',
'notes' => '<string>',
'metadata' => [
],
'references' => [
],
'processor_reference' => '<string>',
'bank_reference' => '<string>',
'transaction_tags' => [
'<string>'
],
'payment_processor' => '<string>',
'processing_fee_cents' => 1
]),
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/payments/{payment_id}/"
payload := strings.NewReader("{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"total_amount_cents\": 2,\n \"allocations\": [\n {\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount_cents\": 2\n }\n ],\n \"payment_date\": \"2023-12-25\",\n \"currency\": \"<string>\",\n \"payment_reference\": \"<string>\",\n \"external_id\": \"<string>\",\n \"note\": \"<string>\",\n \"notes\": \"<string>\",\n \"metadata\": {},\n \"references\": {},\n \"processor_reference\": \"<string>\",\n \"bank_reference\": \"<string>\",\n \"transaction_tags\": [\n \"<string>\"\n ],\n \"payment_processor\": \"<string>\",\n \"processing_fee_cents\": 1\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/payments/{payment_id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"total_amount_cents\": 2,\n \"allocations\": [\n {\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount_cents\": 2\n }\n ],\n \"payment_date\": \"2023-12-25\",\n \"currency\": \"<string>\",\n \"payment_reference\": \"<string>\",\n \"external_id\": \"<string>\",\n \"note\": \"<string>\",\n \"notes\": \"<string>\",\n \"metadata\": {},\n \"references\": {},\n \"processor_reference\": \"<string>\",\n \"bank_reference\": \"<string>\",\n \"transaction_tags\": [\n \"<string>\"\n ],\n \"payment_processor\": \"<string>\",\n \"processing_fee_cents\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-backend.thredfi.com/v1/platform/businesses/{business_id}/invoices/payments/{payment_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"total_amount_cents\": 2,\n \"allocations\": [\n {\n \"invoice_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount_cents\": 2\n }\n ],\n \"payment_date\": \"2023-12-25\",\n \"currency\": \"<string>\",\n \"payment_reference\": \"<string>\",\n \"external_id\": \"<string>\",\n \"note\": \"<string>\",\n \"notes\": \"<string>\",\n \"metadata\": {},\n \"references\": {},\n \"processor_reference\": \"<string>\",\n \"bank_reference\": \"<string>\",\n \"transaction_tags\": [\n \"<string>\"\n ],\n \"payment_processor\": \"<string>\",\n \"processing_fee_cents\": 1\n}"
response = http.request(request)
puts response.read_body{
"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
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
Serializer for updating existing payments. Matches the create endpoint structure (InvoiceRecordPaymentRequestSerializer) to provide consistency between create and update APIs.
Updated payment method (bank_transfer, card, cash, cheque, direct_debit)
bank_transfer- bank_transfercredit_card- credit_carddebit_card- debit_cardach- achcheck- checkcash- cashpaypal- paypalstripe- stripeother- other
bank_transfer, credit_card, debit_card, ach, check, cash, paypal, stripe, other Updated payment status (pending, processing, completed, failed, cancelled, refunded)
pending- Pendingprocessing- Processingcompleted- Completedfailed- Failedcancelled- Cancelledrefunded- Refunded
pending, processing, completed, failed, cancelled, refunded Was this page helpful?