Shipment API

Introduction

The Shipment API is a logged-in service that lets Mybring users (customers of Mybring) programatically create a instruction or a booking by invoking a Web Service by posting XML/JSON over HTTP.

The Shipment API uses Shipping Guide as the source for price and availability (when supported in the Shipping Guide) for the different products. We advise clients of the Shipment API to use Shipping Guide API for getting the list price and checking availability before sending a booking request. Note that invoice payment is the only available payment option for the Shipment API. This means that the Mybring user ID used in the booking request must have access to the customer number specified as payer of the booking.

We are continually rolling out support for more of Posten / Brings products and aim to support all available products in this API withing a short time. In addition to the documentation on this pages feel free to check out our swagger page for this API.

This API does not generate labels for you. If you need label creation please see the booking API.

Authentication

The API requires authentication for all its endpoints. See the getting started guide on authentication if you’re not sure what this means.

Header Example Comment
X-MyBring-API-Uid john.doe@example.com Mybring login ID
X-MyBring-API-Key 1234abc-abcd-1234-5678-abcd1234abcd Mybring login’s API key

Those headers must be present for authenticating requests.

Overview of endpoints

Base URL

https://api.bring.com/shipment
Method Endpoint Usage
POST /sendshipment/shipmentId={createShipmentId}&packageIds={createPackageId} Request is used to either create, update or delete an instruction for Bring.
POST /sendbooking/shipmentId={createShipmentId}&packageIds={createPackageId} Request is used to either create, update or delete an instruction for Bring.

Create shipment

Sends a shipment consisting of one consignment, that must include at least one package (transportunit), from one sender to one receiver. The shipment might include additional information in regards to cash on delivery, dangerousgoods etc. If requested through the query parameteres the service will create shipmentid (for the whole shipment) in addition to package ids. The packageids will be returned in the order of the packages (ie. package 1 in the input wil have packageid 1 in returned array).

A valid combination of an additional party, with party type TransportCompany and a valid partyId and optionally subPartyId, and service is required. In addition there might be several valueadded services that can be added. Refer to the documentation for valid values.

The structure and most of the content will be validated.

URL

https://api.bring.com/shipment/sendshipment/shipmentId={createShipmentId}&packageIds={createPackageId}

Request params

URI parameter Type Description
createShipmentId boolean

Required. If “true” the API will assign a shipment ID for you and return it in the response..

createPackageId boolean

Required. If “true” the API will assign all package IDs for you and return them in the response..

Header name Type Description
Content-Type string

Required. Specify request format (application/json, application/xml)

Possible values
  • application/json
  • application/xml
Accept string

Required. Specify response format (application/json, application/xml)

Possible values
  • application/json
  • application/xml

Request body

Media Type: application/xml

