Update CustomerCredit record (partial) (v1)
Partially update an existing CustomerCredit record.
curl --request PATCH \
--url https://api.dualentry.com/public/v1/customer-credits/{record_number}/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"custom_fields": [
{}
],
"invoice_number": 123,
"cash_sale_number": 123,
"customer_id": 123,
"company_id": 123,
"memo": "<string>",
"exchange_rate": 123,
"items": [
{
"position": 123,
"item_id": 123,
"rate": 123,
"quantity": 123,
"tax": {
"code": "<string>",
"rate": 123,
"amount": 123,
"is_taxable": true,
"tax_exempt_amount": 123,
"vat_rate_id": 123,
"gst_tax_rate_id": 123,
"tax_metadata": {}
},
"id": 123,
"memo": "",
"classifications": [],
"company_id": 123
}
],
"attachments": [
{
"id": 123,
"file_name": "<string>",
"file_size": 123,
"download_url": "<string>",
"upload_url": "<string>",
"category": "default"
}
],
"contract_id": 123,
"bill_to_address": "<string>",
"billing_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"ship_to_address": "<string>",
"shipping_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"date": "2023-12-25",
"transaction_date": "2023-12-25"
}
'import requests
url = "https://api.dualentry.com/public/v1/customer-credits/{record_number}/"
payload = {
"custom_fields": [{}],
"invoice_number": 123,
"cash_sale_number": 123,
"customer_id": 123,
"company_id": 123,
"memo": "<string>",
"exchange_rate": 123,
"items": [
{
"position": 123,
"item_id": 123,
"rate": 123,
"quantity": 123,
"tax": {
"code": "<string>",
"rate": 123,
"amount": 123,
"is_taxable": True,
"tax_exempt_amount": 123,
"vat_rate_id": 123,
"gst_tax_rate_id": 123,
"tax_metadata": {}
},
"id": 123,
"memo": "",
"classifications": [],
"company_id": 123
}
],
"attachments": [
{
"id": 123,
"file_name": "<string>",
"file_size": 123,
"download_url": "<string>",
"upload_url": "<string>",
"category": "default"
}
],
"contract_id": 123,
"bill_to_address": "<string>",
"billing_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"ship_to_address": "<string>",
"shipping_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"date": "2023-12-25",
"transaction_date": "2023-12-25"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
custom_fields: [{}],
invoice_number: 123,
cash_sale_number: 123,
customer_id: 123,
company_id: 123,
memo: '<string>',
exchange_rate: 123,
items: [
{
position: 123,
item_id: 123,
rate: 123,
quantity: 123,
tax: {
code: '<string>',
rate: 123,
amount: 123,
is_taxable: true,
tax_exempt_amount: 123,
vat_rate_id: 123,
gst_tax_rate_id: 123,
tax_metadata: {}
},
id: 123,
memo: '',
classifications: [],
company_id: 123
}
],
attachments: [
{
id: 123,
file_name: '<string>',
file_size: 123,
download_url: '<string>',
upload_url: '<string>',
category: 'default'
}
],
contract_id: 123,
bill_to_address: '<string>',
billing_address: {
street: '<string>',
city: '<string>',
postal_code: '<string>',
state: '',
country: '',
second_line: '',
name: '<string>'
},
ship_to_address: '<string>',
shipping_address: {
street: '<string>',
city: '<string>',
postal_code: '<string>',
state: '',
country: '',
second_line: '',
name: '<string>'
},
date: '2023-12-25',
transaction_date: '2023-12-25'
})
};
fetch('https://api.dualentry.com/public/v1/customer-credits/{record_number}/', 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/v1/customer-credits/{record_number}/",
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([
'custom_fields' => [
[
]
],
'invoice_number' => 123,
'cash_sale_number' => 123,
'customer_id' => 123,
'company_id' => 123,
'memo' => '<string>',
'exchange_rate' => 123,
'items' => [
[
'position' => 123,
'item_id' => 123,
'rate' => 123,
'quantity' => 123,
'tax' => [
'code' => '<string>',
'rate' => 123,
'amount' => 123,
'is_taxable' => true,
'tax_exempt_amount' => 123,
'vat_rate_id' => 123,
'gst_tax_rate_id' => 123,
'tax_metadata' => [
]
],
'id' => 123,
'memo' => '',
'classifications' => [
],
'company_id' => 123
]
],
'attachments' => [
[
'id' => 123,
'file_name' => '<string>',
'file_size' => 123,
'download_url' => '<string>',
'upload_url' => '<string>',
'category' => 'default'
]
],
'contract_id' => 123,
'bill_to_address' => '<string>',
'billing_address' => [
'street' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '',
'country' => '',
'second_line' => '',
'name' => '<string>'
],
'ship_to_address' => '<string>',
'shipping_address' => [
'street' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '',
'country' => '',
'second_line' => '',
'name' => '<string>'
],
'date' => '2023-12-25',
'transaction_date' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/v1/customer-credits/{record_number}/"
payload := strings.NewReader("{\n \"custom_fields\": [\n {}\n ],\n \"invoice_number\": 123,\n \"cash_sale_number\": 123,\n \"customer_id\": 123,\n \"company_id\": 123,\n \"memo\": \"<string>\",\n \"exchange_rate\": 123,\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"rate\": 123,\n \"quantity\": 123,\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123,\n \"tax_metadata\": {}\n },\n \"id\": 123,\n \"memo\": \"\",\n \"classifications\": [],\n \"company_id\": 123\n }\n ],\n \"attachments\": [\n {\n \"id\": 123,\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"download_url\": \"<string>\",\n \"upload_url\": \"<string>\",\n \"category\": \"default\"\n }\n ],\n \"contract_id\": 123,\n \"bill_to_address\": \"<string>\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"<string>\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"date\": \"2023-12-25\",\n \"transaction_date\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://api.dualentry.com/public/v1/customer-credits/{record_number}/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"custom_fields\": [\n {}\n ],\n \"invoice_number\": 123,\n \"cash_sale_number\": 123,\n \"customer_id\": 123,\n \"company_id\": 123,\n \"memo\": \"<string>\",\n \"exchange_rate\": 123,\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"rate\": 123,\n \"quantity\": 123,\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123,\n \"tax_metadata\": {}\n },\n \"id\": 123,\n \"memo\": \"\",\n \"classifications\": [],\n \"company_id\": 123\n }\n ],\n \"attachments\": [\n {\n \"id\": 123,\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"download_url\": \"<string>\",\n \"upload_url\": \"<string>\",\n \"category\": \"default\"\n }\n ],\n \"contract_id\": 123,\n \"bill_to_address\": \"<string>\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"<string>\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"date\": \"2023-12-25\",\n \"transaction_date\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v1/customer-credits/{record_number}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"custom_fields\": [\n {}\n ],\n \"invoice_number\": 123,\n \"cash_sale_number\": 123,\n \"customer_id\": 123,\n \"company_id\": 123,\n \"memo\": \"<string>\",\n \"exchange_rate\": 123,\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"rate\": 123,\n \"quantity\": 123,\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123,\n \"tax_metadata\": {}\n },\n \"id\": 123,\n \"memo\": \"\",\n \"classifications\": [],\n \"company_id\": 123\n }\n ],\n \"attachments\": [\n {\n \"id\": 123,\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"download_url\": \"<string>\",\n \"upload_url\": \"<string>\",\n \"category\": \"default\"\n }\n ],\n \"contract_id\": 123,\n \"bill_to_address\": \"<string>\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"<string>\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"date\": \"2023-12-25\",\n \"transaction_date\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"bill_to_address": "<string>",
"ship_to_address": "<string>",
"transaction_ids": [
123
],
"internal_id": 123,
"number": 123,
"invoice_number": 123,
"cash_sale_number": 123,
"date": "2023-12-25",
"transaction_date": "2023-12-25",
"company_id": 123,
"company_name": "<string>",
"company_currency": "<string>",
"currency_iso_4217_code": "AED",
"exchange_rate": "<string>",
"amount": "<string>",
"used_amount": "<string>",
"remaining_amount": "<string>",
"memo": "<string>",
"items": [
{
"item_id": 123,
"quantity": "<string>",
"rate": "<string>",
"position": 123,
"memo": "<string>",
"net_amount": "<string>",
"tax_amount": "<string>",
"gross_amount": "<string>",
"amount": "<string>",
"classifications": [],
"item_type": "<string>",
"hsn_sac_code": "<string>",
"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_type": "<string>",
"tax_treatment": "<string>"
},
"company_id": 123
}
],
"record_status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"billing_address": {
"street": "<string>",
"second_line": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"name": "<string>"
},
"shipping_address": {
"street": "<string>",
"second_line": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"name": "<string>"
},
"customer_id": 123,
"customer_name": "<string>",
"attachments": [],
"custom_fields": [],
"integration_remote_records": [],
"created_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"updated_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"contract_id": 123,
"contracted": false
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}Authorizations
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.
255Path Parameters
The number attribute of the record.
Body
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XAG, XAU, XCD, XDR, XOF, XPD, XPF, XPT, YER, ZAR, ZMW, ZWL Show child attributes
Show child attributes
Show child attributes
Show child attributes
draft, posted, archived Deprecated: send the structured billing_address / shipping_address instead.
Show child attributes
Show child attributes
Deprecated: send the structured billing_address / shipping_address instead.
Show child attributes
Show child attributes
Response
OK
Deprecated: send the structured billing_address / shipping_address instead.
Deprecated: send the structured billing_address / shipping_address instead.
Posting date (GL date) - the date when the transaction is recorded in the general ledger
Transaction date (inception date) - the date when the transaction actually occurred
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XAG, XAU, XCD, XDR, XOF, XPD, XPF, XPT, YER, ZAR, ZMW, ZWL ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,16}0*$Total transaction amount
^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$Amount that was already applied to Invoices through Customer Refunds or Customer Prepayment Applications
^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$Amount that can be applied to Invoices through Customer Refunds or Customer Prepayment Applications
^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$Show child attributes
Show child attributes
draft, posted, archived Date and time the record was created
Date and time the record was last updated
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Schema for audit actor information.
Show child attributes
Show child attributes
Schema for audit actor information.
Show child attributes
Show child attributes
Was this page helpful?
curl --request PATCH \
--url https://api.dualentry.com/public/v1/customer-credits/{record_number}/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"custom_fields": [
{}
],
"invoice_number": 123,
"cash_sale_number": 123,
"customer_id": 123,
"company_id": 123,
"memo": "<string>",
"exchange_rate": 123,
"items": [
{
"position": 123,
"item_id": 123,
"rate": 123,
"quantity": 123,
"tax": {
"code": "<string>",
"rate": 123,
"amount": 123,
"is_taxable": true,
"tax_exempt_amount": 123,
"vat_rate_id": 123,
"gst_tax_rate_id": 123,
"tax_metadata": {}
},
"id": 123,
"memo": "",
"classifications": [],
"company_id": 123
}
],
"attachments": [
{
"id": 123,
"file_name": "<string>",
"file_size": 123,
"download_url": "<string>",
"upload_url": "<string>",
"category": "default"
}
],
"contract_id": 123,
"bill_to_address": "<string>",
"billing_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"ship_to_address": "<string>",
"shipping_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"date": "2023-12-25",
"transaction_date": "2023-12-25"
}
'import requests
url = "https://api.dualentry.com/public/v1/customer-credits/{record_number}/"
payload = {
"custom_fields": [{}],
"invoice_number": 123,
"cash_sale_number": 123,
"customer_id": 123,
"company_id": 123,
"memo": "<string>",
"exchange_rate": 123,
"items": [
{
"position": 123,
"item_id": 123,
"rate": 123,
"quantity": 123,
"tax": {
"code": "<string>",
"rate": 123,
"amount": 123,
"is_taxable": True,
"tax_exempt_amount": 123,
"vat_rate_id": 123,
"gst_tax_rate_id": 123,
"tax_metadata": {}
},
"id": 123,
"memo": "",
"classifications": [],
"company_id": 123
}
],
"attachments": [
{
"id": 123,
"file_name": "<string>",
"file_size": 123,
"download_url": "<string>",
"upload_url": "<string>",
"category": "default"
}
],
"contract_id": 123,
"bill_to_address": "<string>",
"billing_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"ship_to_address": "<string>",
"shipping_address": {
"street": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "",
"country": "",
"second_line": "",
"name": "<string>"
},
"date": "2023-12-25",
"transaction_date": "2023-12-25"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
custom_fields: [{}],
invoice_number: 123,
cash_sale_number: 123,
customer_id: 123,
company_id: 123,
memo: '<string>',
exchange_rate: 123,
items: [
{
position: 123,
item_id: 123,
rate: 123,
quantity: 123,
tax: {
code: '<string>',
rate: 123,
amount: 123,
is_taxable: true,
tax_exempt_amount: 123,
vat_rate_id: 123,
gst_tax_rate_id: 123,
tax_metadata: {}
},
id: 123,
memo: '',
classifications: [],
company_id: 123
}
],
attachments: [
{
id: 123,
file_name: '<string>',
file_size: 123,
download_url: '<string>',
upload_url: '<string>',
category: 'default'
}
],
contract_id: 123,
bill_to_address: '<string>',
billing_address: {
street: '<string>',
city: '<string>',
postal_code: '<string>',
state: '',
country: '',
second_line: '',
name: '<string>'
},
ship_to_address: '<string>',
shipping_address: {
street: '<string>',
city: '<string>',
postal_code: '<string>',
state: '',
country: '',
second_line: '',
name: '<string>'
},
date: '2023-12-25',
transaction_date: '2023-12-25'
})
};
fetch('https://api.dualentry.com/public/v1/customer-credits/{record_number}/', 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/v1/customer-credits/{record_number}/",
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([
'custom_fields' => [
[
]
],
'invoice_number' => 123,
'cash_sale_number' => 123,
'customer_id' => 123,
'company_id' => 123,
'memo' => '<string>',
'exchange_rate' => 123,
'items' => [
[
'position' => 123,
'item_id' => 123,
'rate' => 123,
'quantity' => 123,
'tax' => [
'code' => '<string>',
'rate' => 123,
'amount' => 123,
'is_taxable' => true,
'tax_exempt_amount' => 123,
'vat_rate_id' => 123,
'gst_tax_rate_id' => 123,
'tax_metadata' => [
]
],
'id' => 123,
'memo' => '',
'classifications' => [
],
'company_id' => 123
]
],
'attachments' => [
[
'id' => 123,
'file_name' => '<string>',
'file_size' => 123,
'download_url' => '<string>',
'upload_url' => '<string>',
'category' => 'default'
]
],
'contract_id' => 123,
'bill_to_address' => '<string>',
'billing_address' => [
'street' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '',
'country' => '',
'second_line' => '',
'name' => '<string>'
],
'ship_to_address' => '<string>',
'shipping_address' => [
'street' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '',
'country' => '',
'second_line' => '',
'name' => '<string>'
],
'date' => '2023-12-25',
'transaction_date' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/v1/customer-credits/{record_number}/"
payload := strings.NewReader("{\n \"custom_fields\": [\n {}\n ],\n \"invoice_number\": 123,\n \"cash_sale_number\": 123,\n \"customer_id\": 123,\n \"company_id\": 123,\n \"memo\": \"<string>\",\n \"exchange_rate\": 123,\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"rate\": 123,\n \"quantity\": 123,\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123,\n \"tax_metadata\": {}\n },\n \"id\": 123,\n \"memo\": \"\",\n \"classifications\": [],\n \"company_id\": 123\n }\n ],\n \"attachments\": [\n {\n \"id\": 123,\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"download_url\": \"<string>\",\n \"upload_url\": \"<string>\",\n \"category\": \"default\"\n }\n ],\n \"contract_id\": 123,\n \"bill_to_address\": \"<string>\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"<string>\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"date\": \"2023-12-25\",\n \"transaction_date\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://api.dualentry.com/public/v1/customer-credits/{record_number}/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"custom_fields\": [\n {}\n ],\n \"invoice_number\": 123,\n \"cash_sale_number\": 123,\n \"customer_id\": 123,\n \"company_id\": 123,\n \"memo\": \"<string>\",\n \"exchange_rate\": 123,\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"rate\": 123,\n \"quantity\": 123,\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123,\n \"tax_metadata\": {}\n },\n \"id\": 123,\n \"memo\": \"\",\n \"classifications\": [],\n \"company_id\": 123\n }\n ],\n \"attachments\": [\n {\n \"id\": 123,\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"download_url\": \"<string>\",\n \"upload_url\": \"<string>\",\n \"category\": \"default\"\n }\n ],\n \"contract_id\": 123,\n \"bill_to_address\": \"<string>\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"<string>\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"date\": \"2023-12-25\",\n \"transaction_date\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v1/customer-credits/{record_number}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"custom_fields\": [\n {}\n ],\n \"invoice_number\": 123,\n \"cash_sale_number\": 123,\n \"customer_id\": 123,\n \"company_id\": 123,\n \"memo\": \"<string>\",\n \"exchange_rate\": 123,\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"rate\": 123,\n \"quantity\": 123,\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123,\n \"tax_metadata\": {}\n },\n \"id\": 123,\n \"memo\": \"\",\n \"classifications\": [],\n \"company_id\": 123\n }\n ],\n \"attachments\": [\n {\n \"id\": 123,\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"download_url\": \"<string>\",\n \"upload_url\": \"<string>\",\n \"category\": \"default\"\n }\n ],\n \"contract_id\": 123,\n \"bill_to_address\": \"<string>\",\n \"billing_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"ship_to_address\": \"<string>\",\n \"shipping_address\": {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"\",\n \"country\": \"\",\n \"second_line\": \"\",\n \"name\": \"<string>\"\n },\n \"date\": \"2023-12-25\",\n \"transaction_date\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"bill_to_address": "<string>",
"ship_to_address": "<string>",
"transaction_ids": [
123
],
"internal_id": 123,
"number": 123,
"invoice_number": 123,
"cash_sale_number": 123,
"date": "2023-12-25",
"transaction_date": "2023-12-25",
"company_id": 123,
"company_name": "<string>",
"company_currency": "<string>",
"currency_iso_4217_code": "AED",
"exchange_rate": "<string>",
"amount": "<string>",
"used_amount": "<string>",
"remaining_amount": "<string>",
"memo": "<string>",
"items": [
{
"item_id": 123,
"quantity": "<string>",
"rate": "<string>",
"position": 123,
"memo": "<string>",
"net_amount": "<string>",
"tax_amount": "<string>",
"gross_amount": "<string>",
"amount": "<string>",
"classifications": [],
"item_type": "<string>",
"hsn_sac_code": "<string>",
"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_type": "<string>",
"tax_treatment": "<string>"
},
"company_id": 123
}
],
"record_status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"billing_address": {
"street": "<string>",
"second_line": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"name": "<string>"
},
"shipping_address": {
"street": "<string>",
"second_line": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"name": "<string>"
},
"customer_id": 123,
"customer_name": "<string>",
"attachments": [],
"custom_fields": [],
"integration_remote_records": [],
"created_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"updated_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"contract_id": 123,
"contracted": false
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}