Skip to main content

Invoice Service

Invoice is a document issued by a seller to the buyer that indicates the quantities and costs of the products or services provider by the seller. Invoice specifies what a buyer must pay the seller according to the seller’s payment terms. Payment terms indicate the maximum amount of time that a buyer has to pay for the goods and/or services that they have purchased from the seller.

SalesInvoiceRequest Object

Attributes


AttributeTypeDescription
openingInvoicebooleanHas the value true if the invoice is opening invoice or false if the invoice is not opening invoice.
totalAmountBigDecimalTotal amount of invoice.
totalAmountInBaseCurrencyBigDecimalTotal amount of invoice converted to the base currency.
payableAccountCodestringAccount code of contact's account payable.
taxAmountBigDecimalTax amount of invoice.
tcsAmountBigDecimalTCS (Tax Collected at Source) amount of invoice.
tcsRateIdlongIdentifier of the TCS rate applied to the invoice.
tcsPercentageBigDecimalTCS percentage applied to the invoice.
openingDocumentNumberstringOpening document number of invoice.
warehouseCodestringWarehouse code.
dropShipbooleanHas the value true if the invoice created for drop ship or false if the invoice is not created for drop ship.
backOrderbooleanHas the value true if the invoice is backorder or false if the invoice is not backorder.
paymentMilestoneFlagbooleanHas the value true if the invoice is linked to a payment milestone or false otherwise.
statusenumStatus of the invoice. Possible values for invoice status.
customFieldlistList of key-value pairs for custom field name and its value.
roundOffAmountInBaseCurrencyBigDecimalRound off amount of invoice in base currency.
roundOffAmountInDocumentCurrencyBigDecimalRound off amount of invoice in document currency.
paymentStatusenumPayment status of the invoice. Possible values for payment status.
attachmentIdslistList of attachment ids of invoice.
sgEInvoiceStatusstringSingapore e-invoice status of the invoice.
paymentTermstringPayment term of the invoice.
eInvoiceStatuslistList of e-invoice status details. Attributes of EInvoiceStatusDto.
buyerReferencestringBuyer reference of the invoice.
createdDatestringDate on which the invoice was created.
createdBylongIdentifier of the user who created the invoice.
multiApprovalDetailsobjectMulti-level approval details for the invoice.
sgEInvoiceIRASStatusstringSingapore IRAS e-invoice status of the invoice.
contactCodestringContact code.
linkedDocumentsarrayArray of linked documents associated with invoice.
purchaseOrderRefNostringPurchase order reference number.
journalEntryCodestringJournal entry code associated with invoice.
customerOrderNumberstringCustomer order number associated with invoice.
currencystringCurrency code of invoice.
exchangeRateBigDecimalExchange rate.
gstExchangeRateBigDecimalGST exchange rate.
salesInvoiceDatestringSales invoice date.
salesInvoiceDueDatestringSales invoice due date.
memostringMemo of the invoice.
attachmentsarrayArray of file attachments.
unitPriceGstInclusivebooleanHas the value true if the unit price is inclusive of GST or false if the unit price is exclusive of GST.
dueAmountBigDecimalDue amount of invoice.
recurringbooleanHas the value true if the invoice is recurring invoice or false if the invoice is not recurring invoice.
recurringActivatedbooleanHas the value true if the recurring is activated for invoice or false if the recurring is de-activated for invoice.
salesInvoiceRecurringobjectRecurring details for the invoice. Attributes of Sales Invoice Recurring Details.
salesInvoiceItemslistList of items associated with invoice. Attributes of Sales Invoice Items.
contactobjectContact information. Attributes for ContactInfo.
shipFromobjectShip from address. Attributes for Address.
shipToobjectShip to address. Attributes for Address.
billToobjectBill to address. Attributes for Address.
shipByDatestringShip by date.
fulfillmentStatusenumFulfillment status of invoice. Possible values for Fulfillment status.
fulfillmentTypeenumFulfillment type of invoice.
isPartialInvoicebooleanHas the value true if the invoice is a partial invoice or false otherwise.
paymentInformationobjectPayment information associated with the invoice.
reservedStockbooleanHas the value true if stock is reserved for the invoice or false otherwise.
approvalStatusenumApproval status of the invoice. Possible values for approval status.
additionalChargesobjectAdditional charges applied to the invoice.
draftReferenceIdstringDraft reference identifier of the invoice.
draftSeqCodestringDraft sequence code of the invoice.
poNumberstringPurchase order number.
primaryExchangeRateBigDecimalPrimary exchange rate of the invoice.
requestedBylongIdentifier of the user who requested the invoice.
draftbooleanHas the value true if the invoice is in draft state or false if the invoice is not in draft state.
fulfillmentCompletebooleanHas the value true if auto fulfilled is required. or false if auto fulfilled is not required.
documentSequenceCodestringUnique code is associated with invoice.
sequenceFormatstringSequence format id.

SalesInvoiceResponse Object

SalesInvoiceResponse includes all attributes of SalesInvoiceRequest, plus the following response-only attributes.

