This API enables replacing an order registered in DI
Content
Purpose and use of Service
Replace Order API is used to replace details for an existing order. Replacing will create a new order, cancel an old one and applies to all items in that order.
Setup
Make sure you have the following information at hand before proceeding.
Example | Description | |
---|---|---|
Username (see Authentication section) | wsfoobar | A valid username. |
Password (see Authentication section) | a-very-very-long-password | A password matching given username. |
The user is a web service user
The user has access to the web service for editing orders
The user has access to the shop registered on the order
Environments / Endpoints
Consider using the TEST-endpoint while developing your system. By doing this you ensure that your test-data will not pollute any potential external systems.
TEST PATCH | https://staging-ws.di.no/ws/json/parcel/booking/v-1/orders/replace/{shipmentId} |
---|---|
PRODUCTION PATCH | https://ws.di.no/ws/json/parcel/booking/v-1/orders/replace/{shipmentId} |
Authentication
This endpoint requires the user to be authenticated. Refer to the documentation here for more information on how to obtain a valid token to use in your request.Â
Making a Request
Notes
Clients using this API should not fail if new optional fields are added to the API. If a new field is added to the request or response on a later stage, existing clients should handle this in a way such as they just ignore the field.
Changes will be updated for all parcels/kolli for the shipment/order specified
You may have several patch operations in one request
If request contains
remove
operation it should be the last operation in the requestIf one of the operations in a request is invalid the whole request will be interrupted
It is not possible to undo a replace request, but you can do several replace requests on the same shipment which will cause creating new order every time
Request-Headers
key | value example | comment |
---|---|---|
Authorization | Bearer "SECRET_WS_TOKEN" | See authentication on how to obtain a token |
Content-Type | application/json |
Request-Path-Parameters
Name | Example | Description |
---|---|---|
shipmentId | 70724761617883184 | The message number of the order that will be replaced |
Request-Body
JSON file containing an array of patch operations.. The current patch operations supported by JSON Patch are:
Name | Example | Description |
---|---|---|
Replace | [   { "op": "replace", "path": "/transportSolutionId", "value": 1 } ] | Replace the existing value with new value for specified path. Description of each key: |
Add | ||
Remove |