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 integrate with the Bring APIs, you will need a Mybring user account with an API key. Information about prerequisites and authentication headers can be found on the general API Getting Started 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

OpenAPI document

https://www.mybring.com/invoicearchive/v3/api-docs

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

header parameters

X-Mybring-API-Uid
Required
Description
Your Mybring login ID
Type
any
Example
X-MyBring-API-Uid=john.doe@example.com
X-Mybring-API-Key
Required
Description
Your user’s API key
Type
any
Example
X-MyBring-API-Key=1234abc-abcd-1234-5678-abcd1234abcd
X-Bring-Client-URL
Required
Description
A URL that sort of identifies where you’re using the APIs.
Type
any
Example
X-Bring-Client-URL=https://example.com

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
onlyProcessedInvoices
Description
Displays only invoices that has been processed when set to true.
Type
boolean
isApiCall
Type
boolean

Responses

200 Successful

Schema

Media type: application/json

Required
array of objects
attachmentCount
integer <int32>
batchSource
string
currency
string
customerNumber
string
dueDate
string
invalidPdfLink
boolean
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

{
  "invoices": [
    {
      "attachmentCount": 0,
      "batchSource": "CRM_SF_EXT",
      "currency": "NOK",
      "customerNumber": "customerNumber",
      "dueDate": "2022-06-29",
      "invoiceDate": "31.12.2019",
      "invoiceIssuer": "POSTEN_NORGE_AS",
      "invoiceNumber": "10158070",
      "invoiceProcessed": "YES",
      "invoiceSpecificationAvailable": false,
      "parentInvoiceNumber": "",
      "parentInvoiceNumberList": [],
      "specInvoiceReportId": "specified_invoice_customer_master",
      "specificationAvailability": "NO",
      "status": "Open",
      "supportCaseNumber": null,
      "supportCaseUrl": null,
      "totalAmount": "-386.25",
      "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

header parameters

X-Mybring-API-Uid
Required
Description
Your Mybring login ID
Type
any
Example
X-MyBring-API-Uid=john.doe@example.com
X-Mybring-API-Key
Required
Description
Your user’s API key
Type
any
Example
X-MyBring-API-Key=1234abc-abcd-1234-5678-abcd1234abcd
X-Bring-Client-URL
Required
Description
A URL that sort of identifies where you’re using the APIs.
Type
any
Example
X-Bring-Client-URL=https://example.com

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
onlyProcessedInvoices
Description
Displays only invoices that has been processed when set to true.
Type
boolean
isApiCall
Type
boolean

Responses

200 Successful

Schema

Media type: application/xml

object
Required
array
object
attachmentCount
integer <int32>
batchSource
string
currency
string
customerNumber
Required
string
dueDate
string
invalidPdfLink
Required
boolean
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

<?xml version="1.0" encoding="UTF-8"?>
<InvoiceResponse>
  <invoices>
    <InvoiceDetails>
      <batchSource>CRM_SF_EXT</batchSource>
      <currency>NOK</currency>
      <customerNumber>customerNumber</customerNumber>
      <dueDate>2022-06-29</dueDate>
      <invoiceDate>31.12.2019</invoiceDate>
      <invoiceIssuer>POSTEN_NORGE_AS</invoiceIssuer>
      <invoiceNumber>10158070</invoiceNumber>
      <invoiceProcessed>YES</invoiceProcessed>
      <parentInvoiceNumberList>
      </parentInvoiceNumberList>
      <specInvoiceReportId>specified_invoice_customer_master</specInvoiceReportId>
      <specificationAvailability>NO</specificationAvailability>
      <status>Open</status>
      <totalAmount>-386.25</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