<?xml version="1.0" encoding="utf-8"?>
<CreateShipmentRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://api.bring.com/CreateShipment">
	<RequestVersion xmlns="">1</RequestVersion>
	<RequestDate xmlns="">2018-11-21T10:35:16.2573224+01:00</RequestDate>
	<Shipment updateIndicator="Original" shipmentType="Instruction" xmlns="">
		<ShipmentHeaders shipmentId="73500012345678911">
			<SendersReference>CUSTOMERS REFERENCE</SendersReference>
			<NumberOfPackages>2</NumberOfPackages>
			<AdditionalReference referenceType="TRANSPORT_DOCUMENT_NUMBER">
				<ReferenceValue>4440/0189981/WEJ</ReferenceValue>
			</AdditionalReference>
			<AdditionalReference referenceType="PROJECT_NUMBER">
				<ReferenceValue>44057673</ReferenceValue>
			</AdditionalReference>
			<FreeText usageCode="PICKUP_INSTRUCTIONS">
				<Text>My instructions for pickup</Text>
			</FreeText>
			<FreeText usageCode="CARRIER_INSTRUCTIONS">
				<Text sequence="0">31x20x3 7. etg. Skal hentes på resepsjon </Text>
			</FreeText>
			<FreeText usageCode="DELIVERY_INSTRUCTIONS">
				<Text sequence="0">Skal leveres til resepsjon</Text>
			</FreeText>
			<GrossWeight unitCode="KGM">112</GrossWeight>
			<GrossVolume unitCode="MTQ">1.86</GrossVolume>
			<LoadingMetres>0</LoadingMetres>
			<PalletFootPrints>0</PalletFootPrints>
			<HazardPoints>0</HazardPoints>
		</ShipmentHeaders>
		<DateAndTimes subClass="PickupEarliest">
			<DateTime>2018-11-21T14:35:16.2573224+01:00</DateTime>
		</DateAndTimes>
		<DateAndTimes subClass="DeliveryEarliest">
			<DateTime>2018-11-21T18:35:16.2573224+01:00</DateTime>
		</DateAndTimes>
		<DateAndTimes subClass="DeliveryLatest">
			<DateTime>2018-11-21T20:35:16.2573224+01:00</DateTime>
		</DateAndTimes>
		<DateAndTimes subClass="DocumentDate">
			<DateTime>2018-11-21T10:35:16.2573224+01:00</DateTime>
		</DateAndTimes>
		<Sender partyId="00096882527">
			<Name>Sender name</Name>
			<Address>
				<AddressLine>MyStreet 123</AddressLine>
				<PostalCode>5122</PostalCode>
				<City>My City</City>
				<CountryCode>NO</CountryCode>
			</Address>
			<MobilePhone>12345678</MobilePhone>
			<Email>Sender@Sender.com</Email>
		</Sender>
		<Receiver>
			<Name>Receiver name</Name>
			<Address>
				<AddressLine>MyStreet 123</AddressLine>
				<PostalCode>5122</PostalCode>
				<City>Other City</City>
				<CountryCode>NO</CountryCode>
			</Address>
			<MobilePhone>87654321</MobilePhone>
			<Email>Receiver@Receiver.com</Email>
		</Receiver>
		<AdditionalParty subClass="TransportCompany" partyId="BEX" subPartyId="GLW" />
		<ProductAndService>
			<ProductCode>COURIER_1H</ProductCode>
			<AdditionalService>
				<AdditionalServiceCode>EVARSLING</AdditionalServiceCode>
			</AdditionalService>
		</ProductAndService>
		<DeliveryTerms termsType="Incoterms">
			<ConditionCode>12</ConditionCode>
			<Location>
				<City>Bergen</City>
				<CountryCode>NO</CountryCode>
			</Location>
		</DeliveryTerms>
		<CashOnDelivery codType="12" codeListIdentifier="12" codeListAgencyIdentifier="agencyIdent" name="Navn">
			<TransactionIdentifier identifierType="SS" accountType="Unleaded">12444422</TransactionIdentifier>
			<Amount currencyCode="NOK" />
			<ControlDigit>1233</ControlDigit>
			<DocumentId>12223</DocumentId>
			<MonetaryAccount>
				<AccountNumber accountType="Bank" channel="Magic">12345.01.123654</AccountNumber>
				<SwiftCode>DNBNOAK-123332</SwiftCode>
				<BankName>DNB</BankName>
				<AccountHolderName>Name Nameson</AccountHolderName>
			</MonetaryAccount>
		</CashOnDelivery>
		<GoodsItem>
			<PackageTypeCode>code</PackageTypeCode>
			<GoodsDescription>Socks</GoodsDescription>
			<Temperature>
				<Transport unitCode="CEL" minimum="0" maximum="5">2</Transport>
				<Storage unitCode="CEL" minimum="0" maximum="5">2</Storage>
			</Temperature>
			<Package packageId="373500123456789012">
				<GrossWeight unitCode="KGM">1</GrossWeight>
				<GrossVolume unitCode="DMQ">22</GrossVolume>
				<Dimensions>
					<Height unitCode="MTR">22</Height>
					<Length unitCode="MTR">22</Length>
					<Width unitCode="MTR">22</Width>
				</Dimensions>
				<Insurance>
					<InsuranceValue currencyCode="NOK">200000</InsuranceValue>
					<GoodsDescription>Gullbarre</GoodsDescription>
					<Email>insurance@vesta.no</Email>
				</Insurance>
			</Package>
			<Package packageId="37350012345678929">
				<GrossWeight unitCode="KGM">1</GrossWeight>
				<GrossVolume unitCode="DMQ">22</GrossVolume>
				<Dimensions>
					<Height unitCode="MTR">22</Height>
					<Length unitCode="MTR">22</Length>
					<Width unitCode="MTR">22</Width>
				</Dimensions>
				<Insurance>
					<InsuranceValue currencyCode="NOK">200000</InsuranceValue>
					<GoodsDescription>Gullbarre</GoodsDescription>
					<Email>insurance@vesta.no</Email>
				</Insurance>
			</Package>
			<DangerousGoods regulationCode="ADR">
				<UNDGInformation>
					<HazardIdentifier>1314</HazardIdentifier>
				</UNDGInformation>
				<HazardClass>4.1</HazardClass>
				<AdditionalHazard>2.3(8)</AdditionalHazard>
				<PackingGroup>3</PackingGroup>
				<Measures subClass="NetHazardWeight">
					<Measure unitCode="KGM">2.500</Measure>
				</Measures>
				<TechnicalName>KALSIUMRESINAT, SINTRET</TechnicalName>
				<Restrictions restrictionType="Tunnel">3(E)</Restrictions>
				<HazardPoints>10</HazardPoints>
			</DangerousGoods>
		</GoodsItem>
	</Shipment>
