Modify Delivery API
The Modify Delivery API can be used to modify shipments that currently are on their way to the recipient. Shipments can either be stopped and returned to the sender, or they can be rerouted to a new delivery address. It is also possible to change the cash on delivery amount. At the moment, Parcel Norway domestic services (with the exception of Pakke i postkassen and return services) are supported.
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.
Common criteria
The shipment must have both sender and recipient address located in Norway. Additionally, any of the following events should not already be present on the shipment:
- Damaged
- Deviation
- Returned
- Delivered
- Lost
- Partly delivered
- Stop shipment
Supported services
Service | Service code | Stop shipment | Change COD | Change Address |
---|---|---|---|---|
Bedriftspakke Dør - Dør Innland | 1000 | Yes | Yes | Yes |
Bedriftspakke ekspress over natten | 1002 | Yes | Yes | No |
Klimanøytral Servicepakke | 1202 | Yes | Yes | Yes |
På Døren | 1736 | Yes | Yes | Yes |
Konv Bedriftspakke Flerkolli | 1988 | Yes | Yes | Yes |
Bedriftspakke Standard | 3500 | Yes | Yes | No |
Ekspress neste dag | 4850 | Yes | No | No |
Pakke til bedrift | 5000 | Yes | No | Yes |
Pakke levert hjem | 5600 | Yes | No | Yes |
Pakke til hentested | 5800 | Yes | Yes | Yes |
Endpoints
https://www.qa.mybring.com
Usage | Method | Endpoint |
---|---|---|
Allowed modifications | GET |
/modify-delivery/allowed-modification
|
Change recipient address of delivery | POST |
/modify-delivery/modifications/address
|
Get the cost for changing address on a shipment. | GET |
/modify-delivery/modifications/changeAddress/price/{shipmentNumber}/{existingPostalCode}/{newPostalCode}
|
Change cash on delivery | POST |
/modify-delivery/modifications/cod
|
Get modifications history | GET |
/modify-delivery/modifications/customer/{customer}
|
Current recipient address | GET |
/modify-delivery/modifications/fetchChangeAddressData/{shipmentNumber}
|
Stop shipment | POST |
/modify-delivery/modifications/stop
|
Allowed modifications
/modify-delivery/allowed-modification
Get the list of allowed modifications on a shipment along with failure causes.
Request
query parameters
-
q
Required - Shipment numberstringExample
q=707262014721
Responses
Response examples
{
"description": "Available modifications",
"value": {
"allowedModifications": [
"MODIFY_COD",
"CHANGE_ADDRESS"
],
"failureCauses": {
"STOP_DELIVERY": [
"PRODUCT_NOT_VALID_FOR_REQUEST"
]
},
"userLang": "en"
}
}
{
"description": "Shipment not found",
"value": {
"code": "404",
"message": "No tracking details for query SHIPMENT_NUMBER",
"title": "NOT_FOUND"
}
}
Change recipient address of delivery
/modify-delivery/modifications/address
This is used to change the recipient delivery address.
Criteria
The following events should not be present on the shipment:- Loaded for Delivery
- Partly delivered due to damage
- Home delivery ordered by recipient
- Alternativt utleveringssted (0010)
- Mottakerbestilt hjemlevering (1158, 1159)
Responses
Request example
{
"description": "Change recipient address",
"value": {
"changeAddressFee": "This is the cost for changing the address on delivery . The value can be fetched by calling the below service 'Get price for change address'.",
"newAddress": {
"addressLine1": "ADDRESS_LINE_1",
"addressLine2": "ADDRESS_LINE_1 CAN BE NULL OR EMPTY",
"city": "OSLO",
"countryCode": "NO",
"emailAddress": " IF NO CHANGE THEN SEND A SPACE",
"phoneNumber": " IF NO CHANGE THEN SEND A SPACE",
"postalCode": "0121"
},
"oldAddress": {
"addressLine1": "ADDRESS_LINE_1",
"addressLine2": "ADDRESS_LINE_2",
"city": "CITY",
"countryCode": "NO",
"postalCode": "2212"
},
"shipmentNumber": "SHIPMENT_NUMBER"
}
}
Response examples
{
"description": "response",
"value": {
"code": "201",
"message": "Successfully submitted the change address request",
"title": "CREATED"
}
}
{
"description": "Forbidden",
"value": {
"code": "403",
"message": "Forbidden request for modify delivery for SHIPMENT_NUMBER",
"title": "FORBIDDEN"
}
}
{
"description": "Shipment not found",
"value": {
"code": "404",
"message": "No tracking details for query SHIPMENT_NUMBER",
"title": "NOT_FOUND"
}
}
{
"description": "Modification not allowed",
"value": {
"code": "412",
"message": "Shipment is no longer eligible for modification.",
"title": "PRECONDITION_FAILED"
}
}
Get the cost for changing address on a shipment.
/modify-delivery/modifications/changeAddress/price/{shipmentNumber}/{existingPostalCode}/{newPostalCode}
Get the cost for changing address on a shipment. Currently the price for changing address is a fixed amount. It will give exactly the same amount as in the example below.
Request
path parameters
-
shipmentNumber
Required - string
-
existingPostalCode
Required - string
-
newPostalCode
Required - string
Responses
Response examples
{
"description": "Successful",
"value": {
"price": "206.25",
"requestType": "CHANGE_ADDRESS"
}
}
{
"description": "Unable to handle request for change address",
"value": {
"code": "400",
"message": "Bad Request for query SHIPMENT_NUMBER, can't be fetched for given shipment.",
"title": "BAD_REQUEST"
}
}
{
"description": "Forbidden",
"value": {
"code": "403",
"message": "Forbidden request for modify delivery for SHIPMENT_NUMBER",
"title": "FORBIDDEN"
}
}
{
"description": "Shipment not found",
"value": {
"code": "404",
"message": "No tracking details for query SHIPMENT_NUMBER",
"title": "NOT_FOUND"
}
}
Change cash on delivery
/modify-delivery/modifications/cod
This is used to change the cash on delivery amount on the shipment
Responses
Request example
{
"description": "Change COD",
"value": {
"newCodAmount": "123.45",
"shipmentNumber": "SHIPMENT_NUMBER"
}
}
Response examples
{
"description": "Successfully submitted change of delivery order",
"value": {
"code": "201",
"message": "Successfully submitted the change in cash on delivery request",
"title": "CREATED"
}
}
{
"description": "Unable to handle request for CoD",
"value": {
"code": "400",
"message": "Unable to handle request for change CoD for SHIPMENT_NUMBER",
"title": "BAD_REQUEST"
}
}
{
"description": "Forbidden",
"value": {
"code": "403",
"message": "Forbidden request for modify delivery for SHIPMENT_NUMBER",
"title": "FORBIDDEN"
}
}
{
"description": "Shipment not found",
"value": {
"code": "404",
"message": "No tracking details for query SHIPMENT_NUMBER",
"title": "NOT_FOUND"
}
}
Get modifications history
/modify-delivery/modifications/customer/{customer}
Get list of all the shipments for the customer number on which COD, STOP Delivery and Change address have been done.
Request
path parameters
-
customer
Required - string
Responses
Response examples
{
"description": "Modifications history example",
"value": {
"request": [
{
"createdTime": "CREATED_TIME",
"newValue": {
"codAmount": "COD_AMOUNT",
"modifyRequestType": "MODIFY_COD"
},
"oldValue": {
"codAmount": "COD_AMOUNT",
"modifyRequestType": "MODIFY_COD"
},
"packageNumber": "ITEM_NUMBER",
"recipientName": "RECIPIENT_NAME",
"requestType": "MODIFY_COD",
"senderCustomerNumber": "SENDER_CUSTOMER_NUMBER",
"shipmentNumber": "SHIPMENT_NUMBER",
"userName": "USER_WHO_PERFORMED_THE_OPERATION"
},
{
"createdTime": "CREATED_TIME",
"newValue": null,
"oldValue": null,
"packageNumber": "ITEM_NUMBER",
"recipientName": "RECIPIENT_NAME",
"requestType": "STOP_DELIVERY",
"senderCustomerNumber": "SENDER_CUSTOMER_NUMBER",
"shipmentNumber": "SHIPMENT_NUMBER",
"userName": "USER_WHO_PERFORMED_THE_OPERATION"
},
{
"createdTime": "CREATED_TIME",
"newValue": null,
"oldValue": null,
"packageNumber": "ITEM_NUMBER",
"recipientName": "RECIPIENT_NAME",
"requestType": "STOP_DELIVERY",
"senderCustomerNumber": "SENDER_CUSTOMER_NUMBER",
"shipmentNumber": "SHIPMENT_NUMBER",
"userName": "USER_WHO_PERFORMED_THE_OPERATION"
},
{
"createdTime": "CREATED_TIME",
"newValue": {
"addressLine1": "ADDRESS_LINE1",
"addressLine2": "ADDRESS_LINE2",
"city": "CITY",
"countryCode": "NO",
"emailAddress": "IF CHANGE DONE THEN VALUE ELSE null",
"modifyRequestType": "CHANGE_ADDRESS",
"phoneNumber": "IF CHANGE DONE THEN VALUE ELSE null",
"postalCode": "POSTAL_CODE"
},
"oldValue": {
"addressLine1": "ADDRESS_LINE1",
"addressLine2": "ADDRESS_LINE2",
"city": "CITY",
"countryCode": "NO",
"modifyRequestType": "CHANGE_ADDRESS",
"postalCode": "POSTAL_CODE"
},
"packageNumber": "ITEM_NUMBER",
"recipientName": "RECIPIENT_NAME",
"requestType": "CHANGE_ADDRESS",
"senderCustomerNumber": "SENDER_CUSTOMER_NUMBER",
"shipmentNumber": "SHIPMENT_NUMBER",
"userName": "USER_WHO_PERFORMED_THE_OPERATION"
}
],
"selectCustomer": "CUSTOMER_NUMBER",
"userCustomers": []
}
}
Current recipient address
/modify-delivery/modifications/fetchChangeAddressData/{shipmentNumber}
Get the current recipient address on the shipment.
Request
path parameters
-
shipmentNumber
Required - string
Responses
Response examples
{
"description": "response",
"value": {
"addressLine1": "ADDRESS_LINE_1",
"addressLine2": "ADDRESS_LINE_2",
"city": "CITY",
"country": "COUNTRY",
"countryCode": "COUNTRY_CODE",
"postalCode": "POSTAL_CODE",
"recipientName": "RECIPIENT_NAME"
}
}
{
"description": "Shipment not found",
"value": {
"code": "404",
"message": "No tracking details for query SHIPMENT_NUMBER",
"title": "NOT_FOUND"
}
}
Stop shipment
/modify-delivery/modifications/stop
This will stop the shipment and send it back to the sender.
Responses
Request example
{
"description": "Stop shipment",
"value": {
"shipmentNumber": "SHIPMENT_NUMBER"
}
}
Response examples
{
"description": "Successfully submitted stop delivery order",
"value": {
"code": "201",
"message": "Successfully submitted stop delivery order",
"title": "CREATED"
}
}
{
"description": "Unable to handle request for stop delivery order",
"value": {
"code": "400",
"message": "Unable to handle request for stop shipment for SHIPMENT_NUMBER",
"title": "BAD_REQUEST"
}
}
{
"description": "Forbidden",
"value": {
"code": "403",
"message": "Forbidden request for modify delivery for SHIPMENT_NUMBER",
"title": "FORBIDDEN"
}
}
{
"description": "Shipment not found",
"value": {
"code": "404",
"message": "No tracking details for query SHIPMENT_NUMBER",
"title": "NOT_FOUND"
}
}