Creating Retailer Configurations

To create a new retailer configuration we need to do a POST request to /configurations with the application/json content-type request header and a JSON object containing the specified properties in the request body.

Required Permission

can-create-configurations

See Auth* (scopes).

Object Properties

Name Mandatory Type Length
retailerId false UUID 36
apiKey false UUID 36
shipperId (*3) false UUID 36
repositoryType true Enumeration (*1) 10
user true string 200
password true string 200
url true string 200
enabled true boolean -
oauthAuthentication (*2) false boolean -

Notes

  1. Possibilities: DM, SMR, SMRREST.
  2. If not set or false then retailer will be configured to use apiKey authentication.
  3. Identifier of the shipper (i.e. the entity which manages one or more shipping location).
    Currently, this Id is required for DM repository type.

Request

POST /configurations
Authorization: Bearer <token>
Content-Type: application/json
{
  "retailerId": "ed3dd9a9-4abd-4d1e-b2f1-0eecbb600ec9",
  "apiKey": "cb3dbb84-23a7-4c19-8705-4ff418356de8",
  "repositoryType": "SMR",
  "user": "test",
  "password": "test",
  "url": "https://test.mpm.metapack.com/BlackBox",
  "enabled": true
}

Request For DM

POST /configurations
Authorization: Bearer <token>
Content-Type: application/json
{
  "retailerId": "ed3dd9a9-4abd-4d1e-b2f1-0eecbb600ec9",
  "shipperId": "6981b140-9d82-486e-8327-91340ba8b80a",
  "apiKey": "dd3dbb84-23a7-6g19-8705-67g418356de8",
  "repositoryType": "DM",
  "user": "test",
  "password": "test",
  "url": "http://test.metapack.com/api",
  "enabled": true
}

Response

HTTP/1.1 201 CREATED
{
  "rel": "self",
  "href": "/configurations/<configuration ID>"
}

Failure

Request error; e.g. invalid JSON object:

HTTP/1.1 400 BAD REQUEST

User doesn't have the required permission:

HTTP/1.1 403 FORBIDDEN

Other errors:

HTTP/1.1 500 INTERNAL SERVER ERROR

results matching ""

    No results matching ""