Skip to main content

Invoice API

The Invoice API can be used to list your invoices and to download the invoices in PDF format.

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.

Formats

REST XML/JSON over HTTP.

Endpoints

Base URL
https://www.mybring.com/invoicearchive
Usage Method Endpoint
List of all Invoices GET /api/invoices/{customerNumber}.json
List of all Invoices GET /api/invoices/{customerNumber}.xml
Invoice PDF download endpoint GET /pdf/{customerNumberUnique}/{invoiceNumber}.pdf

List of all Invoices

get
                https://www.mybring.com/invoicearchive/api/invoices/{customerNumber}.json
              

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.

Request

path parameters

customerNumber
Required
Description
Unique API Customer Number.
Type
string

query parameters

fromDate
Description
Start date for fetching invoices in format dd.mm.yyyy.
Type
string
Example
fromDate=15.01.2020
toDate
Description
End date for fetching invoices in format dd.mm.yyyy.
Type
string
Example
toDate=25.01.2020
invoicesWithSpecification
Description
Displays only invoices with available specifications when set to true.
Type
boolean
Example
invoicesWithSpecification=true
onlyProcessedInvoices
Description
Displays only invoices that has been processed when set to true.
Type
boolean
Example
onlyProcessedInvoices=true
isApiCall
Description
Whether the API call is made directly, as opposed to if used from a frontend client.
Type
boolean

header parameters

X-Bring-Client-URL
Required
Description
A URL that sort of identifies where you’re using the APIs.
Type
any
X-Mybring-API-Key
Required
Description
Your user’s API key
Type
any
X-Mybring-API-Uid
Required
Description
Your Mybring login ID
Type
any

Responses

200 Successful

Schema

Media type: application/json

Required
array of objects
attachmentCount
integer <int32>
batchSource
string
currency
string
customerNumber
string
dueDate
string
invoiceDate
string
invoiceIssuer
string
invoiceNumber
string
invoiceProcessed
string
Enum
YES
NO
PARTLY
invoiceSpecificationAvailable
boolean
parentInvoiceNumber
string
parentInvoiceNumberList
array of strings
string
specInvoiceReportId
string
specificationAvailability
string
Enum
YES
NO
PARTLY
status
string
supportCaseNumber
string
supportCaseUrl
string
totalAmount
string
type
string
status
Required
string

Response examples

Successful

