Skip to main content
developer

Invoice API

Introduction

The invoice API is used to list invoices and download the invoice pdfs same as in Mybring.

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
Method Endpoint Usage
GET /api/invoices/{apiCustomerNumber}{mediaTypeExtension} List of invoices
GET /pdf/{apiCustomerNumber}/{invoiceNumber}.pdf Download pdf for invoice

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 possibility 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/api/invoices/{apiCustomerNumber}.json
https://www.mybring.com/invoicearchive/api/invoices/{apiCustomerNumber}.xml

Request parameters

URI param Type Description
apiCustomerNumber string Required Unique API Customer Number.
Possible values:
  • Main customer number
  • PARCELS_NORWAY_INTERNATIONAL-xxxxx
  • PARCELS_SWEDEN-xxxxx
  • PARCELS_DENMARK-xxxxx
  • PARCELS_FINLAND-xxxxx
  • EXPRESS_SWEDEN-xxxxx
  • EXPRESS_NORWAY-xxxxx
  • EXPRESS_DENMARK-xxxxx
  • EXPRESS_FINLAND-xxxxx
HTTP header Type Description
X-Bring-Client-URL string Required A URL that sort of identifies where you’re using the APIs.
X-MyBring-API-Key string Required Your user’s API key
X-MyBring-API-Uid string Required Your Mybring login ID
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
attachmentCount number OptionalRepresents the number of attachments associated with invoice number
batchSource string RequiredRepresents the invoice generated source
currency string OptionalRepresents the currency used in invoice
customerNumber string OptionalRepresents a customerNumber
dueDate string OptionalRepresents the invoice due date
invoiceDate string RequiredRepresents a invoice date
invoiceIssuer string OptionalRepresents the invoice issuer
invoiceNumber string RequiredRepresents a invoiceNumber
invoiceSpecificationAvailable boolean OptionalRepresents the invoice specification report available or not
parentInvoiceNumber string OptionalRepresents the parent invoice number
status string OptionalRepresents the invoice status
totalAmount string OptionalRepresents the invoice total amount
type string OptionalRepresents the invoice or credit note

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
attachmentCount number OptionalRepresents the number of attachments associated with invoice number
batchSource string RequiredRepresents the invoice generated source
currency string OptionalRepresents the currency used in invoice
customerNumber string OptionalRepresents a customerNumber
dueDate string OptionalRepresents the invoice due date
invoiceDate string RequiredRepresents a invoice date
invoiceIssuer string OptionalRepresents the invoice issuer
invoiceNumber string RequiredRepresents a invoiceNumber
invoiceSpecificationAvailable boolean OptionalRepresents the invoice specification report available or not
parentInvoiceNumber string OptionalRepresents the parent invoice number
status string OptionalRepresents the invoice status
totalAmount string OptionalRepresents the invoice total amount
type string OptionalRepresents the invoice or credit note

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/pdf/{apiCustomerNumber}/{invoiceNumber}.pdf
                        

Request parameters

URI param Type Description
apiCustomerNumber string Required Unique API Customer Number for each customer.
invoiceNumber string Required Invoice number of the particular invoice to be downloaded.
comments powered by Disqus