</CreateShipmentRequest>

Media Type: application/json

{
  "RequestVersion": "1",
  "RequestDate": "2018-11-21T10:34:25.4301835+01:00",
  "Shipment": {
    "updateIndicator": "Original",
    "shipmentType": "Instruction",
    "ShipmentHeaders": {
      "SendersReference": "CUSTOMERS REFERENCE",
      "NumberOfPackages": "2",
      "AdditionalReference": [
        {
          "ReferenceValue": "4440/0189981/WEJ",
          "referenceType": "TRANSPORT_DOCUMENT_NUMBER"
        },
        {
          "ReferenceValue": "44057673",
          "referenceType": "PROJECT_NUMBER"
        }
      ],
      "FreeText": [
        {
          "Text": [
            {
              "Value": "My instructions for pickup"
            }
          ],
          "usageCode": "PICKUP_INSTRUCTIONS"
        },
        {
          "Text": [
            {
              "sequence": "0",
              "Value": "31x20x3 7. etg. Skal hentes på resepsjon "
            }
          ],
          "usageCode": "CARRIER_INSTRUCTIONS"
        },
        {
          "Text": [
            {
              "sequence": "0",
              "Value": "Skal leveres til resepsjon"
            }
          ],
          "usageCode": "DELIVERY_INSTRUCTIONS"
        }
      ],
      "GrossWeight": {
        "unitCode": 1,
        "Value": 112.0
      },
      "GrossVolume": {
        "unitCode": 1,
        "Value": 1.86
      },
      "LoadingMetres": 0.0,
      "PalletFootPrints": 0.0,
      "HazardPoints": 0.0,
      "shipmentId": "73500012345678911"
    },
    "DateAndTimes": [
      {
        "subClass": "PickupEarliest",
        "DateTime": "2018-11-21T14:34:25.4301835+01:00"
      },
      {
        "subClass": "DeliveryEarliest",
        "DateTime": "2018-11-21T18:34:25.4301835+01:00"
      },
      {
        "subClass": "DeliveryLatest",
        "DateTime": "2018-11-21T20:34:25.4301835+01:00"
      },
      {
        "subClass": "DocumentDate",
        "DateTime": "2018-11-21T10:34:25.4301835+01:00"
      }
    ],
    "Sender": {
      "partyId": "00096882527",
      "Name": "Sender name",
      "Address": {
        "AddressLine": [
          "MyStreet 123"
        ],
        "PostalCode": "5122",
        "City": "My City",
        "CountryCode": "NO"
      },
      "MobilePhone": "12345678",
      "Email": "Sender@Sender.com"
    },
    "Receiver": {
      "Name": "Receiver name",
      "Address": {
        "AddressLine": [
          "MyStreet 123"
        ],
        "PostalCode": "5122",
        "City": "Other City",
        "CountryCode": "NO"
      },
      "MobilePhone": "87654321",
      "Email": "Receiver@Receiver.com"
    },
    "AdditionalParty": [
      {
        "subClass": "TransportCompany",
        "partyId": "BEX",
        "subPartyId": "GLW"
      }
    ],
    "ProductAndService": {
      "ProductCode": "COURIER_1H",
      "AdditionalService": [
        {
          "AdditionalServiceCode": "EVARSLING"
        }
      ]
    },
    "DeliveryTerms": {
      "ConditionCode": "12",
      "Location": {
        "City": "Bergen",
        "CountryCode": "NO"
      },
      "termsType": 0
    },
    "CashOnDelivery": {
      "TransactionIdentifier": {
        "identifierType": 1,
        "accountType": "Unleaded",
        "Value": "12444422"
      },
      "Amount": {
        "currencyCode": "NOK"
      },
      "ControlDigit": 1233.0,
      "DocumentId": [
        "12223"
      ],
      "MonetaryAccount": {
        "AccountNumber": {
          "accountType": 0,
          "channel": "Magic",
          "Value": "12345.01.123654"
        },
        "SwiftCode": "DNBNOAK-123332",
        "BankName": "DNB",
        "AccountHolderName": "Name Nameson"
      },
      "codType": "12",
      "codeListIdentifier": "12",
      "codeListAgencyIdentifier": "agencyIdent",
      "name": "Navn"
    },
    "GoodsItem": [
      {
        "PackageTypeCode": "code",
        "GoodsDescription": "Socks",
        "Temperature": {
          "Transport": {
            "unitCode": 0,
            "minimum": "0",
            "maximum": "5",
            "Value": 2.0
          },
          "Storage": {
            "unitCode": 0,
            "minimum": "0",
            "maximum": "5",
            "Value": 2.0
          }
        },
        "Package": [
          {
            "GrossWeight": {
              "unitCode": 1,
              "Value": 1.0
            },
            "GrossVolume": {
              "unitCode": 0,
              "Value": 22.0
            },
            "Dimensions": {
              "Height": {
                "unitCode": 2,
                "Value": 22.0
              },
              "Length": {
                "unitCode": 2,
                "Value": 22.0
              },
              "Width": {
                "unitCode": 2,
                "Value": 22.0
              }
            },
            "Insurance": {
              "InsuranceValue": {
                "currencyCode": "NOK",
                "Value": 200000.0
              },
              "GoodsDescription": "Gullbarre",
              "Email": "insurance@vesta.no"
            },
            "packageId": "373500123456789012"
          },
          {
            "GrossWeight": {
              "unitCode": 1,
              "Value": 1.0
            },
            "GrossVolume": {
              "unitCode": 0,
              "Value": 22.0
            },
            "Dimensions": {
              "Height": {
                "unitCode": 2,
                "Value": 22.0
              },
              "Length": {
                "unitCode": 2,
                "Value": 22.0
              },
              "Width": {
                "unitCode": 2,
                "Value": 22.0
              }
            },
            "Insurance": {
              "InsuranceValue": {
                "currencyCode": "NOK",
                "Value": 200000.0
              },
              "GoodsDescription": "Gullbarre",
              "Email": "insurance@vesta.no"
            },
            "packageId": "37350012345678929"
          }
        ],
        "DangerousGoods": {
          "UNDGInformation": {
            "HazardIdentifier": "1314"
          },
          "HazardClass": "4.1",
          "AdditionalHazard": "2.3(8)",
          "PackingGroup": "3",
          "Measures": [
            {
              "Measure": {
                "unitCode": "KGM",
                "Value": 2.500
              },
              "subClass": "NetHazardWeight"
            }
          ],
          "TechnicalName": "KALSIUMRESINAT, SINTRET",
          "Restrictions": [
            {
              "restrictionType": 0,
              "Value": "3(E)"
            }
          ],
          "HazardPoints": 10.0,
          "regulationCode": "ADR"
        }
      }
    ]
  }
}