{
  "invoices": [
    {
      "attachmentCount": 0,
      "currency": "NOK",
      "customerNumber": "customerNumber",
      "dueDate": "28.02.2020",
      "invoiceDate": "31.12.2019",
      "invoiceIssuer": "POSTEN_NORGE_AS",
      "invoiceNumber": "10158070",
      "invoiceSpecificationAvailable": true,
      "parentInvoiceNumber": null,
      "specInvoiceReportId": "specified_invoice_customer_master",
      "status": "Open",
      "totalAmount": "386.25",
      "type": "Invoice"
    },
    {
      "attachmentCount": 0,
      "batchSource": "PMS_BULKMAIL_OM",
      "currency": "NOK",
      "customerNumber": "customerNumber",
      "dueDate": "25.02.2020",
      "invoiceDate": "31.12.2019",
      "invoiceIssuer": "POSTEN_NORGE_AS",
      "invoiceNumber": "152148",
      "invoiceSpecificationAvailable": false,
      "parentInvoiceNumber": null,
      "specInvoiceReportId": "specified_invoice_customer_master",
      "status": "Closed",
      "totalAmount": "7771.69",
      "type": "Invoice"
    },
    {
      "attachmentCount": 0,
      "batchSource": "TMS_AMPHORA_OM",
      "currency": "NOK",
      "customerNumber": "customerNumber",
      "dueDate": "06.03.2020",
      "invoiceDate": "31.01.2020",
      "invoiceIssuer": "POSTEN_NORGE_AS",
      "invoiceNumber": "1109932",
      "invoiceSpecificationAvailable": true,
      "parentInvoiceNumber": null,
      "specInvoiceReportId": "specified_invoice_customer_master",
      "status": "Open",
      "totalAmount": "115.0",
      "type": "Invoice"
    },
    {
      "attachmentCount": 0,
      "batchSource": "TMS_LM_OM",
      "currency": "NOK",
      "customerNumber": "customerNumber",
      "dueDate": "03.03.2020",
      "invoiceDate": "31.01.2020",
      "invoiceIssuer": "POSTEN_NORGE_AS",
      "invoiceNumber": "11404211",
      "invoiceSpecificationAvailable": true,
      "parentInvoiceNumber": null,
      "specInvoiceReportId": "specified_invoice_customer_master",
      "status": "Open",
      "totalAmount": "12117.16",
      "type": "Invoice"
    },
    {
      "attachmentCount": 0,
      "batchSource": "TMS_AMPHORA_OM",
      "currency": "NOK",
      "customerNumber": "customerNumber",
      "dueDate": "03.01.2020",
      "invoiceDate": "30.11.2019",
      "invoiceIssuer": "POSTEN_NORGE_AS",
      "invoiceNumber": "1100146",
      "invoiceSpecificationAvailable": true,
      "parentInvoiceNumber": null,
      "specInvoiceReportId": "specified_invoice_customer_master",
      "status": "Closed",
      "totalAmount": "485.01",
      "type": "Invoice"
    },
    {
      "attachmentCount": 0,
      "batchSource": "TMS_LM_OM",
      "currency": "NOK",
      "customerNumber": "customerNumber",
      "dueDate": "31.12.2019",
      "invoiceDate": "30.11.2019",
      "invoiceIssuer": "POSTEN_NORGE_AS",
      "invoiceNumber": "11403110",
      "invoiceSpecificationAvailable": true,
      "parentInvoiceNumber": null,
      "specInvoiceReportId": "specified_invoice_customer_master",
      "status": "Closed",
      "totalAmount": "1964.06",
      "type": "Invoice"
    },
    {
      "attachmentCount": 0,
      "batchSource": "PMS_BULKMAIL_OM",
      "currency": "NOK",
      "customerNumber": "customerNumber",
      "dueDate": "31.12.2019",
      "invoiceDate": "30.11.2019",
      "invoiceIssuer": "POSTEN_NORGE_AS",
      "invoiceNumber": "12139462",
      "invoiceSpecificationAvailable": false,
      "parentInvoiceNumber": null,
      "specInvoiceReportId": "specified_invoice_customer_master",
      "status": "Closed",
      "totalAmount": "2076.69",
      "type": "Invoice"
    },
    {
      "attachmentCount": 0,
      "batchSource": "CRM_SF_EXT",
      "currency": "NOK",
      "customerNumber": "customerNumber",
      "dueDate": "30.01.2020",
      "invoiceDate": "30.01.2020",
      "invoiceIssuer": "POSTEN_NORGE_AS",
      "invoiceNumber": "10021151",
      "invoiceSpecificationAvailable": false,
      "parentInvoiceNumber": null,
      "specInvoiceReportId": "specified_invoice_customer_master",
      "status": "Closed",
      "totalAmount": "-75.0",
      "type": "Credit note"
    }
  ],
  "status": "OK"
}

List of all Invoices

get
                https://www.mybring.com/invoicearchive/api/invoices/{customerNumber}.xml
              

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.

Request

path parameters

customerNumber
Required
Description
Unique API Customer Number.
Type
string

query parameters

fromDate
Description
Start date for fetching invoices in format dd.mm.yyyy.
Type
string
Example
fromDate=15.01.2020
toDate
Description
End date for fetching invoices in format dd.mm.yyyy.
Type
string
Example
toDate=25.01.2020
invoicesWithSpecification
Description
Displays only invoices with available specifications when set to true.
Type
boolean
Example
invoicesWithSpecification=true
onlyProcessedInvoices
Description
Displays only invoices that has been processed when set to true.
Type
boolean
Example
onlyProcessedInvoices=true
isApiCall
Description
Whether the API call is made directly, as opposed to if used from a frontend client.
Type
boolean

header parameters

X-Bring-Client-URL
Required
Description
A URL that sort of identifies where you’re using the APIs.
Type
any
X-Mybring-API-Key
Required
Description
Your user’s API key
Type
any
X-Mybring-API-Uid
Required
Description
Your Mybring login ID
Type
any

Responses

200 Successful

Schema

Media type: application/xml

object
Required
array
object
attachmentCount
integer <int32>
batchSource
string
currency
string
customerNumber
Required
string
dueDate
string
invoiceDate
string
invoiceIssuer
Required
string
invoiceNumber
string
invoiceProcessed
Required
string
Enum
YES
NO
PARTLY
invoiceSpecificationAvailable
Required
boolean
parentInvoiceNumber
string
Required
array
string
specInvoiceReportId
string
specificationAvailability
Required
string
Enum
YES
NO
PARTLY
status
string
supportCaseNumber
string
supportCaseUrl
string
totalAmount
string
type
string
status
Required
string

Response examples

Successful

