e-copedia hjælpecenter

Adding dimensions to a draft invoice

Sidst opdateret:
Skrevet af Charles J

Dimensions can be added to individual lines on a draft invoice through the OpenAPI.

Before adding a dimension, you need to know:

  • which dimension you want to use

  • which value within that dimension you want to apply

  • the draft invoice number

  • the invoice line number

The general flow is:

Find dimension → Find dimension value → Find draft invoice → Find invoice line → Add dimension

1. Find your dimensions

Start by retrieving the dimensions available on the agreement:

GET /dimensions

Documentation:

https://apis.e-conomic.com/#Dimensions..tag/Dimensions/operation/GetAllDimensions

An agreement can have up to three dimensions.

Each dimension has a dimensionNumber, which identifies which dimension it represents.

For example:

dimensionNumber: 1
dimensionNumber: 2
dimensionNumber: 3

You will need the dimensionNumber when adding the dimension to an invoice line.

2. Find the dimension value

Once you know which dimension you want to use, retrieve its available dimension values:

https://apis.e-conomic.com/#Dimensions..tag/DimensionValues/operation/GetAllDimensionValues

Each value has a dimensionKey.

The dimensionKey identifies the specific value you want to apply within the dimension.

In other words:

dimensionNumber = Which dimension?
dimensionKey = Which value within that dimension?

Both are needed when adding dimension data.

3. Find the draft invoice

You also need the number of the draft invoice you want to update.

Draft invoices can be retrieved through:

https://apis.e-conomic.com/#Quote%20to%20Cash..tag/DraftInvoices/operation/GetDraftInvoices

From here, identify the relevant draftInvoiceNumber.

4. Find the invoice line

Dimensions are added to individual invoice lines rather than directly to the entire draft invoice.

Retrieve the lines for the draft invoice through:

https://apis.e-conomic.com/#Quote%20to%20Cash..tag/DraftInvoiceLines/operation/GetDraftInvoiceLinesForDraftInvoice

Use the draftInvoiceNumber to retrieve its lines and identify the relevant lineNumber.

At this point you should have:

Value

Used for

dimensionNumber

Identifies the dimension

dimensionKey

Identifies the value within the dimension

draftInvoiceNumber

Identifies the draft invoice

lineNumber

Identifies the invoice line

5. Add the dimension

You can now add the dimension data to the draft invoice line through:

https://apis.e-conomic.com/#Dimensions..tag/SalesDocumentLine/operation/CreateSalesDocumentLineDimensionData

Use the relevant:

draftInvoiceNumber
lineNumber
dimensionNumber
dimensionKey

This connects the selected dimension value to the specified draft invoice line.

If multiple dimensions should be applied to the same line, each dimension is identified by its own dimensionNumber and corresponding dimensionKey.

Important: Dimensions must be added before booking

Dimensions can be added to draft invoice lines through this endpoint.

Once the invoice has been booked, dimensions can no longer be added to the invoice through the API.

The dimension data should therefore be added while the invoice is still a draft.

Var denne artikel nyttig?