Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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.

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 request

  • If 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.
The old value is not stored, and can not be retrieved after replaced.

Description of each key:
“op“ → operation used
”path” → JSON Pointer used to specify which part of the model needs to be changed
”value” → The value that will be changed

Add

Remove

  • No labels