Responses

HTTP status code 200

Returns a confirmation of successfull delivery and package IDs / shipment IDs if requested.

Media Type: application/xml

null

Media Type: application/json

null

HTTP status code 250

Sample request to book a Bring Express Courier shipment.

Media Type: application/xml

Media Type: application/json

HTTP status code 400

Error in validation of request or error in data structure of request.

HTTP status code 417

Missing authentication headers.

HTTP status code 500

Unknown error. Error sending data to destination.

Create shipment booking

Sends a shipment consisting of one consignment, that must include at least one package (transportunit), from one sender to one receiver. The shipment might include additional information in regards to cash on delivery, dangerousgoods etc. If requested through the query parameteres the service will create shipmentid (for the whole shipment) in addition to package ids. The packageids will be returned in the order of the packages (ie. package 1 in the input wil have packageid 1 in returned array).

A valid combination of an additional party, with party type TransportCompany and a valid partyId and optionally subPartyId, and service is required. In addition there might be several valueadded services that can be added. Refer to the documentation for valid values.

The structure and most of the content will be validated.

URL

https://api.bring.com/shipment/sendbooking/shipmentId={createShipmentId}&packageIds={createPackageId}

Request params

URI parameter Type Description
createShipmentId boolean

Required. If “true” the API will assign a shipment ID for you and return it in the response..

