Invoice API
Introduction
The invoice API is used to list invoices and download the invoice pdfs same as in Mybring.
Authentication
The Invoice API requires authentication. To make API requests, you will need an API key from Mybring. Steps for getting a key and description of headers can be found on the general API Getting Started / Authentication page.
Overview of endpoints
Base URL
https://www.mybring.com/invoicearchive
List of all Invoices
Gets the list of invoices corresponding to the given customer number. By default it shows last 65 days of invoices, with the possibilty to access last 365 days by providing “fromDate” and “toDate”. This endpoint supports Parcel Domestic, Parcel International and Cargo customers.
URL
GET https://www.mybring.com/invoicearchive/invoicearchive/api/invoices/{apiCustomerNumber}.json
https://www.mybring.com/invoicearchive/invoicearchive/api/invoices/{apiCustomerNumber}.xml
Request params
URI parameter | Type | Description |
---|---|---|
apiCustomerNumber |
string |
Required. Unique API Customer Number. Possible values
|
Header name | Type | Description |
---|---|---|
X-MyBring-API-Uid |
string |
Required. Your Mybring login ID |
X-MyBring-API-Key |
string |
Required. Your user’s API key |
X-Bring-Client-URL |
string |
Required. A URL that sort of identifies where you’re using the APIs. |
Query param | Type | Description |
---|---|---|
fromDate |
string |
Optional. Start date for fetching invoices in format dd.mm.yyyy. Example: 15.01.2020
|
toDate |
string |
Optional. End date for fetching invoices in format dd.mm.yyyy. Example: 25.01.2020
|
Responses
HTTP status code 200
Media Type: application/json
Field | Type | Description |
---|---|---|
Invoices | ||
customerNumber |
string
|
Optional. Represents a customerNumber |
invoiceNumber |
string
|
Required. Represents a invoiceNumber |
invoiceDate |
string
|
Required. Represents a invoice date |
invoiceIssuer |
string
|
Optional. Represents the invoice issuer |
status |
string
|
Optional. Represents the invoice status |
totalAmount |
string
|
Optional. Represents the invoice total amount |
currency |
string
|
Optional. Represents the currency used in invoice |
type |
string
|
Optional. Represents the invoice or credit note |
dueDate |
string
|
Optional. Represents the invoice due date |
attachmentCount |
number
|
Optional. Represents the number of attachments associated with invoice number |
batchSource |
string
|
Required. Represents the invoice generated source |
invoiceSpecificationAvailable |
boolean
|
Optional. Represents the invoice specification report available or not |
parentInvoiceNumber |
string
|
Optional. Represents the parent invoice number |
The example below shows an list of invoices
[
{
"customerNumber": "customerNumber",
"invoiceNumber": "10158070",
"invoiceDate": "31.12.2019",
"invoiceIssuer": "POSTEN_NORGE_AS",
"status": "Open",
"totalAmount": "386.25",
"dueDate": "28.02.2020",
"type": "Invoice",
"attachmentCount": 0,
"specInvoiceReportId": "specified_invoice_customer_master",
"currency": "NOK",
"parentInvoiceNumber": null,
"invoiceSpecificationAvailable": true
},
{
"customerNumber": "customerNumber",
"invoiceNumber": "152148",
"invoiceDate": "31.12.2019",
"invoiceIssuer": "POSTEN_NORGE_AS",
"status": "Closed",
"totalAmount": "7771.69",
"dueDate": "25.02.2020",
"type": "Invoice",
"batchSource": "PMS_BULKMAIL_OM",
"attachmentCount": 0,
"specInvoiceReportId": "specified_invoice_customer_master",
"currency": "NOK",
"parentInvoiceNumber": null,
"invoiceSpecificationAvailable": false
},
{
"customerNumber": "customerNumber",
"invoiceNumber": "1109932",
"invoiceDate": "31.01.2020",
"invoiceIssuer": "POSTEN_NORGE_AS",
"status": "Open",
"totalAmount": "115.0",
"dueDate": "06.03.2020",
"type": "Invoice",
"batchSource": "TMS_AMPHORA_OM",
"attachmentCount": 0,
"specInvoiceReportId": "specified_invoice_customer_master",
"currency": "NOK",
"parentInvoiceNumber": null,
"invoiceSpecificationAvailable": true
},
{
"customerNumber": "customerNumber",
"invoiceNumber": "11404211",
"invoiceDate": "31.01.2020",
"invoiceIssuer": "POSTEN_NORGE_AS",
"status": "Open",
"totalAmount": "12117.16",
"dueDate": "03.03.2020",
"type": "Invoice",
"batchSource": "TMS_LM_OM",
"attachmentCount": 0,
"specInvoiceReportId": "specified_invoice_customer_master",
"currency": "NOK",
"parentInvoiceNumber": null,
"invoiceSpecificationAvailable": true
},
{
"customerNumber": "customerNumber",
"invoiceNumber": "1100146",
"invoiceDate": "30.11.2019",
"invoiceIssuer": "POSTEN_NORGE_AS",
"status": "Closed",
"totalAmount": "485.01",
"dueDate": "03.01.2020",
"type": "Invoice",
"batchSource": "TMS_AMPHORA_OM",
"attachmentCount": 0,
"specInvoiceReportId": "specified_invoice_customer_master",
"currency": "NOK",
"parentInvoiceNumber": null,
"invoiceSpecificationAvailable": true
},
{
"customerNumber": "customerNumber",
"invoiceNumber": "11403110",
"invoiceDate": "30.11.2019",
"invoiceIssuer": "POSTEN_NORGE_AS",
"status": "Closed",
"totalAmount": "1964.06",
"dueDate": "31.12.2019",
"type": "Invoice",
"batchSource": "TMS_LM_OM",
"attachmentCount": 0,
"specInvoiceReportId": "specified_invoice_customer_master",
"currency": "NOK",
"parentInvoiceNumber": null,
"invoiceSpecificationAvailable": true
},
{
"customerNumber": "customerNumber",
"invoiceNumber": "12139462",
"invoiceDate": "30.11.2019",
"invoiceIssuer": "POSTEN_NORGE_AS",
"status": "Closed",
"totalAmount": "2076.69",
"dueDate": "31.12.2019",
"type": "Invoice",
"batchSource": "PMS_BULKMAIL_OM",
"attachmentCount": 0,
"specInvoiceReportId": "specified_invoice_customer_master",
"currency": "NOK",
"parentInvoiceNumber": null,
"invoiceSpecificationAvailable": false
},
{
"customerNumber": "customerNumber",
"invoiceNumber": "10021151",
"invoiceDate": "30.01.2020",
"invoiceIssuer": "POSTEN_NORGE_AS",
"status": "Closed",
"totalAmount": "-75.0",
"dueDate": "30.01.2020",
"type": "Credit note",
"batchSource": "CRM_SF_EXT",
"attachmentCount": 0,
"specInvoiceReportId": "specified_invoice_customer_master",
"currency": "NOK",
"parentInvoiceNumber": null,
"invoiceSpecificationAvailable": false
}
]
Media Type: application/xml
Field | Type | Description |
---|---|---|
Invoices | ||
customerNumber |
string
|
Optional. Represents a customerNumber |
invoiceNumber |
string
|
Required. Represents a invoiceNumber |
invoiceDate |
string
|
Required. Represents a invoice date |
invoiceIssuer |
string
|
Optional. Represents the invoice issuer |
status |
string
|
Optional. Represents the invoice status |
totalAmount |
string
|
Optional. Represents the invoice total amount |
currency |
string
|
Optional. Represents the currency used in invoice |
type |
string
|
Optional. Represents the invoice or credit note |
dueDate |
string
|
Optional. Represents the invoice due date |
attachmentCount |
number
|
Optional. Represents the number of attachments associated with invoice number |
batchSource |
string
|
Required. Represents the invoice generated source |
invoiceSpecificationAvailable |
boolean
|
Optional. Represents the invoice specification report available or not |
parentInvoiceNumber |
string
|
Optional. Represents the parent invoice number |
The example below shows an list of invoices
<InvoiceResponse>
<InvoiceList>
<Invoice>
<customerNumber>customerNumber</customerNumber>
<invoiceNumber>11001070</invoiceNumber>
<invoiceDate>31.12.2019</invoiceDate>
<invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
<status>Open</status>
<totalAmount>386.25</totalAmount>
<dueDate>28.02.2020</dueDate>
<type>Invoice</type>
<batchSource>TMS_AMPHORA_OM</batchSource>
<attachmentCount>0</attachmentCount>
<specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
<currency>NOK</currency>
<parentInvoiceNumber/>
<invoiceSpecificationAvailable>true</invoiceSpecificationAvailable>
</Invoice>
<Invoice>
<customerNumber>customerNumber</customerNumber>
<invoiceNumber>10152148</invoiceNumber>
<invoiceDate>31.12.2019</invoiceDate>
<invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
<status>Closed</status>
<totalAmount>771.69</totalAmount>
<dueDate>25.02.2020</dueDate>
<type>Invoice</type>
<batchSource>PMS_BULKMAIL_OM</batchSource>
<attachmentCount>0</attachmentCount>
<specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
<currency>NOK</currency>
<parentInvoiceNumber/>
<invoiceSpecificationAvailable>false</invoiceSpecificationAvailable>
</Invoice>
<Invoice>
<customerNumber>customerNumber</customerNumber>
<invoiceNumber>11016932</invoiceNumber>
<invoiceDate>31.01.2020</invoiceDate>
<invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
<status>Open</status>
<totalAmount>15.0</totalAmount>
<dueDate>06.03.2020</dueDate>
<type>Invoice</type>
<batchSource>TMS_AMPHORA_OM</batchSource>
<attachmentCount>0</attachmentCount>
<specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
<currency>NOK</currency>
<parentInvoiceNumber/>
<invoiceSpecificationAvailable>true</invoiceSpecificationAvailable>
</Invoice>
<Invoice>
<customerNumber>customerNumber</customerNumber>
<invoiceNumber>11404711</invoiceNumber>
<invoiceDate>31.01.2020</invoiceDate>
<invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
<status>Open</status>
<totalAmount>1211907.16</totalAmount>
<dueDate>03.03.2020</dueDate>
<type>Invoice</type>
<batchSource>TMS_LM_OM</batchSource>
<attachmentCount>0</attachmentCount>
<specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
<currency>NOK</currency>
<parentInvoiceNumber/>
<invoiceSpecificationAvailable>true</invoiceSpecificationAvailable>
</Invoice>
<Invoice>
<customerNumber>customerNumber</customerNumber>
<invoiceNumber>1106446</invoiceNumber>
<invoiceDate>30.11.2019</invoiceDate>
<invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
<status>Closed</status>
<totalAmount>45.01</totalAmount>
<dueDate>03.01.2020</dueDate>
<type>Invoice</type>
<batchSource>TMS_AMPHORA_OM</batchSource>
<attachmentCount>0</attachmentCount>
<specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
<currency>NOK</currency>
<parentInvoiceNumber/>
<invoiceSpecificationAvailable>true</invoiceSpecificationAvailable>
</Invoice>
<Invoice>
<customerNumber>customerNumber</customerNumber>
<invoiceNumber>1142110</invoiceNumber>
<invoiceDate>30.11.2019</invoiceDate>
<invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
<status>Closed</status>
<totalAmount>911964.06</totalAmount>
<dueDate>31.12.2019</dueDate>
<type>Invoice</type>
<batchSource>TMS_LM_OM</batchSource>
<attachmentCount>0</attachmentCount>
<specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
<currency>NOK</currency>
<parentInvoiceNumber/>
<invoiceSpecificationAvailable>true</invoiceSpecificationAvailable>
</Invoice>
<Invoice>
<customerNumber>customerNumber</customerNumber>
<invoiceNumber>1013462</invoiceNumber>
<invoiceDate>30.11.2019</invoiceDate>
<invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
<status>Closed</status>
<totalAmount>2076.69</totalAmount>
<dueDate>31.12.2019</dueDate>
<type>Invoice</type>
<batchSource>PMS_BULKMAIL_OM</batchSource>
<attachmentCount>0</attachmentCount>
<specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
<currency>NOK</currency>
<parentInvoiceNumber/>
<invoiceSpecificationAvailable>false</invoiceSpecificationAvailable>
</Invoice>
<Invoice>
<customerNumber>customerNumber</customerNumber>
<invoiceNumber>1091021151</invoiceNumber>
<invoiceDate>30.01.2020</invoiceDate>
<invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
<status>Closed</status>
<totalAmount>-75.0</totalAmount>
<dueDate>30.01.2020</dueDate>
<type>Credit note</type>
<batchSource>CRM_SF_EXT</batchSource>
<attachmentCount>0</attachmentCount>
<specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
<currency>NOK</currency>
<parentInvoiceNumber/>
<invoiceSpecificationAvailable>false</invoiceSpecificationAvailable>
</Invoice>
</InvoiceList>
</InvoiceResponse>
Invoice PDF download endpoint
This link is used to download the invoice pdf for the customers by providing API customer number and invoice number in URI params.
URL
GET https://www.mybring.com/invoicearchive/invoicearchive/pdf/{apiCustomerNumber}/{invoiceNumber}.pdf
Request params
URI parameter | Type | Description |
---|---|---|
apiCustomerNumber |
string |
Required. Unique API Customer Number for each customer. |
invoiceNumber |
string |
Required. Invoice number of the particular invoice to be downloaded. |