curl --request POST \
--url https://api.valyx.com/external/invoice/upsert \
--header 'Content-Type: application/json' \
--header 'X-Valyx-Signature: <x-valyx-signature>' \
--data '
{
"invoice": {
"invoiceId": "<string>",
"invoiceNumber": "<string>",
"invoiceSubtotal": 123,
"invoiceAdjustedAmount": 0,
"invoicePaidAmount": 0,
"invoiceTotal": 0,
"invoiceCurrency": "INR",
"invoiceDate": {},
"invoiceDueDate": {},
"promiseToPayDate": {},
"invoiceTax": {
"total": 0,
"gstTax": {
"totalGst": 0,
"totalGstRate": 0,
"cgst": 0,
"cgstRate": 0,
"sgst": 0,
"sgstRate": 0,
"igst": 0,
"igstRate": 0
},
"cessTax": {
"cess": 0,
"cessRate": 0
},
"serviceTax": {
"serviceTax": 0,
"serviceTaxRate": 0
},
"tdsTax": {
"tds": 0,
"tdsRate": 0
},
"otherTaxes": [
{
"name": "<string>",
"genericTax": 0,
"genericTaxRate": 0
}
],
"cgst": 123,
"sgst": 123,
"igst": 123,
"tds": 0
},
"discount": {
"amount": 0,
"percentage": 0,
"isPostTax": false
},
"discounts": [
{
"amount": 0,
"percentage": 0,
"isPostTax": false
}
],
"discountSplitByWeight": true,
"invoiceAcceptanceStatus": "PENDING",
"customerId": "<string>",
"customerDetails": {
"buyerId": "<string>",
"isManuallyCreated": true,
"taxIdentifiers": [
{
"value": "<string>",
"type": "GSTIN"
}
],
"companyId": "<string>",
"name": "<string>",
"alias": "<string>",
"registeredAddress": {
"line1": "<string>",
"line2": "<string>",
"state": "<string>",
"city": "<string>",
"country": "<string>",
"zipCode": "<string>"
},
"addresses": [
{
"line1": "<string>",
"line2": "<string>",
"state": "<string>",
"city": "<string>",
"country": "<string>",
"zipCode": "<string>"
}
],
"contactsData": [
{
"id": "<string>",
"name": "<string>",
"primaryPhone": "<string>",
"primaryEmail": "<string>",
"role": "<string>"
}
],
"ownersData": [
{
"id": "<string>",
"name": "<string>",
"primaryPhone": "<string>",
"primaryEmail": "<string>",
"role": "<string>",
"isRegistered": false
}
],
"stateCode": "<string>",
"countryCode": "IN",
"country": "<string>",
"primaryPhone": "<string>",
"primaryEmail": "<string>",
"customerContactPerson": "<string>",
"currency": "INR",
"currencyId": "<string>",
"tags": {},
"metaData": {},
"customerStatus": "PROSPECT",
"upcomingCustomerStatus": "PROSPECT",
"upcomingCustomerStatusChangeDate": "2023-12-25",
"upcomingCustomerStatusChangeReason": "<string>",
"upcomingCustomerStatusChangeByUserid": "<string>",
"erpId": "<string>"
},
"customerName": "<string>",
"invoiceType": "<string>",
"supplyStateCode": "<string>",
"placeOfSupply": "<string>",
"invoiceCurrencyId": "<string>",
"lineItems": [
{
"subTotal": 0,
"total": 0,
"lineItemDetails": {
"name": "<string>",
"taxRate": 123,
"pricePerItem": 0,
"hsnOrSacCode": "<string>",
"description": "<string>",
"companyId": "<string>",
"erpId": "<string>",
"lineItemId": "<string>"
},
"tax": {
"total": 0,
"gstTax": {
"totalGst": 0,
"totalGstRate": 0,
"cgst": 0,
"cgstRate": 0,
"sgst": 0,
"sgstRate": 0,
"igst": 0,
"igstRate": 0
},
"cessTax": {
"cess": 0,
"cessRate": 0
},
"serviceTax": {
"serviceTax": 0,
"serviceTaxRate": 0
},
"tdsTax": {
"tds": 0,
"tdsRate": 0
},
"otherTaxes": [
{
"name": "<string>",
"genericTax": 0,
"genericTaxRate": 0
}
],
"cgst": 123,
"sgst": 123,
"igst": 123,
"tds": 0
},
"discount": {
"amount": 0,
"percentage": 0,
"isPostTax": false
},
"quantity": 1
}
],
"referenceType": "<string>",
"referenceId": "<string>",
"referenceText": "<string>",
"eInvoiceQrCode": "<string>",
"irnNumber": "<string>",
"companyId": "<string>",
"tags": {},
"metaData": {},
"sort": "<string>",
"invoiceRoundingConfig": {
"type": "NEAREST",
"roundingDirection": "UP",
"isPostTax": true,
"decimalPlace": 2
},
"prepaidAmount": 123,
"createInvoiceAdjustments": [
{
"isPostTax": true,
"amount": 123,
"name": "<string>",
"reference": "<string>"
}
],
"erpId": "<string>"
}
}
'{}curl --request POST \
--url https://api.valyx.com/external/invoice/upsert \
--header 'Content-Type: application/json' \
--header 'X-Valyx-Signature: <x-valyx-signature>' \
--data '
{
"invoice": {
"invoiceId": "<string>",
"invoiceNumber": "<string>",
"invoiceSubtotal": 123,
"invoiceAdjustedAmount": 0,
"invoicePaidAmount": 0,
"invoiceTotal": 0,
"invoiceCurrency": "INR",
"invoiceDate": {},
"invoiceDueDate": {},
"promiseToPayDate": {},
"invoiceTax": {
"total": 0,
"gstTax": {
"totalGst": 0,
"totalGstRate": 0,
"cgst": 0,
"cgstRate": 0,
"sgst": 0,
"sgstRate": 0,
"igst": 0,
"igstRate": 0
},
"cessTax": {
"cess": 0,
"cessRate": 0
},
"serviceTax": {
"serviceTax": 0,
"serviceTaxRate": 0
},
"tdsTax": {
"tds": 0,
"tdsRate": 0
},
"otherTaxes": [
{
"name": "<string>",
"genericTax": 0,
"genericTaxRate": 0
}
],
"cgst": 123,
"sgst": 123,
"igst": 123,
"tds": 0
},
"discount": {
"amount": 0,
"percentage": 0,
"isPostTax": false
},
"discounts": [
{
"amount": 0,
"percentage": 0,
"isPostTax": false
}
],
"discountSplitByWeight": true,
"invoiceAcceptanceStatus": "PENDING",
"customerId": "<string>",
"customerDetails": {
"buyerId": "<string>",
"isManuallyCreated": true,
"taxIdentifiers": [
{
"value": "<string>",
"type": "GSTIN"
}
],
"companyId": "<string>",
"name": "<string>",
"alias": "<string>",
"registeredAddress": {
"line1": "<string>",
"line2": "<string>",
"state": "<string>",
"city": "<string>",
"country": "<string>",
"zipCode": "<string>"
},
"addresses": [
{
"line1": "<string>",
"line2": "<string>",
"state": "<string>",
"city": "<string>",
"country": "<string>",
"zipCode": "<string>"
}
],
"contactsData": [
{
"id": "<string>",
"name": "<string>",
"primaryPhone": "<string>",
"primaryEmail": "<string>",
"role": "<string>"
}
],
"ownersData": [
{
"id": "<string>",
"name": "<string>",
"primaryPhone": "<string>",
"primaryEmail": "<string>",
"role": "<string>",
"isRegistered": false
}
],
"stateCode": "<string>",
"countryCode": "IN",
"country": "<string>",
"primaryPhone": "<string>",
"primaryEmail": "<string>",
"customerContactPerson": "<string>",
"currency": "INR",
"currencyId": "<string>",
"tags": {},
"metaData": {},
"customerStatus": "PROSPECT",
"upcomingCustomerStatus": "PROSPECT",
"upcomingCustomerStatusChangeDate": "2023-12-25",
"upcomingCustomerStatusChangeReason": "<string>",
"upcomingCustomerStatusChangeByUserid": "<string>",
"erpId": "<string>"
},
"customerName": "<string>",
"invoiceType": "<string>",
"supplyStateCode": "<string>",
"placeOfSupply": "<string>",
"invoiceCurrencyId": "<string>",
"lineItems": [
{
"subTotal": 0,
"total": 0,
"lineItemDetails": {
"name": "<string>",
"taxRate": 123,
"pricePerItem": 0,
"hsnOrSacCode": "<string>",
"description": "<string>",
"companyId": "<string>",
"erpId": "<string>",
"lineItemId": "<string>"
},
"tax": {
"total": 0,
"gstTax": {
"totalGst": 0,
"totalGstRate": 0,
"cgst": 0,
"cgstRate": 0,
"sgst": 0,
"sgstRate": 0,
"igst": 0,
"igstRate": 0
},
"cessTax": {
"cess": 0,
"cessRate": 0
},
"serviceTax": {
"serviceTax": 0,
"serviceTaxRate": 0
},
"tdsTax": {
"tds": 0,
"tdsRate": 0
},
"otherTaxes": [
{
"name": "<string>",
"genericTax": 0,
"genericTaxRate": 0
}
],
"cgst": 123,
"sgst": 123,
"igst": 123,
"tds": 0
},
"discount": {
"amount": 0,
"percentage": 0,
"isPostTax": false
},
"quantity": 1
}
],
"referenceType": "<string>",
"referenceId": "<string>",
"referenceText": "<string>",
"eInvoiceQrCode": "<string>",
"irnNumber": "<string>",
"companyId": "<string>",
"tags": {},
"metaData": {},
"sort": "<string>",
"invoiceRoundingConfig": {
"type": "NEAREST",
"roundingDirection": "UP",
"isPostTax": true,
"decimalPlace": 2
},
"prepaidAmount": 123,
"createInvoiceAdjustments": [
{
"isPostTax": true,
"amount": 123,
"name": "<string>",
"reference": "<string>"
}
],
"erpId": "<string>"
}
}
'{}Auth key for fetching ledger entries
Show child attributes
invoiceId
invoiceNumber
invoiceSubtotal
invoiceAdjustedAmount
invoicePaidAmount
invoiceTotal
invoiceCurrency
Show child attributes
total
Show child attributes
totalGst
totalGstRate
cgst
cgstRate
sgst
sgstRate
igst
igstRate
cgst
sgst
igst
tds
discountSplitByWeight
PENDING, ACCEPTED, REJECTED "PENDING"
customerId
Show child attributes
buyerId
isManuallyCreated
companyId
name
alias
Show child attributes
line1
line2
state
city
country
zipCode
Show child attributes
line1
line2
state
city
country
zipCode
Show child attributes
id
name
primaryPhone
primaryEmail
role
Show child attributes
id
name
primaryPhone
primaryEmail
role
isRegistered
stateCode
countryCode
country
primaryPhone
primaryEmail
customerContactPerson
currency
currencyId
PROSPECT, LIVE, CHURNED, INACTIVE "PROSPECT"
PROSPECT, LIVE, CHURNED, INACTIVE "PROSPECT"
upcomingCustomerStatusChangeDate
upcomingCustomerStatusChangeReason
upcomingCustomerStatusChangeByUserid
erpId
customerName
invoiceType
supplyStateCode
placeOfSupply
invoiceCurrencyId
Show child attributes
subTotal
total
Show child attributes
name
taxRate
pricePerItem
hsnOrSacCode
description
companyId
erpId
lineItemId
Show child attributes
total
Show child attributes
totalGst
totalGstRate
cgst
cgstRate
sgst
sgstRate
igst
igstRate
cgst
sgst
igst
tds
quantity
referenceType
referenceId
referenceText
eInvoiceQrCode
irnNumber
companyId
sort
Show child attributes
NEAREST, UP, DOWN "NEAREST"
UP, DOWN "UP"
isPostTax
decimalPlace
prepaidAmount
erpId
Success
The response is of type object.