Skip to main content

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

get
                              /modify-delivery/allowed-modification
                            

Get the list of allowed modifications on a shipment along with failure causes.

Request

query parameters

q
Required
Shipment number
string
Example
q=707262014721

Responses

200 Available modifications for specified shipment number
404 Shipment not found

Response examples

{
  "description": "Available modifications",
  "value": {
    "allowedModifications": [
      "MODIFY_COD",
      "CHANGE_ADDRESS"
    ],
    "failureCauses": {
      "STOP_DELIVERY": [
        "PRODUCT_NOT_VALID_FOR_REQUEST"
      ]
    },
    "userLang": "en"
  }
}

Change recipient address of delivery

post
                              /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
The shipment must not have any of the following VAS registered:
  • Alternativt utleveringssted (0010)
  • Mottakerbestilt hjemlevering (1158, 1159)

Responses

200 OK
403 Forbidden
404 Shipment not found
412 Modification not allowed

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"
  }
}

Get the cost for changing address on a shipment.

get
                              /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

200 Successful
400 Bad Request
403 Forbidden
404 Shipment not found

Response examples

{
  "description": "Successful",
  "value": {
    "price": "206.25",
    "requestType": "CHANGE_ADDRESS"
  }
}

Change cash on delivery

post
                              /modify-delivery/modifications/cod
                            

This is used to change the cash on delivery amount on the shipment

Responses

201 Successfully submitted change of delivery order
400 Unable to handle request for CoD
403 Forbidden
404 Shipment not found

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"
  }
}

Get modifications history

get
                              /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

200 OK

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

get
                              /modify-delivery/modifications/fetchChangeAddressData/{shipmentNumber}
                            

Get the current recipient address on the shipment.

Request

path parameters

shipmentNumber
Required
string

Responses

200 OK
404 Shipment not found

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"
  }
}

Stop shipment

post
                              /modify-delivery/modifications/stop
                            

This will stop the shipment and send it back to the sender.

Responses

200 Successfully submitted stop delivery order
400 Unable to handle request for stop delivery order
403 Forbidden
404 Shipment not found

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"
  }
}
comments powered by Disqus