createPackageId boolean

Required. If “true” the API will assign all package IDs for you and return them in the response..

Header name Type Description
Content-Type string

Required. Specify request format (application/json, application/xml)

Possible values
  • application/json
  • application/xml
Accept string

Required. Specify response format (application/json, application/xml)

Possible values
  • application/json
  • application/xml

Request body

Media Type: application/xml

<?xml version="1.0" encoding="utf-8"?>
<CreateBookingRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://api.bring.com/CreateShipment">
	<RequestVersion xmlns="">1</RequestVersion>
	<RequestDate xmlns="">2019-01-31T07:33:09.9666092+01:00</RequestDate>
	<Shipment updateIndicator="Original" shipmentType="Booking" xmlns="">
		<ShipmentHeaders shipmentId="73500012345678911">
			<SendersReference>CUSTOMERS REFERENCE</SendersReference>
			<NumberOfPackages>2</NumberOfPackages>
			<AdditionalReference referenceType="BOOKING_REFERENCE">
				<ReferenceValue>Dummy</ReferenceValue>
			</AdditionalReference>
			<FreeText usageCode="PICKUP_INSTRUCTIONS">
				<Text>My instructions for pickup</Text>
			</FreeText>
			<GrossWeight unitCode="KGM">2</GrossWeight>
			<LoadingMetres>0</LoadingMetres>
			<PalletFootPrints>0</PalletFootPrints>
			<HazardPoints>0</HazardPoints>
		</ShipmentHeaders>
		<DateAndTimes subClass="PickupEarliest">
			<DateTime>2019-01-31T11:33:09.9666092+01:00</DateTime>
		</DateAndTimes>
		<DateAndTimes subClass="DeliveryEarliest">
			<DateTime>2019-01-31T15:33:09.9666092+01:00</DateTime>
		</DateAndTimes>
		<DateAndTimes subClass="DeliveryLatest">
			<DateTime>2019-01-31T17:33:09.9666092+01:00</DateTime>
		</DateAndTimes>
		<DateAndTimes subClass="DocumentDate">
			<DateTime>2019-01-31T07:33:09.9666092+01:00</DateTime>
		</DateAndTimes>
		<Sender partyId="00096882527">
			<Name>Sender name</Name>
			<Address>
				<AddressLine>MyStreet 123</AddressLine>
				<PostalCode>5122</PostalCode>
				<City>My City</City>
				<CountryCode>NO</CountryCode>
			</Address>
			<MobilePhone>12345678</MobilePhone>
			<Email>Sender@Sender.com</Email>
		</Sender>
		<Receiver>
			<Name>Receiver name</Name>
			<Address>
				<AddressLine>MyStreet 123</AddressLine>
				<PostalCode>5122</PostalCode>
				<City>Other City</City>
				<CountryCode>NO</CountryCode>
			</Address>
			<MobilePhone>87654321</MobilePhone>
			<Email>Receiver@Receiver.com</Email>
		</Receiver>
		<AdditionalParty subClass="TransportCompany" partyId="BEX" subPartyId="ALY" />
		<ProductAndService>
			<ProductCode>COURIER_1H</ProductCode>
			<AdditionalService>
				<AdditionalServiceCode>EVARSLING</AdditionalServiceCode>
			</AdditionalService>
		</ProductAndService>
		<GoodsItem>
			<GoodsDescription>Socks</GoodsDescription>
			<Package packageId="373500123456789012">
				<GrossWeight unitCode="KGM">1</GrossWeight>
			</Package>
			<Package packageId="37350012345678929">
				<GrossWeight unitCode="KGM">1</GrossWeight>
			</Package>
		</GoodsItem>
	</Shipment>