Attributes


AttributeTypeDescription
idlongUnique identifier for the invoice.
salesInvoiceCodestringUnique code associated with the invoice.
withheldAmountBigDecimalWithheld amount of the invoice.
knockoffInfoarrayArray of knock-off information linked to the invoice.
tdsInfoarrayArray of TDS (Tax Deducted at Source) information linked to the invoice.
contactDtoobjectFull contact details of the invoice's contact.
linkedDocHasPpsbooleanHas the value true if a linked document has a pick-pack-ship record or false otherwise.
attachmentsWithLinklistList of attachment details including download links.
eInvoiceResponseStatusstringStatus returned from the e-invoice response.
eInvoiceResponseReasonstringReason returned from the e-invoice response.
linkedCreditNotearrayArray of credit notes linked to the invoice.
linkedDebitNotearrayArray of debit notes linked to the invoice.
cogsAmountBigDecimalCost of goods sold amount for the invoice.
createdBylongIdentifier of the user who created the invoice.
updatedBylongIdentifier of the user who last updated the invoice.
emailStatusstringStatus of the last email sent for the invoice.
bankTransactionFileCodestringBank transaction file code associated with the invoice.
printStatusstringPrint status of the invoice.
revertPrintStatusBylongIdentifier of the user who reverted the print status.
revertPrintStatusOnDateDate on which the print status was reverted.
refundStatusenumRefund status of the invoice. Possible values for refund status.
refundAmountBigDecimalRefunded amount of the invoice.
linkedRefundDocsarrayArray of refund documents linked to the invoice.
manuallyClosedbooleanHas the value true if the invoice was manually closed or false otherwise.
shortClosedStatusenumShort-closed status of the invoice. Possible values for short closed status.

API


Create Invoice

Creates a new invoice.

Parameters

Code

  @Autowired
private InvoicesApiClient invoicesApiClient;

public SalesInvoiceResponse createInvoice(SalesInvoiceRequest salesInvoiceRequest, String accessToken){
return this.invoicesApiClient.createInvoice(salesInvoiceRequest, accessToken);
}

Retrieve Invoice

Retrieves the details of an existing invoice. You only need to supply the unique invoice code that was returned upon invoice creation.

Parameters

Code

  @Autowired
private InvoicesApiClient invoicesApiClient;

public SalesInvoiceResponse getInvoiceByCode(String invoiceCode, String accessToken){
return this.invoicesApiClient.getInvoiceByCode(invoiceCode, accessToken);
}

List All Invoices

Returns list of invoices.

Parameters

Code

  @Autowired
private InvoicesApiClient invoicesApiClient;

public SalesInvoices getAllSalesInvoice(String accessToken, Integer limit, Integer page, String status){
return this.invoicesApiClient.getAllSalesInvoice(accessToken, limit, page, status);
}

Update Invoice

Updates the details of an existing invoice. You only need to supply the unique invoice code along with the updated fields.

Parameters

Code

  @Autowired
private InvoicesApiClient invoicesApiClient;

public SalesInvoiceResponse updateInvoice(String invoiceCode, SalesInvoiceRequest salesInvoiceRequest, String accessToken){
return this.invoicesApiClient.updateInvoice(invoiceCode, salesInvoiceRequest, accessToken);
}

Delete Invoice

Deletes an existing invoice. You only need to supply the unique invoice code that was returned upon invoice creation.

Parameters

Code

  @Autowired
private InvoicesApiClient invoicesApiClient;

public void deleteInvoice(String invoiceCode, String accessToken){
this.invoicesApiClient.deleteInvoice(invoiceCode, accessToken);
}

Send Invoice Email

Sends an existing invoice to a contact by email.

Parameters

  • sendSalesInvoiceEmail SendSalesInvoiceEmail
  • accessToken string

Code

  @Autowired
private InvoicesApiClient invoicesApiClient;

public void sendInvoiceEmail(SendSalesInvoiceEmail sendSalesInvoiceEmail, String accessToken){
this.invoicesApiClient.sendInvoiceEmail(sendSalesInvoiceEmail, accessToken);
}

Objects


Address

AttributeTypeDescription
contactNamestringName of the contact associated with the address.
address1stringAddress line 1.
address2stringAddress line 2.
countrystringCountry.
countryCodestringCountry code.
statestringState.
stateCodestringState code.
citystringCity.
postalCodestringPostal Code.
preferredbooleanHas the value true if the address is default or false if the address is not default address.
placeOfSupplystringPlace of supply.
destinationOfSupplystringDestination of supply.
mobileCountryCodestringCountry code of the mobile number.
mobileNumberstringMobile number.
emailIdstringEmail address.
customFieldslistList of key-value pairs for custom field name and its value.

ContactInfo

AttributeTypeDescription
namestringContact name.
addressstringAddress of the contact.
peppolIdstringPeppolId of the contact.
taxExemptedbooleanHas the value true if the contact is tax exempted or false otherwise.

SalesInvoiceItemDetails

