My Products
Help

Send Autoinvoice with an attachement

27-05-2019 12:38 (Updated 03-07-2019)
  • 0 Replies
  • 0 kudos
  • 1873 Views

The endpoint "v2/customerinvoicedrafts/{customerInvoiceDraftId}/convert" unfortunately does not support sending invoices as an Autoinvoice.

 

A workaround to this is to do the following:

Make sure the invoice is still a draft.

Create "customerinvoicedraft" > add an attachment using "salesdocumentattachment" endpoint > convert the draft to an invoice using the "customerinvoice" endpoint with the properties "CreatedFromDraftId" and "sendtype".

 

Please see below example on what it can look like:

 

{
"CustomerId": "2bab59cd-0e03-407e-bb59-9a1d1ca9bb02",
"IsCreditInvoice": false,
"RotReducedInvoicingType": 0,
"RotReducedInvoicingPropertyName": null,
"RotReducedInvoicingAmount": 0,
"RotReducedInvoicingAutomaticDistribution": false,

"Rows": [
{
    "LineNumber": 0,
    "ArticleId": "991d82e9-fdf6-4f4c-884b-517c2fa67adf",
    "Text": "Lemon | 29,75 kr/kg",
    "UnitPrice": 3.57,
    "DiscountPercentage": 0,
    "Quantity": 1
},
{
    "LineNumber": 1,
    "ArticleId": "991d82e9-fdf6-4f4c-884b-517c2fa67adf",
    "Text": "Delivery org",
    "UnitPrice": 22,
    "DiscountPercentage": 0,
    "Quantity": 1
}
],
"YourReference": null,
"OurReference": "",
"EuThirdParty": false,
"InvoiceDate": "2019-03-07",
"DeliveryDate": "2019-03-07",
"TermsOfPaymentId": "0f7c3ab0-0c02-46fe-b291-d8cd5ab445f7",
"CreatedFromDraftId": "aa2902a2-118f-4505-b22e-ef38fc570dbe",
"SendType": 2
}

 

Contributors