<?xml version="1.0" encoding="UTF-8"?>
<InvoiceResponse>
  <invoices>
    <InvoiceDetails>
      <currency>NOK</currency>
      <customerNumber>customerNumber</customerNumber>
      <dueDate>28.02.2020</dueDate>
      <invoiceDate>31.12.2019</invoiceDate>
      <invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
      <invoiceNumber>10158070</invoiceNumber>
      <invoiceSpecificationAvailable>true</invoiceSpecificationAvailable>
      <specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
      <status>Open</status>
      <totalAmount>386.25</totalAmount>
      <type>Invoice</type>
    </InvoiceDetails>
    <InvoiceDetails>
      <batchSource>PMS_BULKMAIL_OM</batchSource>
      <currency>NOK</currency>
      <customerNumber>customerNumber</customerNumber>
      <dueDate>25.02.2020</dueDate>
      <invoiceDate>31.12.2019</invoiceDate>
      <invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
      <invoiceNumber>152148</invoiceNumber>
      <specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
      <status>Closed</status>
      <totalAmount>7771.69</totalAmount>
      <type>Invoice</type>
    </InvoiceDetails>
    <InvoiceDetails>
      <batchSource>TMS_AMPHORA_OM</batchSource>
      <currency>NOK</currency>
      <customerNumber>customerNumber</customerNumber>
      <dueDate>06.03.2020</dueDate>
      <invoiceDate>31.01.2020</invoiceDate>
      <invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
      <invoiceNumber>1109932</invoiceNumber>
      <invoiceSpecificationAvailable>true</invoiceSpecificationAvailable>
      <specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
      <status>Open</status>
      <totalAmount>115.0</totalAmount>
      <type>Invoice</type>
    </InvoiceDetails>
    <InvoiceDetails>
      <batchSource>TMS_LM_OM</batchSource>
      <currency>NOK</currency>
      <customerNumber>customerNumber</customerNumber>
      <dueDate>03.03.2020</dueDate>
      <invoiceDate>31.01.2020</invoiceDate>
      <invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
      <invoiceNumber>11404211</invoiceNumber>
      <invoiceSpecificationAvailable>true</invoiceSpecificationAvailable>
      <specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
      <status>Open</status>
      <totalAmount>12117.16</totalAmount>
      <type>Invoice</type>
    </InvoiceDetails>
    <InvoiceDetails>
      <batchSource>TMS_AMPHORA_OM</batchSource>
      <currency>NOK</currency>
      <customerNumber>customerNumber</customerNumber>
      <dueDate>03.01.2020</dueDate>
      <invoiceDate>30.11.2019</invoiceDate>
      <invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
      <invoiceNumber>1100146</invoiceNumber>
      <invoiceSpecificationAvailable>true</invoiceSpecificationAvailable>
      <specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
      <status>Closed</status>
      <totalAmount>485.01</totalAmount>
      <type>Invoice</type>
    </InvoiceDetails>
    <InvoiceDetails>
      <batchSource>TMS_LM_OM</batchSource>
      <currency>NOK</currency>
      <customerNumber>customerNumber</customerNumber>
      <dueDate>31.12.2019</dueDate>
      <invoiceDate>30.11.2019</invoiceDate>
      <invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
      <invoiceNumber>11403110</invoiceNumber>
      <invoiceSpecificationAvailable>true</invoiceSpecificationAvailable>
      <specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
      <status>Closed</status>
      <totalAmount>1964.06</totalAmount>
      <type>Invoice</type>
    </InvoiceDetails>
    <InvoiceDetails>
      <batchSource>PMS_BULKMAIL_OM</batchSource>
      <currency>NOK</currency>
      <customerNumber>customerNumber</customerNumber>
      <dueDate>31.12.2019</dueDate>
      <invoiceDate>30.11.2019</invoiceDate>
      <invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
      <invoiceNumber>12139462</invoiceNumber>
      <specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
      <status>Closed</status>
      <totalAmount>2076.69</totalAmount>
      <type>Invoice</type>
    </InvoiceDetails>
    <InvoiceDetails>
      <batchSource>CRM_SF_EXT</batchSource>
      <currency>NOK</currency>
      <customerNumber>customerNumber</customerNumber>
      <dueDate>30.01.2020</dueDate>
      <invoiceDate>30.01.2020</invoiceDate>
      <invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
      <invoiceNumber>10021151</invoiceNumber>
      <specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
      <status>Closed</status>
      <totalAmount>-75.0</totalAmount>
      <type>Credit note</type>
    </InvoiceDetails>
  </invoices>
  <status>OK</status>
</InvoiceResponse>

Invoice PDF download endpoint

get
                https://www.mybring.com/invoicearchive/pdf/{customerNumberUnique}/{invoiceNumber}.pdf
              

This link is used to download the invoice pdf for the customers by providing API customer number and invoice number in URI params.

Request

path parameters

customerNumberUnique
Required
Description
Unique API Customer Number for each customer.
Type
string
invoiceNumber
Required
Description
Invoice number of the particular invoice to be downloaded.
Type
string

Responses

200 OK

Schema

Media type: application/pdf

string <byte>
comments powered by Disqus