AttributeTypeDescription
idlongUnique identifier for item.
productCodestringProduct code of the item.
documentSequenceCodestringUnique code associated with the item.
productDescriptionstringProduct description of the item.
productQuantityBigDecimalProduct quantity of the item.
uomQuantityBigDecimalQuantity of the item in its unit of measurement.
uomUnitPriceBigDecimalUnit price of the item in its unit of measurement.
documentUomlongUnit of measurement identifier used on the document.
documentUOMSchemaDefinitionobjectUnit of measurement schema definition used on the document.
unitPriceBigDecimalUnit price of the item.
discountBigDecimalDiscount on the item.
discountInPercentbooleanHas the value true if discount is in percentage. or false if discount is not in percentage.
preTaxGlobalDiscountBigDecimalPre-tax global discount applied to the item.
taxCodestringTax code of the item.
taxAmountBigDecimalTax amount of the item.
totalAmountBigDecimalTotal amount of the item.
productOrderintProduct view order.
salesInvoiceItemCodestringSales Invoice Item Code.
typeenumType of the item. Possible values for ProductType.
availableQuantityBigDecimalAvailable quantity of the item.
productobjectProduct details of the item.
taxobjectTax details of the item.
customFieldlistList of key-value pairs for custom field name and its value.
linkedQuoteItemlongIdentifier of the quote item linked to this item.
linkedQuoteItemCodestringCode of the quote item linked to this item.
isPartialInvoicebooleanHas the value true if the item belongs to a partial invoice or false otherwise.
updatedPartialQuantityBigDecimalUpdated quantity for a partial invoice item.
itemFulfillmentStatusenumFulfillment status of the item. Possible values for Fulfillment status.
quantityFulfilledBigDecimalTotal quantity fulfilled for the item.
quantityFulfilledByUserBigDecimalQuantity fulfilled manually by the user.
quantityFulfilledByFlowoverBigDecimalQuantity fulfilled automatically via flowover.
fulfillmentByDocarrayArray of fulfillment quantities grouped by document.
errorslistList of error messages associated with the item.
lineNumberintLine number of the item.
taxDetailslistList of tax mapping details for the item.
reservedQuantitiesDatalistList of reserved quantity details for the item.
allocationTypestringAllocation type of the item.
basePriceBigDecimalBase price of the item.
revRecDocumentItemDetailsobjectRevenue recognition details linked to the item.
itemDiscountMethodenumDiscount method applied to the item.
additionalChargesobjectAdditional charges applied to the item.
lineRefNostringLine reference number of the item.
bomComponentGroupDetailsobjectBill-of-materials component group details for the item.
userSetTaxesbooleanHas the value true if taxes were manually set by the user or false otherwise.
qtyConvertedToDropShipBigDecimalQuantity converted to drop ship.
qtyFulfilledFromToDropShipBigDecimalQuantity fulfilled from a drop ship conversion.
qtyConvertedToPpsBigDecimalQuantity converted to pick-pack-ship.
qtyFulfilledFromPpsBigDecimalQuantity fulfilled from pick-pack-ship.
isShortClosedbooleanHas the value true if the item is short closed or false otherwise.
shortClosedQuantityBigDecimalQuantity that was short closed.
shortClosedNotesstringNotes recorded when the item was short closed.
isLocalizedUomQtybooleanHas the value true if the unit of measurement quantity is localized or false otherwise.
localizedBaseQtyDiffBigDecimalDifference in base quantity due to localization.
unlocalizedDocumentUOMSchemaDefinitionobjectUnit of measurement schema definition before localization.
invoiceLineNumberstringInvoice line number of the item.
landedCostWeightBigDecimalLanded cost weight of the item.

SalesInvoiceRecurringDetails

AttributeTypeDescription
idlongUnique identifier for item.
recurrenceTypeintEvery x Days/Weeks/Months.
recurrenceFrequencyenumRecurrence frequency. Possible values for Recurring Frequency Type.
invoiceRecurringCountintNumber of Invoices to be created.
recurrenceEndDatestringRecurrence End date.

Enums


INVOICE_STATUS

  • OPEN
  • DRAFT
  • CLOSED

FULFILLMENT_STATUS

  • UNFULFILLED
  • PARTIAL_FULFILLED
  • FULLY_FULFILLED
  • PENDING_FOR_APPROVAL

PAYMENT_STATUS

  • PENDING
  • PARTIAL
  • RECEIVED

ApprovalStatus

  • APPROVED
  • PENDING_FOR_APPROVAL
  • EDITING
  • REJECTED
  • NOT_REQUIRED
  • PULLED_BACK

REFUND_STATUS

  • NOT_REFUNDED
  • PARTIALLY_REFUNDED
  • FULLY_REFUNDED

ShortClosedStatus

  • NONE
  • PARTIALLY_SHORT_CLOSED
  • FULLY_SHORT_CLOSED

ProductType

  • TRACKED
  • NONTRACKED
  • BILL_OF_MATERIALS

RECURRING_FREQUENCY_TYPE

  • DAYS
  • WEEK
  • MONTH