Skip to main content
POST
Create CustomerCreditV2 record

Authorizations

X-API-KEY
string
header
required

Headers

Idempotency-Key
string

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: 255

Body

application/json

Input schema for creating Customer Credit records.

date
string<date>
required
company_id
integer
required
currency_iso_4217_code
enum<string>
required
Available options:
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
exchange_rate
required
bill_to_address
string | null
default:""
deprecated

Deprecated: send the structured billing_address / shipping_address instead.

ship_to_address
string | null
default:""
deprecated

Deprecated: send the structured billing_address / shipping_address instead.

billing_address
AddressSchemaIn · object | null
shipping_address
AddressSchemaIn · object | null
supply_date
string<date> | null
place_of_supply
string | null
Maximum string length: 2
tax_registration_numbers
TaxRegistrationNumbersSnapshot · object | null
tax_metadata
object | null
custom_fields
Custom Fields · object[] | null
transaction_date
string<date> | null
auto_calculate_tax
enum<string> | null

Set to "required" to calculate tax for every line and replace any supplied tax amounts before saving, or return 422 when calculation cannot complete. Omit the field to keep caller-supplied tax. The calculation supports native US sales tax (the DualEntry tax engine) and Avalara Sales Tax, VAT, and GST. Native VAT and GST return 422, because this field does not select a rate. Tax addresses: money-in uses shipping_address, then billing_address, then the customer saved address. Money-out uses ship_from_address and ship_to_address, then the vendor and company saved addresses. When a money-in payload has no address, DualEntry copies the customer saved address to billing_address and shipping_address. A money-out record saves only the ship addresses that the payload sends. Returns 422 when calculation cannot resolve a required address.

Available options:
required
invoice_number
integer | null
cash_sale_number
integer | null
customer_id
integer | null

If this customer is intercompany, DualEntry also writes a transaction in the elimination company.

memo
string
default:""
reference_number
string
default:""
items
PublicCustomerCreditItemIn · object[]
attachments
AttachmentSchemaOut · object[]
record_status
enum<string>
default:posted
Available options:
draft,
posted,
archived
contract_id
integer | null

Response

OK

bill_to_address
string
required
deprecated

Deprecated: send the structured billing_address / shipping_address instead.

ship_to_address
string
required
deprecated

Deprecated: send the structured billing_address / shipping_address instead.

transaction_ids
integer[]
required
internal_id
integer
required
number
integer
required
invoice_number
integer | null
required
cash_sale_number
integer | null
required
date
string<date>
required

Posting date (GL date) - the date when the transaction is recorded in the general ledger

transaction_date
string<date>
required

Transaction date (inception date) - the date when the transaction actually occurred

company_id
integer
required
company_name
string
required
company_currency
string
required
currency_iso_4217_code
enum<string> | null
required
Available options:
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
exchange_rate
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,16}0*$
amount
string
required

Total transaction amount

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$
used_amount
string
required

Amount that was already applied to Invoices through Customer Refunds or Customer Prepayment Applications

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$
remaining_amount
string
required

Amount that can be applied to Invoices through Customer Refunds or Customer Prepayment Applications

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$
memo
string
required
reference_number
string
required
record_status
enum<string>
required
Available options:
draft,
posted,
archived
created_at
string<date-time>
required

Date and time the record was created

updated_at
string<date-time>
required

Date and time the record was last updated

billing_address
AddressSchemaOut · object | null
shipping_address
AddressSchemaOut · object | null
customer_id
integer | null
customer_name
string | null
attachments
PublicAttachmentSchemaOut · object[]
custom_fields
CustomFieldValuePairOutputSchema · object[]
integration_remote_records
IntegrationRemoteRecordSchemaOut · object[]
created_by
AuditActorSchemaOut · object | null

Schema for audit actor information.

updated_by
AuditActorSchemaOut · object | null

Schema for audit actor information.

code
string | null
items
PublicCustomerCreditItemOut · object[]
contract_id
integer | null
contracted
boolean
default:false
e_invoice
PublicEInvoiceSummarySchemaOut · object | null

The e-invoice filing of the record. Null when DualEntry did not file it. Not in v1.

has_more_lines
boolean
default:false
lines_count
integer
default:0