<commit_before>---
title: Shipping Guide API
layout: api
disqus_identifier: https-developer-bring-com-api-shipping-guide-2
menu:
  apidocs:
    identifier: shippingguide_2
    title: Shipping Guide API
    url: /api/shipping-guide_2
    parent: checkout
weight: 11
aliases:

important:
  - type: warn
    title: Changes in Shipping Guide API due to new invoicing system from April 1st, 2022
    message: |
      - Requests for Bring Parcels services (parcels in Sweden, Denmark, Finland and cross border parcels to/from Norway), must be done using main customer number. You must change to your new API main customer number for such requests. Your API main customer number is identical to your company's main customer number. [Your API customer numbers](https://www.mybring.com/useradmin/account/settings/api).

      - Your old API customer number will continue to work during a transition period. However, we recommend that you [change the API customer number being used for bookings of mentioned services](https://developer.bring.com/api/services/) as soon as possible to avoid any problems later.

introduction: |
  The Shipping Guide API provides available services for a given combination of sender and recipient locations, including estimated delivery times, prices and environmental data. It also returns logo and human readable service descriptions that can be shown in your checkout. Available services are based on your agreement with Bring (i.e. the customer numbers attached to your user).

information:
  - title: Authentication
    content: |
      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](/api/#authentication) page.

  - title: Rate limiting
    content: |
      Clients exceeding 60 requests per second will be throttled, and the response will contain http status code 429. If you have a use case requiring rates above the limit, please contact <EMAIL> for assistance.

  - title: Formats
    content: |
      REST XML/JSON over HTTP and SOAP over HTTP. The REST/GET interface only supports single consignments, while the SOAP and the REST/POST interfaces can be used for multiple consignments.

documentation:
  - title: Versioning
    content: |
      The Shipping Guide makes an effort to always be backwards compatible regarding data format for requests and responses. To achieve this, namespace schema versioning is used in the request for webservices, indicating which version the client is on and what data-format the client expects in the result. For REST, versioning is defined as part of endpoint itself.

      **Important**: All clients must accept **new (unknown) elements** in the response. E.g. unknown elements should be ignored. Also, **new error codes and warning codes** could be added as well. The client framework used by client must not crash when **unknown elements or new code values** are are encountered.

      When incompatible changes in the schema are made (other than addition of new elements), the namespace versioning will be updated accordingly. The new schema is used at the *same endpoint URL* as before for webservices. Old schema versions will be shut down some time in the future, so its recommended always updating to the latest version.

  - title: Performance
    content: |
      To have better performance of the api

      * Request can be limited to have only the services needed since the response time of some services can be slow as compared to others
      * If the request is only to find the lead time / prices of different service, the flag for withExpectedDelivery / withPrices should be set to true and others can be set to false. In case of REST these are different endpoints.
      * For net prices requests should include customer number and correct package details
      * Request can include limited number of consignments in each request for quick response.
      * New shipments request can be part of separate request

  - title: Getting shipment alternatives
    content: |
      This guide will walk you through getting shipment alternatives for your first consignment. We will be calling the SOAP interface with a HTTP client and query for the service `SERVICEPAKKE` and `PA_DOREN` for two packages.

      ### 1. Add additional headers

      #### SOAP
      Since we're using the SOAP (1.1) interface we'll have to add the following header:

      - `Content-type: text/xml`

      Most SOAP libraries will do this for you.

      #### REST
      For the REST `POST` interfaces:

      `Content-type: application/json`

      ### 2. Add the body to the request
      There are several ways you can control the output of your request. The following elements controls what the API will calculate.

      | SOAP name | REST (POST) name |  Description |
      | -------------- | -------------- | -------------- | -------------- |
      | `WithPrice` | `withPrice` | Controls whether prices should be calculated. Default `true` |
      | `WithExpectedDelivery` | `withExpectedDelivery` | Controls whether lead times should be calculated. Default `true` |
      | `WithGuiInformation` | `withGuiInformation` | Return detailed information about requested service. Default `true` |
      | `WithEstimatedDeliveryTime` | `withEstimatedDeliveryTime` | Extended lead time information, including predicted arrival time at pickup point. Only supported for a limited set of [services](#estimated-arrival-time-for-domestic-parcels-and-cargo). Default `false` |
      | `NumberOfAlternativeDeliveryDates` | `numberOfAlternativeDeliveryDates` | Number of alternative delivery dates to be suggested. Default `0`, maximum `9` |
      | `WithUniqueAlternateDeliveryDates` | `withUniqueAlternateDeliveryDates` | Return [unique alternative delivery dates](#get-unique-expected-delivery-dates). Default `false` |
      | `WithEnvironmentalData`| `withEnvironmentalData`| Return [environmental data](#shipment-environmental-data) about fossil free and electric transportation used on different transport legs |
      | `Language` | `language` | Language in which human readable message should be returned. Supported languages are `NO`, `DK`, `SE` and `EN` |
      | `EDI` | `edi` | Should the parcel be registered using EDI when shipped. Note that this flag may affect price and which services are available. Default `true` |
      | `PostingAtPostoffice` | `postingAtPostoffice` | Will the parcel be delivered at a post office when shipped. Default `false` |
      | `Trace` | `trace` | Shohuld trace messages should be returned or not. Refer TraceType description in response. Default `false` |

      In this request we will query prices and expected delivery time for the service `SERVICEPAKKE` for a single package being sent from the postal code 0015 to 5518 in Norway.

      #### SOAP

      ```xml
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                        xmlns:ns="http://www.bring.no/logistics/shippingguide/2.0">
          <soapenv:Header/>
          <soapenv:Body>
              <ns:ShippingGuideRequest xmlns:ns="http://www.bring.no/logistics/shippingguide/2.0">
                  <ns:Language>no</ns:Language>
                  <ns:WithPrice>true</ns:WithPrice>
                  <ns:WithExpectedDelivery>false</ns:WithExpectedDelivery>
                  <ns:WithGuiInformation>true</ns:WithGuiInformation>
                  <ns:NumberOfAlternativeDeliveryDates>0</ns:NumberOfAlternativeDeliveryDates>
                  <ns:EDI>true</ns:EDI>
                  <ns:PostingAtPostoffice>true</ns:PostingAtPostoffice>
                  <ns:Trace>true</ns:Trace>
                  <ns:Consignments><commit_msg>Add LeadTimeFromCustomerInMinutes in doc<commit_after>---
title: Shipping Guide API
layout: api
disqus_identifier: https-developer-bring-com-api-shipping-guide-2
menu:
  apidocs:
    identifier: shippingguide_2
    title: Shipping Guide API
    url: /api/shipping-guide_2
    parent: checkout
weight: 11
aliases:

important:
  - type: warn
    title: Changes in Shipping Guide API due to new invoicing system from April 1st, 2022
    message: |
      - Requests for Bring Parcels services (parcels in Sweden, Denmark, Finland and cross border parcels to/from Norway), must be done using main customer number. You must change to your new API main customer number for such requests. Your API main customer number is identical to your company's main customer number. [Your API customer numbers](https://www.mybring.com/useradmin/account/settings/api).

      - Your old API customer number will continue to work during a transition period. However, we recommend that you [change the API customer number being used for bookings of mentioned services](https://developer.bring.com/api/services/) as soon as possible to avoid any problems later.

introduction: |
  The Shipping Guide API provides available services for a given combination of sender and recipient locations, including estimated delivery times, prices and environmental data. It also returns logo and human readable service descriptions that can be shown in your checkout. Available services are based on your agreement with Bring (i.e. the customer numbers attached to your user).

information:
  - title: Authentication
    content: |
      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](/api/#authentication) page.

  - title: Rate limiting
    content: |
      Clients exceeding 60 requests per second will be throttled, and the response will contain http status code 429. If you have a use case requiring rates above the limit, please contact <EMAIL> for assistance.

  - title: Formats
    content: |
      REST XML/JSON over HTTP and SOAP over HTTP. The REST/GET interface only supports single consignments, while the SOAP and the REST/POST interfaces can be used for multiple consignments.

documentation:
  - title: Versioning
    content: |
      The Shipping Guide makes an effort to always be backwards compatible regarding data format for requests and responses. To achieve this, namespace schema versioning is used in the request for webservices, indicating which version the client is on and what data-format the client expects in the result. For REST, versioning is defined as part of endpoint itself.

      **Important**: All clients must accept **new (unknown) elements** in the response. E.g. unknown elements should be ignored. Also, **new error codes and warning codes** could be added as well. The client framework used by client must not crash when **unknown elements or new code values** are are encountered.

      When incompatible changes in the schema are made (other than addition of new elements), the namespace versioning will be updated accordingly. The new schema is used at the *same endpoint URL* as before for webservices. Old schema versions will be shut down some time in the future, so its recommended always updating to the latest version.

  - title: Performance
    content: |
      To have better performance of the api

      * Request can be limited to have only the services needed since the response time of some services can be slow as compared to others
      * If the request is only to find the lead time / prices of different service, the flag for withExpectedDelivery / withPrices should be set to true and others can be set to false. In case of REST these are different endpoints.
      * For net prices requests should include customer number and correct package details
      * Request can include limited number of consignments in each request for quick response.
      * New shipments request can be part of separate request

  - title: Getting shipment alternatives
    content: |
      This guide will walk you through getting shipment alternatives for your first consignment. We will be calling the SOAP interface with a HTTP client and query for the service `SERVICEPAKKE` and `PA_DOREN` for two packages.

      ### 1. Add additional headers

      #### SOAP
      Since we're using the SOAP (1.1) interface we'll have to add the following header:

      - `Content-type: text/xml`

      Most SOAP libraries will do this for you.

      #### REST
      For the REST `POST` interfaces:

      `Content-type: application/json`

      ### 2. Add the body to the request
      There are several ways you can control the output of your request. The following elements controls what the API will calculate.

      | SOAP name | REST (POST) name |  Description |
      | -------------- | -------------- | -------------- | -------------- |
      | `WithPrice` | `withPrice` | Controls whether prices should be calculated. Default `true` |
      | `WithExpectedDelivery` | `withExpectedDelivery` | Controls whether lead times should be calculated. Default `true` |
      | `WithGuiInformation` | `withGuiInformation` | Return detailed information about requested service. Default `true` |
      | `WithEstimatedDeliveryTime` | `withEstimatedDeliveryTime` | Extended lead time information, including predicted arrival time at pickup point. Only supported for a limited set of [services](#estimated-arrival-time-for-domestic-parcels-and-cargo). Default `false` |
      | `NumberOfAlternativeDeliveryDates` | `numberOfAlternativeDeliveryDates` | Number of alternative delivery dates to be suggested. Default `0`, maximum `9` |
      | `WithUniqueAlternateDeliveryDates` | `withUniqueAlternateDeliveryDates` | Return [unique alternative delivery dates](#get-unique-expected-delivery-dates). Default `false` |
      | `WithEnvironmentalData`| `withEnvironmentalData`| Return [environmental data](#shipment-environmental-data) about fossil free and electric transportation used on different transport legs |
      | `Language` | `language` | Language in which human readable message should be returned. Supported languages are `NO`, `DK`, `SE` and `EN` |
      | `EDI` | `edi` | Should the parcel be registered using EDI when shipped. Note that this flag may affect price and which services are available. Default `true` |
      | `PostingAtPostoffice` | `postingAtPostoffice` | Will the parcel be delivered at a post office when shipped. Default `false` |
      | `Trace` | `trace` | Should trace messages should be returned or not. Refer TraceType description in response. Default `false` |
      | `LeadTimeFromCustomerInMinutes` | `leadTimeFromCustomerInMinutes` | Lead time for customer in minutes required for same day delivery(2012) Applicable only for service 5600. Default `0` maximum `999` |

      In this request we will query prices and expected delivery time for the service `SERVICEPAKKE` for a single package being sent from the postal code 0015 to 5518 in Norway.

      #### SOAP

      ```xml
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                        xmlns:ns="http://www.bring.no/logistics/shippingguide/2.0">
          <soapenv:Header/>
          <soapenv:Body>
              <ns:ShippingGuideRequest xmlns:ns="http://www.bring.no/logistics/shippingguide/2.0">
                  <ns:Language>no</ns:Language>
                  <ns:WithPrice>true</ns:WithPrice>
                  <ns:WithExpectedDelivery>false</ns:WithExpectedDelivery>
                  <ns:WithGuiInformation>true</ns:WithGuiInformation>
                  <ns:NumberOfAlternativeDeliveryDates>0</ns:NumberOfAlternativeDeliveryDates>
                  <ns:EDI>true</ns:EDI>
                  <ns:PostingAtPostoffice>true</ns:PostingAtPostoffice>
                  <ns:Trace>true</ns:Trace>
                  <ns:Consignments>
{'fraction_non_alphanumeric': 0.07464011668463441, 'fraction_numerical': 0.005073244974316697, 'mean_word_length': 3.4535441965546454, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 4, 'lorem ipsum': 0, 'www.': 6, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1870240', 'n_tokens_mistral': 4019, 'n_tokens_neox': 3760, 'n_words': 1820}