My Products
Help
erik-kle
PARTNER

PUT Shipment - Object reference not set to an instance of an object

by erik-kle

Trying to update a shipment, but gets Error "Object reference not set to an instance of an object" and cannot find why. Can someone point me in the right direction?

 

{
  "shipmentNumber": {
    "Value": "000002"
  },
  "shipmentType": {
    "Value": "Issue"
  },
  "hold": {
    "Value": true
  },
  "operation": {
    "Value": "Issue"
  },
  "shipmentDetailLines": [
    {
      "lineNumber": {
        "Value": 1
      },
      "shippedQty": {
        "Value": 1.0
      },
      "operation": "Update"
    }
  ],
  "note": {
    "Value": "Test"
  },
  "shipmentPackageLines": [
    {
      "operation": "Insert",
      "boxId": {
        "Value": "BOX"
      },
      "description": {
        "Value": "00087122820000000679"
      },
      "weight": {
        "Value": 2.0
      },
      "trackingNumber": {
        "Value": "TESTTRK000002002"
      },
      "customRefNbr1": {
        "Value": "BLE"
      },
      "confirmed": {
        "Value": true
      },
      "coDAmount": {
        "Value": 2.0
      }
    }
  ]
}

 

2 REPLIES 2
Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen (Updated ‎30-03-2022 13:49 by Magnus Johnsen VISMA )

Hi,

The issue seems to be occurring when the "lineNumber" field is not included, on our end the JSON below works:

{
  "shipmentNumber": {
    "Value": "000002"
  },
  "shipmentType": {
    "Value": "Issue"
  },
  "hold": {
    "Value": true
  },
  "operation": {
    "Value": "Issue"
  },
  "shipmentDetailLines": [
    {
      "lineNumber": {
        "Value": 1
      },
      "shippedQty": {
        "Value": 1.0
      },
      "operation": "Update"
    }
  ],
  "note": {
    "Value": "Test"
  },
  "shipmentPackageLines": [
    {
      "operation": "Insert",
      "lineNumber": {
        "value": 0
      },
      "boxId": {
        "Value": "BOX"
      },
      "description": {
        "Value": "00087122820000000679"
      },
      "weight": {
        "Value": 2.0
      },
      "trackingNumber": {
        "Value": "TESTTRK000002002"
      },
      "customRefNbr1": {
        "Value": "BLE"
      },
      "confirmed": {
        "Value": true
      },
      "coDAmount": {
        "Value": 2.0
      }
    }
  ]
}

 

 

erik-kle
PARTNER

by erik-kle

Perfect, thank you Magnus, that was what i was missing 🙂