Invoices

Staff have access to the API calls listed below if the Invoices tab is enabled for staff. Staff users can only access Invoices that belong to clients they are assigned to.


document.svc/create/invoice

Create a new invoice and return the corresponding invoice_id.

Request

POST https://secure.salengo.com/api/document.svc/create/invoice

Input

  • DefaultValueUse your default profile (true / false)
  • [General]
    • Type
    • Status
    • Number
    • PONumber
    • DateIssue
    • DueDate
    • Validity
    • GeneralDiscount
    • Description
    • Currency
  • [Client]
    • Reference
    • ClientName
    • ContactName
    • ContactEmail
    • ContactAddress
    • ContactPhoneLine
    • ContactPhoneCell
    • ContactPhoneFax
  • [Items] - list
    • Position
    • Reference
    • Description
    • UnitRate
    • UnitType
    • Quantity
    • Discount
    • VAT
  • [Comments]
    • PaymentCondition
    • PaymentEndOfMonth
    • Legal
    • Notes

Response

"Reference: F-000170"


document/create/get/:id

Retrieve an existing invoice.

Request

GET https://secure.salengo.com/api/document.svc/get/invoice/F-000159

Response

{ "General": { "Type": "invoice", "Status": "sent", "Number": "F-000159", "PONumber": "MS0001", "DateIssue": "2013-11-02", "DueDate": "2013-11-30", "GeneralDiscount": 15.5, "Description": "Test En ligne", "Currency": "EUR" }, "Client": { "Reference": "000050", "ClientName": "Microway", "ContactName": "Mr Bill Gate", "ContactEmail": "fakeemail@salengo.com", "ContactAddress": "115 Microway Way\r\n98052-7000 Redmond WA\r\nUnited States", "ContactPhoneLine": null, "ContactPhoneCell": null, "ContactPhoneFax": null }, "Items": [ { "Position": 0, "Reference": null, "Description": "Apple iPod Touch 16 Go Blanc", "UnitRate": 205.45, "UnitType": "Each", "Quantity": 1, "Discount": 0, "VAT": 19.6, "TotalItem": 205.45 }, { "Position": 1, "Reference": null, "Description": "Apple iPod Touch 64 Go Black", "UnitRate": 750, "UnitType": "Package", "Quantity": 1, "Discount": 10, "VAT": 25, "TotalItem": 675 } ], "Total": { "TOTALRAW": 743.98, "TOTALTAX": [ { "VATPercentage": 19.6, "VATValue": 34.026629 }, { "VATPercentage": 25, "VATValue": 142.59375 } ], "TotalNET": 920.6, "TotalPaid": 0 }, "Comments": { "Legal": "Pénalités de retard:\nConformément à la Loi n° 93-122 du 29 janvier 1993, les pénalités de retard sont calculées ou taux d'intérêt annuel égal à trois fois le taux d'intérêt légal de l'année en cours, et ce dès le premier jour de retard." }, "Payments": {} }

document.svc/delete/:type/:id

Delete an existing invoice.

Request

DELETE https://secure.salengo.com/api/document.svc/delete/invoice/F-000170

Response

true

document.svc/invoice/list

Returns a list of Invoices. You can optionally filter by client_id, folder, and date.

Note: This method uses pagination.

Request

GET https://secure.salengo.com/api/document.svc/list/invoice

Response

[ { "Type": "invoice", "Status": "draft", "Number": "E-000170", "PONumber": "MS001", "DateIssue": "2013-11-06", "Description": "Test En ligne", "GeneralDiscount": 0, "TOTALRAW": 743.98, "TotalNET": 920.6, "TotalPaid": 0, "ClientName": "Microway", "ContactName": "Mr Bill Gates", "Currency": "EUR" }, { "Type": "invoice", "Status": "sent", "Number": "E-000169", "PONumber": "MS001", "DateIssue": "2013-11-05", "DueDate": "2013-11-20", "Description": "Test En ligne", "GeneralDiscount": 0, "TOTALRAW": 743.98, "TotalNET": 920.6, "TotalPaid": 0, "ClientName": "Microway", "ContactName": "Mr Bill Gates", "Currency": "EUR" }, ... ]

document.svc/action/sendbyemail/:type/:id

Send an invoice to the associated client via e-mail.

Request

PUT https://secure.salengo.com/api/document.svc/action/sendbyemail/invoice/F-000169

INPUT (optional)

  • Email_TO
  • Email_CC
  • Email_BCC
  • Subject
  • Body
  • AttachInvoicePDF
  • AttachSalesTerms

Response

true