Modify Delivery API

Introduction

The modify delivery api is used to modify a shipment currently on it’s way. Below are the various modifications (which will be API calls) supported:

  • Stop shipment.
  • Change cash on deivery.
  • Change Address

Authentication

The Modify Delivery API requires 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.

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.
POST /modifications/{shipmentNumber}/address Change recipient address of delivery.
GET /modifications/changeAddress/price/{shipment}/{oldPostal}/{newPostal} Get the cost for changing address on a shipment.
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

URL

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

Request params

Query params Type Description
q string

Required. Shipment number to be checked for.


Example: 707262014721

Response

(200)

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

Stop shipment

URL

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

Request body

{
  "shipmentNumber": "SHIPMENT_NUMBER"
}

Response

(200)

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

Change cash on delivery

URL

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

Request body

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

Response

(200)


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

Change recipient address of delivery.

URL

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

Request params

URI parameter 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": "206.25"
}

Response

(200)

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

Get price for change address.

Get the cost for changing address on a shipment.

URL

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

Request params

URI parameter Type Description
shipment string

Required. Shipment number.


Example: 707262014721
oldPostal string

Required. Current postal code of recipient address.


Example: 17
newPostal string

Required. New postal code to where shipment will be re-routed to.


Example: 0484

Response

(200)

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

Current recipient address

Get the current recipient address on the shipment.

URL

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

Request params

URI parameter Type Description
shipmentNumber string

Required. Shipment number to get current recipient address.


Example: 707262014721

Response

(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

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

Request params

URI parameter Type Description
customerNumber string

Required. Customer number.

Response

(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": []
}