Skip to main content
developer

Modify Delivery API

Released Modify Delivery API, an API used to modify a shipment currently on its way.

Overview of endpoints

Base URL

https://www.mybring.com/modify-delivery
Method Endpoint Usage
GET /allowed-modification List of allowed modifications, along with failure causes.
POST /stop-shipment Stop a shipment and return to sender.
POST /change-cod Change cash on delivery amount to be paid.
GET /modifications/changeAddress/price/{shipment}/{oldPostal}/{newPostal} Get the cost for changing address on a shipment.
POST /modifications/{shipmentNumber}/address Change recipient address of delivery.
GET /modifications/fetchChangeAddressData/{shipmentNumber} Get current recipient address for shipment.
GET /modifications/customer/{customerNumber} Get history for all the modifications done for a customer

Allowed modifications

It gives us the list of allowed modifications on a shipment along with failure causes.

URL

                          GET
                          https://www.mybring.com/modify-delivery/allowed-modification
                        

Request parameters

Query param Type Description
q string Required Shipment number to be checked for.
Example: 707262014721

Responses

HTTP status code 200

{
  "allowedModifications": [
    "MODIFY_COD",
    "CHANGE_ADDRESS"
  ],
  "failureCauses": {
    "STOP_DELIVERY": [
      "PRODUCT_NOT_VALID_FOR_REQUEST"
    ]
  },
  "userLang": "en"
}

Stop shipment

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

URL

                          POST
                          https://www.mybring.com/modify-delivery/stop-shipment
                        

Request body

{
  "shipmentNumber": "SHIPMENT_NUMBER"
}

Responses

HTTP status code 200

{
  "code": "201",
  "title": "CREATED",
  "message": "Successfully submitted stop delivery order"
}

Change cash on delivery

This is used to change the COD amount on the shipment.

Criteria

The shipment must have “Betaling ved utlevering (COD)” with VAS-Code 1000 registered.

URL

                          POST
                          https://www.mybring.com/modify-delivery/change-cod
                        

Request body

{
  "newCodAmount": "123.45",
  "shipmentNumber": "SHIPMENT_NUMBER"
}

Responses

HTTP status code 200


{
  "code": "201",
  "title": "CREATED",
  "message": "Successfully submitted the change in cash on delivery request"
}

Get price for change address

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.

URL

                          GET
                          https://www.mybring.com/modify-delivery/modifications/changeAddress/price/{shipment}/{oldPostal}/{newPostal}
                        

Request parameters

URI param Type Description
newPostal string Required New postal code to where shipment will be re-routed to.
Example: 0484
oldPostal string Required Current postal code of recipient address.
Example: 0021
shipment string Required Shipment number.
Example: 707262014721

Responses

HTTP status code 200

{
  "requestType": "CHANGE_ADDRESS",
  "price": "206.25"
}

Change recipient address of delivery

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)

URL

                          POST
                          https://www.mybring.com/modify-delivery/modifications/{shipmentNumber}/address
                        

Request parameters

URI param Type Description
shipmentNumber string Required Shipment number to change address for.
Example: 707262014721

Request body

{
  "newAddress": {
    "addressLine1": "ADDRESS_LINE_1",
    "addressLine2": "ADDRESS_LINE_1 CAN BE NULL OR EMPTY",
    "countryCode": "NO",
    "postalCode": "0121",
    "city": "OSLO",
    "phoneNumber": " IF NO CHANGE THEN SEND A SPACE",
    "emailAddress": " IF NO CHANGE THEN SEND A SPACE"
  },
  "oldAddress": {
    "addressLine1": "ADDRESS_LINE_1",
    "addressLine2": "ADDRESS_LINE_2",
    "countryCode": "NO",
    "postalCode": "2212",
    "city": "CITY"
  },
  "shipmentNumber": "SHIPMENT_NUMBER",
  "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'."
}

Responses

HTTP status code 200

{
  "code": "201",
  "title": "CREATED",
  "message": "Successfully submitted the change address request"
}

Current recipient address

