B2B invoice operations for partners
Check credit for a business customer
Checks whether a company is approved for invoice purchases and returns its available credit limit. The invoice provider may reject invoice creation if the purchase amount exceeds the company's available credit. Calling this before creating a B2B invoice is optional, but recommended to avoid a failed invoice creation.
path Parameters
organisationNumber^[89][0-9]{8}$ · required · style: simpleNorwegian organisation number (9 digits, starting with 8 or 9)
Headers
ET-Client-NameEntur Client Header.
It is required that all consumers identify themselves by using this header.
Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.
The structure of ET-Client-Name should be: <company>-<application>.
X-Correlation-IdCorrelation id
Check credit for a business customer › Responses
Credit check result
organisationNumberOrganisation number of the company
companyNameRegistered name of the company
approvedTrue if the company is approved for invoice purchases. If approved, verify that the order amount does not exceed either availableLimit or perOrderLimit before creating the order.
currencyISO 4217 currency code for the amounts
availableLimit^-?[0-9]+\.[0-9]{2}$ · requiredRemaining credit for invoice purchases, in currency
perOrderLimit^-?[0-9]+\.[0-9]{2}$ · requiredMaximum amount for a single order
declineReasonsWhy the company was declined. Present only when approved is false, UNDEFINED if no specific reason is given. Values may be added over time, so handle unknown values.
Create a B2B invoice
Creates a B2B invoice for an existing Entur order. The request must reference a payment transaction (via paymentId and transactionId) that was created in Entur's payment service with payment type TWO_B2B or TWO_B2B_CONSOLIDATED. The payment type determines how the invoice is issued: TWO_B2B invoices are issued immediately, while TWO_B2B_CONSOLIDATED invoices are created as drafts and not issued to the buyer until they are included in a consolidated invoice (see the consolidated invoices endpoint). Unless a separate agreement with Entur and the invoice provider has been made for the partner to handle buyer verification independently, the buyer must verify the purchase by navigating to the returned paymentUrl.
Headers
ET-Client-NameEntur Client Header.
It is required that all consumers identify themselves by using this header.
Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.
The structure of ET-Client-Name should be: <company>-<application>.
X-Correlation-IdCorrelation id
Create a B2B invoice › Request Body
orderIdThe Entur order ID for which to create the invoice
redirectUrlThe URL the buyer is redirected to after completing verification with the invoice provider
paymentIdThe payment ID associated with this invoice
transactionIdThe transaction ID from payment-service connected to this invoice. The transaction must have payment type TWO_B2B or TWO_B2B_CONSOLIDATED.
organisationNumber^[89][0-9]{8}$ · requiredNorwegian organisation number of the company being invoiced (9 digits, starting with 8 or 9). Company details such as name and address are automatically retrieved from Brønnøysundregistrene by the invoice provider.
Contact information for the buyer
Create a B2B invoice › Responses
B2B invoice created
paymentUrlURL the buyer must navigate to in order to verify the invoice purchase
invoiceIdEntur's internal ID of the created invoice
Get a B2B invoice
Returns a B2B invoice order belonging to the caller's organisation, with its status, lines and fees.
path Parameters
invoiceIdId of the B2B invoice order, as returned when it was created
Headers
ET-Client-NameEntur Client Header.
It is required that all consumers identify themselves by using this header.
Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.
The structure of ET-Client-Name should be: <company>-<application>.
X-Correlation-IdCorrelation id
Get a B2B invoice › Responses
The invoice
invoiceIdEntur's id of the invoice
orderIdThe Entur order the invoice belongs to
invoiceTypeTWO_B2B for invoices invoiced on their own, TWO_B2B_CONSOLIDATED for invoices that are invoiced through a consolidated invoice
statusStatus of the invoice. Current values:
- PENDING: created, but not yet invoiced
- INVOICED: invoiced to the buyer
- AWAITING_CONSOLIDATION: ready to be included in a consolidated invoice
- CONSOLIDATED: invoiced through a consolidated invoice, see consolidatedInvoiceId
- PARTIALLY_CREDITED: part of the invoice has been credited
- CREDITED: the whole invoice has been credited
New values may be added; clients must accept unknown values. Payment status is not included.
totalAmountSum of all lines and fees including VAT, net of credits
currencyCurrency in ISO 4217 format
createdAtWhen the invoice was created
consolidatedInvoiceIdId of the consolidated invoice this invoice is part of. Set when the invoice is invoiced through a consolidated invoice, and remains set if the invoice is later credited.
updatedAtWhen the invoice was last updated
Create a consolidated invoice
Consolidates one or more B2B invoice drafts into a single invoice, so the buyer receives one invoice for all of them. All referenced invoice orders must have been created with payment type TWO_B2B_CONSOLIDATED, belong to the same company, and not already be part of a consolidated invoice. The billing details of the first invoice order in the request are used as the template for the consolidated invoice. The consolidated invoice is issued immediately and cannot be undone.
Headers
ET-Client-NameEntur Client Header.
It is required that all consumers identify themselves by using this header.
Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.
The structure of ET-Client-Name should be: <company>-<application>.
X-Correlation-IdCorrelation id
Create a consolidated invoice › Request Body
invoiceIdsIDs of the B2B invoice orders to include, as returned when the orders were created. Each ID must appear only once.
referenceOptional merchant reference, passed on to the invoice provider
Create a consolidated invoice › Responses
Consolidated invoice created
consolidatedInvoiceIdEntur's ID of the consolidated invoice
Download the PDF of a B2B invoice
Returns the invoice PDF for a B2B invoice order that is invoiced on its own. Invoice orders created for consolidated invoicing have no PDF of their own; fetch the PDF of the consolidated invoice instead.
path Parameters
invoiceIdId of the B2B invoice order, as returned when it was created
query Parameters
langLanguage of the PDF
originalIf the invoice has been credited, the credit note is returned by default. Set to true to get the original invoice instead.
Headers
ET-Client-NameEntur Client Header.
It is required that all consumers identify themselves by using this header.
Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.
The structure of ET-Client-Name should be: <company>-<application>.
X-Correlation-IdCorrelation id
Download the PDF of a B2B invoice › Responses
The invoice as PDF
Download the PDF of a consolidated invoice
Returns the invoice PDF for a consolidated invoice.
path Parameters
consolidatedInvoiceIdId of the consolidated invoice, as returned when it was created
query Parameters
langLanguage of the PDF
originalIf the invoice has been credited, the credit note is returned by default. Set to true to get the original invoice instead.
Headers
ET-Client-NameEntur Client Header.
It is required that all consumers identify themselves by using this header.
Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.
The structure of ET-Client-Name should be: <company>-<application>.
X-Correlation-IdCorrelation id
Download the PDF of a consolidated invoice › Responses
The invoice as PDF