curl --request PUT \
--url https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"memo": "<string>",
"tags": [
{}
],
"metadata": {},
"source_bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"amount": 2,
"sales_taxes": [
{}
],
"expense_account_identifier": "<unknown>",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>",
"tags": [
{}
]
}
],
"allocations": [
{
"amount": 2,
"bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"document": {
"file": "<string>",
"document_type": "vendor_credit",
"upload_source": "<string>",
"metadata": "<unknown>",
"tags": "<unknown>"
}
}
'import requests
url = "https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/"
payload = {
"external_id": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"memo": "<string>",
"tags": [{}],
"metadata": {},
"source_bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"amount": 2,
"sales_taxes": [{}],
"expense_account_identifier": "<unknown>",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>",
"tags": [{}]
}
],
"allocations": [
{
"amount": 2,
"bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"document": {
"file": "<string>",
"document_type": "vendor_credit",
"upload_source": "<string>",
"metadata": "<unknown>",
"tags": "<unknown>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: '<string>',
received_at: '2023-11-07T05:31:56Z',
memo: '<string>',
tags: [{}],
metadata: {},
source_bill_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
line_items: [
{
amount: 2,
sales_taxes: [{}],
expense_account_identifier: '<unknown>',
memo: '<string>',
metadata: {},
reference_number: '<string>',
tags: [{}]
}
],
allocations: [{amount: 2, bill_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}],
document: {
file: '<string>',
document_type: 'vendor_credit',
upload_source: '<string>',
metadata: '<unknown>',
tags: '<unknown>'
}
})
};
fetch('https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_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://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => '<string>',
'received_at' => '2023-11-07T05:31:56Z',
'memo' => '<string>',
'tags' => [
[
]
],
'metadata' => [
],
'source_bill_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'line_items' => [
[
'amount' => 2,
'sales_taxes' => [
[
]
],
'expense_account_identifier' => '<unknown>',
'memo' => '<string>',
'metadata' => [
],
'reference_number' => '<string>',
'tags' => [
[
]
]
]
],
'allocations' => [
[
'amount' => 2,
'bill_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'document' => [
'file' => '<string>',
'document_type' => 'vendor_credit',
'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://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"received_at\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"metadata\": {},\n \"source_bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"amount\": 2,\n \"sales_taxes\": [\n {}\n ],\n \"expense_account_identifier\": \"<unknown>\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\",\n \"tags\": [\n {}\n ]\n }\n ],\n \"allocations\": [\n {\n \"amount\": 2,\n \"bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"vendor_credit\",\n \"upload_source\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"tags\": \"<unknown>\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"received_at\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"metadata\": {},\n \"source_bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"amount\": 2,\n \"sales_taxes\": [\n {}\n ],\n \"expense_account_identifier\": \"<unknown>\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\",\n \"tags\": [\n {}\n ]\n }\n ],\n \"allocations\": [\n {\n \"amount\": 2,\n \"bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"vendor_credit\",\n \"upload_source\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"tags\": \"<unknown>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"<string>\",\n \"received_at\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"metadata\": {},\n \"source_bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"amount\": 2,\n \"sales_taxes\": [\n {}\n ],\n \"expense_account_identifier\": \"<unknown>\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\",\n \"tags\": [\n {}\n ]\n }\n ],\n \"allocations\": [\n {\n \"amount\": 2,\n \"bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"vendor_credit\",\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",
"status": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"vendor": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"display_name": "<string>"
},
"source_bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"amount": 123,
"expense_account_identifier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "AccountId"
},
"tags": [
"<string>"
],
"memo": "<string>",
"metadata": "<unknown>"
}
],
"allocations": [
{
"bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bill_number": "<string>",
"amount_cents": 123,
"bill_outstanding_balance_cents": 123,
"applied_at": "2023-11-07T05:31:56Z"
}
],
"tags": [
{}
],
"total_amount": 123,
"applied_amount": 123,
"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>",
"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>"
}Update Vendor Credit
Update vendor credit.
curl --request PUT \
--url https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"memo": "<string>",
"tags": [
{}
],
"metadata": {},
"source_bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"amount": 2,
"sales_taxes": [
{}
],
"expense_account_identifier": "<unknown>",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>",
"tags": [
{}
]
}
],
"allocations": [
{
"amount": 2,
"bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"document": {
"file": "<string>",
"document_type": "vendor_credit",
"upload_source": "<string>",
"metadata": "<unknown>",
"tags": "<unknown>"
}
}
'import requests
url = "https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/"
payload = {
"external_id": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"memo": "<string>",
"tags": [{}],
"metadata": {},
"source_bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"amount": 2,
"sales_taxes": [{}],
"expense_account_identifier": "<unknown>",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>",
"tags": [{}]
}
],
"allocations": [
{
"amount": 2,
"bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"document": {
"file": "<string>",
"document_type": "vendor_credit",
"upload_source": "<string>",
"metadata": "<unknown>",
"tags": "<unknown>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: '<string>',
received_at: '2023-11-07T05:31:56Z',
memo: '<string>',
tags: [{}],
metadata: {},
source_bill_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
line_items: [
{
amount: 2,
sales_taxes: [{}],
expense_account_identifier: '<unknown>',
memo: '<string>',
metadata: {},
reference_number: '<string>',
tags: [{}]
}
],
allocations: [{amount: 2, bill_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}],
document: {
file: '<string>',
document_type: 'vendor_credit',
upload_source: '<string>',
metadata: '<unknown>',
tags: '<unknown>'
}
})
};
fetch('https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_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://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => '<string>',
'received_at' => '2023-11-07T05:31:56Z',
'memo' => '<string>',
'tags' => [
[
]
],
'metadata' => [
],
'source_bill_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'line_items' => [
[
'amount' => 2,
'sales_taxes' => [
[
]
],
'expense_account_identifier' => '<unknown>',
'memo' => '<string>',
'metadata' => [
],
'reference_number' => '<string>',
'tags' => [
[
]
]
]
],
'allocations' => [
[
'amount' => 2,
'bill_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'document' => [
'file' => '<string>',
'document_type' => 'vendor_credit',
'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://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"received_at\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"metadata\": {},\n \"source_bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"amount\": 2,\n \"sales_taxes\": [\n {}\n ],\n \"expense_account_identifier\": \"<unknown>\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\",\n \"tags\": [\n {}\n ]\n }\n ],\n \"allocations\": [\n {\n \"amount\": 2,\n \"bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"vendor_credit\",\n \"upload_source\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"tags\": \"<unknown>\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"received_at\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"metadata\": {},\n \"source_bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"amount\": 2,\n \"sales_taxes\": [\n {}\n ],\n \"expense_account_identifier\": \"<unknown>\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\",\n \"tags\": [\n {}\n ]\n }\n ],\n \"allocations\": [\n {\n \"amount\": 2,\n \"bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"vendor_credit\",\n \"upload_source\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"tags\": \"<unknown>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.thredfi.com/v1/platform/businesses/{business_id}/vendor-credits/{credit_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"<string>\",\n \"received_at\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"metadata\": {},\n \"source_bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"amount\": 2,\n \"sales_taxes\": [\n {}\n ],\n \"expense_account_identifier\": \"<unknown>\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\",\n \"tags\": [\n {}\n ]\n }\n ],\n \"allocations\": [\n {\n \"amount\": 2,\n \"bill_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"document\": {\n \"file\": \"<string>\",\n \"document_type\": \"vendor_credit\",\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",
"status": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"vendor": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"display_name": "<string>"
},
"source_bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"amount": 123,
"expense_account_identifier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "AccountId"
},
"tags": [
"<string>"
],
"memo": "<string>",
"metadata": "<unknown>"
}
],
"allocations": [
{
"bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bill_number": "<string>",
"amount_cents": 123,
"bill_outstanding_balance_cents": 123,
"applied_at": "2023-11-07T05:31:56Z"
}
],
"tags": [
{}
],
"total_amount": 123,
"applied_amount": 123,
"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>",
"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
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
^[0-9a-f-]+$A UUID string identifying this vendor credit note.
Body
Update serializer for vendor credits.
Allows updating basic fields and replacing line items/allocations under safe conditions.
Updated external system identifier (must remain unique within business)
Updated received date/time (ISO 8601 format, changes status from draft to received)
Updated memo or description for the credit
Updated transaction tags for categorization (array of key-value pairs)
Show child attributes
Show child attributes
Updated custom key-value pairs (max 10kb)
Show child attributes
Show child attributes
Bill ID this credit was created from (cannot be changed once set)
Updated line items (cannot change once credit is applied or partially applied)
Show child attributes
Show child attributes
Updated bill allocations for this credit
Show child attributes
Show child attributes
Optional document upload
Show child attributes
Show child attributes
Response
Vendor credit serializer for API responses.
Unique vendor credit identifier
Credit status: draft, received, partially_applied, applied, void (computed from allocations)
When the credit was received
Vendor who issued the credit (inline details)
Show child attributes
Show child attributes
Bill ID this credit was created from (origin tracking, not allocation)
Array of credit line items
Show child attributes
Show child attributes
Array of bill allocations
Show child attributes
Show child attributes
Transaction tags for the credit
Show child attributes
Show child attributes
Total credit amount in cents
Applied credit amount in cents
Latest document linked to this vendor credit
Show child attributes
Show child attributes
Credit creation timestamp
Last update timestamp
Your external system identifier for this credit (used for idempotency)
255Credit currency (e.g., GBP, EUR, USD)
EUR- EuroGBP- British PoundUSD- US DollarSEK- Swedish KronaNOK- Norwegian KroneDKK- Danish KroneISK- Icelandic KrónaMYR- Malaysian RinggitSGD- Singapore Dollar
EUR, GBP, USD, SEK, NOK, DKK, ISK, MYR, SGD Was this page helpful?