Create VendorCredit record attachments
curl --request POST \
--url https://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/ \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-KEY: <api-key>' \
--form files=@example-fileimport requests
url = "https://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/"
files = { "files": ("example-file", open("example-file", "rb")) }
headers = {"X-API-KEY": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
const options = {method: 'POST', headers: {'X-API-KEY': '<api-key>'}};
options.body = form;
fetch('https://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/', 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://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-API-KEY: <api-key>"
],
]);
$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://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/")
.header("X-API-KEY", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"supply_date": "2023-12-25",
"tax": {
"regime": "SALES_TAX",
"data": {}
},
"transaction_ids": [
123
],
"internal_id": 123,
"number": 123,
"date": "2023-12-25",
"transaction_date": "2023-12-25",
"company_id": 123,
"company_name": "<string>",
"company_currency": "<string>",
"vendor_id": 123,
"vendor_name": "<string>",
"ap_account_id": 123,
"currency_iso_4217_code": "<string>",
"exchange_rate": "<string>",
"memo": "<string>",
"items": [
{
"id": 123,
"position": 123,
"rate": "<string>",
"quantity": "<string>",
"memo": "<string>",
"payable_amount": "<string>",
"net_amount": "<string>",
"tax_amount": "<string>",
"gross_amount": "<string>",
"amount": "<string>",
"credited_bill_line_id": 123,
"tax": {
"code": "<string>",
"rate": "<string>",
"amount": "<string>",
"is_taxable": true,
"tax_exempt_amount": "<string>",
"vat_rate_id": 123,
"gst_tax_rate_id": 123,
"tax_metadata": {},
"tax_components": [
{
"component_type": "CGST",
"rate": "<string>",
"amount": "<string>",
"position": 123,
"region": "<string>"
}
],
"amount_with_tax": "<string>",
"rate_name": "<string>",
"rate_description": "<string>",
"rate_type": "<string>",
"tax_treatment": "<string>",
"valid_to": "2023-12-25"
},
"is_billable": false,
"billable_customer_id": 123,
"billable_project_id": 123,
"billable_markup_pct": "<string>",
"item_id": 123,
"classifications": [],
"company_id": 123,
"custom_fields": [],
"item_type": "<string>",
"hsn_sac_code": "<string>",
"withholding_tax": {
"rate_id": 123,
"name": "<string>",
"rate": "0.100000",
"amount": "<string>"
},
"credited_bill_line": {
"id": 123,
"bill_id": 123,
"bill_number": 123,
"position": 123
},
"billable_customer_name": "<string>",
"billable_project_name": "<string>",
"item_name": "<string>"
}
],
"expenses": [
{
"id": 123,
"quantity": "<string>",
"rate": "<string>",
"position": 123,
"expense_description": "<string>",
"payable_amount": "<string>",
"net_amount": "<string>",
"tax_amount": "<string>",
"gross_amount": "<string>",
"amount": "<string>",
"credited_bill_line_id": 123,
"tax": {
"code": "<string>",
"rate": "<string>",
"amount": "<string>",
"is_taxable": true,
"tax_exempt_amount": "<string>",
"vat_rate_id": 123,
"gst_tax_rate_id": 123,
"tax_metadata": {},
"tax_components": [
{
"component_type": "CGST",
"rate": "<string>",
"amount": "<string>",
"position": 123,
"region": "<string>"
}
],
"amount_with_tax": "<string>",
"rate_name": "<string>",
"rate_description": "<string>",
"rate_type": "<string>",
"tax_treatment": "<string>",
"valid_to": "2023-12-25"
},
"is_billable": false,
"billable_customer_id": 123,
"billable_project_id": 123,
"billable_markup_pct": "<string>",
"special_tax_treatment": "IMPORT_VAT",
"account_number": 123,
"customer_id": 123,
"vendor_id": 123,
"classifications": [],
"company_id": 123,
"custom_fields": [],
"withholding_tax": {
"rate_id": 123,
"name": "<string>",
"rate": "0.100000",
"amount": "<string>"
},
"credited_bill_line": {
"id": 123,
"bill_id": 123,
"bill_number": 123,
"position": 123
},
"billable_customer_name": "<string>",
"billable_project_name": "<string>",
"account_name": "<string>",
"customer_name": "<string>",
"vendor_name": "<string>"
}
],
"amount": "<string>",
"used_amount": "<string>",
"remaining_amount": "<string>",
"record_status": "draft",
"tax_total": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": [],
"withholding_tax_total": "0.00",
"attachments": [],
"ship_from_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"ship_to_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"place_of_supply": "<string>",
"tax_registration_numbers": {
"company": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
],
"counterparty": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
]
},
"tax_metadata": {},
"classifications": [],
"created_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"via": "<string>",
"agent_id": 123,
"agent_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"updated_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"via": "<string>",
"agent_id": 123,
"agent_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"code": "<string>",
"bill_number": 123,
"direct_expense_number": 123
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}Vendor Credits
Create VendorCredit record attachments
Upload attachments to a VendorCredit record.
POST
/
public
/
v2
/
vendor-credits
/
{record_number}
/
attachments
/
Create VendorCredit record attachments
curl --request POST \
--url https://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/ \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-KEY: <api-key>' \
--form files=@example-fileimport requests
url = "https://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/"
files = { "files": ("example-file", open("example-file", "rb")) }
headers = {"X-API-KEY": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
const options = {method: 'POST', headers: {'X-API-KEY': '<api-key>'}};
options.body = form;
fetch('https://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/', 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://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-API-KEY: <api-key>"
],
]);
$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://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/")
.header("X-API-KEY", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v2/vendor-credits/{record_number}/attachments/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"supply_date": "2023-12-25",
"tax": {
"regime": "SALES_TAX",
"data": {}
},
"transaction_ids": [
123
],
"internal_id": 123,
"number": 123,
"date": "2023-12-25",
"transaction_date": "2023-12-25",
"company_id": 123,
"company_name": "<string>",
"company_currency": "<string>",
"vendor_id": 123,
"vendor_name": "<string>",
"ap_account_id": 123,
"currency_iso_4217_code": "<string>",
"exchange_rate": "<string>",
"memo": "<string>",
"items": [
{
"id": 123,
"position": 123,
"rate": "<string>",
"quantity": "<string>",
"memo": "<string>",
"payable_amount": "<string>",
"net_amount": "<string>",
"tax_amount": "<string>",
"gross_amount": "<string>",
"amount": "<string>",
"credited_bill_line_id": 123,
"tax": {
"code": "<string>",
"rate": "<string>",
"amount": "<string>",
"is_taxable": true,
"tax_exempt_amount": "<string>",
"vat_rate_id": 123,
"gst_tax_rate_id": 123,
"tax_metadata": {},
"tax_components": [
{
"component_type": "CGST",
"rate": "<string>",
"amount": "<string>",
"position": 123,
"region": "<string>"
}
],
"amount_with_tax": "<string>",
"rate_name": "<string>",
"rate_description": "<string>",
"rate_type": "<string>",
"tax_treatment": "<string>",
"valid_to": "2023-12-25"
},
"is_billable": false,
"billable_customer_id": 123,
"billable_project_id": 123,
"billable_markup_pct": "<string>",
"item_id": 123,
"classifications": [],
"company_id": 123,
"custom_fields": [],
"item_type": "<string>",
"hsn_sac_code": "<string>",
"withholding_tax": {
"rate_id": 123,
"name": "<string>",
"rate": "0.100000",
"amount": "<string>"
},
"credited_bill_line": {
"id": 123,
"bill_id": 123,
"bill_number": 123,
"position": 123
},
"billable_customer_name": "<string>",
"billable_project_name": "<string>",
"item_name": "<string>"
}
],
"expenses": [
{
"id": 123,
"quantity": "<string>",
"rate": "<string>",
"position": 123,
"expense_description": "<string>",
"payable_amount": "<string>",
"net_amount": "<string>",
"tax_amount": "<string>",
"gross_amount": "<string>",
"amount": "<string>",
"credited_bill_line_id": 123,
"tax": {
"code": "<string>",
"rate": "<string>",
"amount": "<string>",
"is_taxable": true,
"tax_exempt_amount": "<string>",
"vat_rate_id": 123,
"gst_tax_rate_id": 123,
"tax_metadata": {},
"tax_components": [
{
"component_type": "CGST",
"rate": "<string>",
"amount": "<string>",
"position": 123,
"region": "<string>"
}
],
"amount_with_tax": "<string>",
"rate_name": "<string>",
"rate_description": "<string>",
"rate_type": "<string>",
"tax_treatment": "<string>",
"valid_to": "2023-12-25"
},
"is_billable": false,
"billable_customer_id": 123,
"billable_project_id": 123,
"billable_markup_pct": "<string>",
"special_tax_treatment": "IMPORT_VAT",
"account_number": 123,
"customer_id": 123,
"vendor_id": 123,
"classifications": [],
"company_id": 123,
"custom_fields": [],
"withholding_tax": {
"rate_id": 123,
"name": "<string>",
"rate": "0.100000",
"amount": "<string>"
},
"credited_bill_line": {
"id": 123,
"bill_id": 123,
"bill_number": 123,
"position": 123
},
"billable_customer_name": "<string>",
"billable_project_name": "<string>",
"account_name": "<string>",
"customer_name": "<string>",
"vendor_name": "<string>"
}
],
"amount": "<string>",
"used_amount": "<string>",
"remaining_amount": "<string>",
"record_status": "draft",
"tax_total": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": [],
"withholding_tax_total": "0.00",
"attachments": [],
"ship_from_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"ship_to_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"place_of_supply": "<string>",
"tax_registration_numbers": {
"company": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
],
"counterparty": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
]
},
"tax_metadata": {},
"classifications": [],
"created_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"via": "<string>",
"agent_id": 123,
"agent_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"updated_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"via": "<string>",
"agent_id": 123,
"agent_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"code": "<string>",
"bill_number": 123,
"direct_expense_number": 123
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}Headers
Optional. A unique value (a UUID works well) identifying this operation. If the request is repeated with the same key, the original response is replayed instead of the operation running again, so a retry cannot create a duplicate record. Results are replayable for 48 hours. Reusing a key with a different request body returns 422.
Maximum string length:
255Response
OK
Was this page helpful?