</CreateBookingRequest>

Media Type: application/json

{
  "RequestVersion": "1",
  "RequestDate": "2018-11-21T10:36:27.3139022+01:00",
  "Shipment": {
    "updateIndicator": "Original",
    "shipmentType": "Booking",
    "ShipmentHeaders": {
      "SendersReference": "CUSTOMERS REFERENCE",
      "NumberOfPackages": "2",
      "AdditionalReference": [
        {
          "ReferenceValue": "Dummy",
          "referenceType": "BOOKING_REFERENCE"
        }
      ],
      "FreeText": [
        {
          "Text": [
            {
              "Value": "My instructions for pickup"
            }
          ],
          "usageCode": "PICKUP_INSTRUCTIONS"
        }
      ],
      "GrossWeight": {
        "unitCode": 1,
        "Value": 2.0
      },
      "LoadingMetres": 0.0,
      "PalletFootPrints": 0.0,
      "HazardPoints": 0.0,
      "shipmentId": "73500012345678911"
    },
    "DateAndTimes": [
      {
        "subClass": "PickupEarliest",
        "DateTime": "2018-11-21T14:36:27.3139022+01:00"
      },
      {
        "subClass": "DeliveryEarliest",
        "DateTime": "2018-11-21T18:36:27.3139022+01:00"
      },
      {
        "subClass": "DeliveryLatest",
        "DateTime": "2018-11-21T20:36:27.3139022+01:00"
      },
      {
        "subClass": "DocumentDate",
        "DateTime": "2018-11-21T10:36:27.3139022+01:00"
      }
    ],
    "Sender": {
      "partyId": "00096882527",
      "Name": "Sender name",
      "Address": {
        "AddressLine": [
          "MyStreet 123"
        ],
        "PostalCode": "5122",
        "City": "My City",
        "CountryCode": "NO"
      },
      "MobilePhone": "12345678",
      "Email": "Sender@Sender.com"
    },
    "Receiver": {
      "Name": "Receiver name",
      "Address": {
        "AddressLine": [
          "MyStreet 123"
        ],
        "PostalCode": "5122",
        "City": "Other City",
        "CountryCode": "NO"
      },
      "MobilePhone": "87654321",
      "Email": "Receiver@Receiver.com"
    },
    "AdditionalParty": [
      {
        "subClass": "TransportCompany",
        "partyId": "BEX",
        "subPartyId": "ALY"
      }
    ],
    "ProductAndService": {
      "ProductCode": "COURIER_1H",
      "AdditionalService": [
        {
          "AdditionalServiceCode": "EVARSLING"
        }
      ]
    },
    "GoodsItem": [
      {
        "GoodsDescription": "Socks",
        "Package": [
          {
            "GrossWeight": {
              "unitCode": 1,
              "Value": 1.0
            },
            "packageId": "373500123456789012"
          },
          {
            "GrossWeight": {
              "unitCode": 1,
              "Value": 1.0
            },
            "packageId": "37350012345678929"
          }
        ]
      }
    ]
  }
}

Responses

HTTP status code 200

Returns a confirmation of successfull delivery and package IDs / shipment IDs if requested.

HTTP status code 400

Error in validation of request or error in data structure of request.

HTTP status code 417

Missing authentication headers.

HTTP status code 500

Unknown error. Error sending data to destination.