Get the current recipient address on the shipment.

URL

                          GET
                          https://www.mybring.com/modify-delivery/modifications/fetchChangeAddressData/{shipmentNumber}
                        

Request parameters

URI param Type Description
shipmentNumber string Required Shipment number to get current recipient address.
Example: 707262014721

Responses

HTTP status code 200

{
  "recipientName": "RECIPIENT_NAME",
  "addressLine1": "ADDRESS_LINE_1",
  "addressLine2": "ADDRESS_LINE_2",
  "city": "CITY",
  "country": "COUNTRY",
  "countryCode": "COUNTRY_CODE",
  "postalCode": "POSTAL_CODE"
}

Get modifications history

Get list of all the shipments for the customer number on which COD, STOP Delivery and Change address have been done.

URL

                          GET
                          https://www.mybring.com/modify-delivery/modifications/customer/{customerNumber}
                        

Request parameters

URI param Type Description
customerNumber string Required Customer number.

Responses

HTTP status code 200

{
  "request": [
    {
      "shipmentNumber": "SHIPMENT_NUMBER",
      "packageNumber": "ITEM_NUMBER",
      "requestType": "MODIFY_COD",
      "oldValue": {
        "codAmount": "COD_AMOUNT",
        "modifyRequestType": "MODIFY_COD"
      },
      "newValue": {
        "codAmount": "COD_AMOUNT",
        "modifyRequestType": "MODIFY_COD"
      },
      "userName": "USER_WHO_PERFORMED_THE_OPERATION",
      "senderCustomerNumber": "SENDER_CUSTOMER_NUMBER",
      "recipientName": "RECIPIENT_NAME",
      "createdTime": "CREATED_TIME"
    },
    {
      "shipmentNumber": "SHIPMENT_NUMBER",
      "packageNumber": "ITEM_NUMBER",
      "requestType": "STOP_DELIVERY",
      "oldValue": null,
      "newValue": null,
      "userName": "USER_WHO_PERFORMED_THE_OPERATION",
      "senderCustomerNumber": "SENDER_CUSTOMER_NUMBER",
      "recipientName": "RECIPIENT_NAME",
      "createdTime": "CREATED_TIME"
    },
    {
      "shipmentNumber": "SHIPMENT_NUMBER",
      "packageNumber": "ITEM_NUMBER",
      "requestType": "STOP_DELIVERY",
      "oldValue": null,
      "newValue": null,
      "userName": "USER_WHO_PERFORMED_THE_OPERATION",
      "senderCustomerNumber": "SENDER_CUSTOMER_NUMBER",
      "recipientName": "RECIPIENT_NAME",
      "createdTime": "CREATED_TIME"
    },
    {
      "shipmentNumber": "SHIPMENT_NUMBER",
      "packageNumber": "ITEM_NUMBER",
      "requestType": "CHANGE_ADDRESS",
      "oldValue": {
        "countryCode": "NO",
        "postalCode": "POSTAL_CODE",
        "city": "CITY",
        "addressLine1": "ADDRESS_LINE1",
        "addressLine2": "ADDRESS_LINE2",
        "modifyRequestType": "CHANGE_ADDRESS"
      },
      "newValue": {
        "countryCode": "NO",
        "postalCode": "POSTAL_CODE",
        "city": "CITY",
        "addressLine1": "ADDRESS_LINE1",
        "addressLine2": "ADDRESS_LINE2",
        "phoneNumber": "IF CHANGE DONE THEN VALUE ELSE null",
        "emailAddress": "IF CHANGE DONE THEN VALUE ELSE null",
        "modifyRequestType": "CHANGE_ADDRESS"
      },
      "userName": "USER_WHO_PERFORMED_THE_OPERATION",
      "senderCustomerNumber": "SENDER_CUSTOMER_NUMBER",
      "recipientName": "RECIPIENT_NAME",
      "createdTime": "CREATED_TIME"
    }
  ],
  "selectCustomer": "CUSTOMER_NUMBER",
  "userCustomers": []
}