sgo-ux

(0 reviews)

GET-ProductStock

[TOC]

/productStock [GET]

This operation retrieve or find ProductStock entities.

Method Logic

graph LR
        id1((client)) --> request
    request --> process
    process --> response
    response --> id1((client))

Process sequence diagram

sequenceDiagram
participant ux as Client
participant biz as sgo-ux
participant sys as stock-management-biz

ux ->>+biz: GET [REST]<br> productStock
alt
    biz->>+sys: GET<br>[REST]<br>/productStock
        note over sys: Tranformation<br>Request 1
    sys-->>-biz:  200
        note over biz: Tranformation<br>Response

end
biz-->>-ux:  200
   note over ux: Tranformation<br>Response

alt invalid input or unsupported message type then
    activate biz
        biz-->>ux: 400
    deactivate biz
else authentication invalid then
    activate biz
        biz-->>ux: 401
    deactivate biz
else  request not found then
    activate biz
        biz-->>ux: 404
    deactivate biz
else businessId not implemented then
    activate biz
        biz-->>ux: 501
    deactivate biz
else server not available or timeout then
    activate biz
        biz-->>ux: 500
    deactivate biz
end

Uses Cases

The internal use cases to the method are defined.

CaseDescription
1querying product stock availability of a given serial Number/IMEI Number

Request

This section defines all the possible data structures sent by the client when consuming the method.

URL

https://[localhost]:[port]/sgo-ux/v1/{businessId}/productStock

URL PARAMS

nametypedescriptionrequired
businessIdstring2 letter ISO 3166 country codeY
namevaluedescriptionrequired
client_idstringThe client_id identifying the channel. Minimum characters: 5Y
client_secretstringPassword associated with the client_id. Minimum characters: 5Y
X-Correlation-IDstringAn identifier for the current call chain that can be used to tie together log entries on multiple layers (e.g. client, server, mainframe). This identifier must be designed to be unique across all applications. Pattern: ^[a-zA-Z0-9-+/=_]{16,64}$
Minimum characters: 16
Maximum characters: 64
Y

Query param

nametypedescriptionrequired
resource.idstringProduct serial numberY
resource.namestringProduct typeN

Body

Request

curl --request GET --location 'https://esb-test.lla.com/sgo-ux/v1/PA/productStock?resource.id=10000000000187&resource.name=SIM' \
--header 'client_id: cb911dc86e034540bb2077cab88260e2' \
--header 'client_secret: 5A71c8Cbc853405D860453a6a5777A5d' \
--header 'X-Correlation-ID: 1234146846164896198'

Response

In this section all the possible data structures received by the client at the moment of responding the method are defined.

Possible response success

This section defines all the possible data structures received by the client and that must be considered satisfactory at the time of responding to the method.

[ 200 ]

OK - queryProductStock request processed successfully, response body contains an entity corresponding to the requested resource. queryProductStock:

[
    {
        "place": {
            "id": "0001",
            "name": "PA01",
            "role": "Warehouse",
            "@type": "Place",
            "@referredType": "GeographicAddress"
        },
        "productStockUsageType": "onDisplay",
        "resource": [
            {
                "id": "10000000000187",
                "name": "SIM",
                "@type": "PhysicalResource"
            }
        ],
        "stockedProduct": {
            "id": "000000000000103130",
            "isBundle": false,
            "isCustomerVisible": true,
            "name": "APPLE IPHONE XR 64GB WHITE",
            "productRelationship": [
                {
                    "id": "15121014",
                    "name": "DEV Mobile Simcards",
                    "relationshiptype": "ReliesOn",
                    "@type": "Product"
                }
            ],
            "@type": "Product"
        },
        "@type": "ProductStock"
    }
]

Possible response error

In this section all the possible data structures received by the client are defined and that must be considered as unsatisfactory when responding to the method.

[ 400 ]

Bad Request - the request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

{
  "errors" : [{
      "code" : 400 ,
      "message" : "The request is invalid or not properly formed.",
      "description" : "Malformed request syntax, invalid request message framing, or deceptive request routing."
    }
  ]
}
[ 401 ]

Unauthorized - The request has not been applied because it lacks valid authentication credentials for the target resource.

{
  "errors" : [{
      "code" : 401 ,
      "message" : "The user could not be authenticated for this request.",
      "description" : "The request has not been applied because it lacks valid authentication credentials for the target resource"
    }
  ]
}
[ 404 ]

Not Found - server has not found a resource with that URI. This may be temporary and permanent condition. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.

{
  "errors" : [{

      "code" : 404,
       "message" : "APIKIT:NOT_FOUND",
      "description" : "The requested operation failed because a resource associated with the request could not be found."
    }
  ]
}
[ 405 ]

Method Not Allowed - HTTP method not allowed for this resource. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.

{
    "errors": [{
            "code": 405,
             "message": "APIKIT:METHOD_NOT_ALLOWED",
             "description": "HTTP Method post not allowed for : /{businessId}/productStock"
        }]
}
[ 429 ]

Too Many Requests - client has sent too many requests in a space of time (rate limiting). When a server is under attack or just receiving a very large number of requests from a single party, responding to each with a 429 status code will consume resources. Therefore, servers may drop connections or take other steps instead of responding with the 429 status code, when limiting resource usage.

{
  "errors" : [{

      "code" : 429,
       "message" : "APIKIT:TOO_MANY_REQUESTS",
      "description" : "The client sent too many requests and server is not able to serve them all at the moment."
    }
  ]
}
[ 500 ]

Internal Server Error - server encountered an error processing request. This should not happen normally, but it is a generic error message, given when no more specific message is suitable.

{
  "errors" : [
      {
      "code" : 500,
      "message" : "Internal Error",
      "description": "The request failed due to an internal error"
    }
  ]
}
[ 501]
{
   "errors":[
      {
         "code":501,
         "message":"Not implemented",
         "description":"Operation POST /productStock for Business Id: XXXX not implemented"
      }
   ]
}
[ 503 ]

Service Unavailable - temporary maintenance of service, try again later. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay will be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response. Note: The existence of the 503 status code does not imply that a server will use it when becoming overloaded. Servers may simply refuse the connection.

    Retry-After: 120

Administration and data management

In this section you define all the transformations, temporary and final repositories of the data within the method flow.

Transformation Request

In this section the matrix of all the data transformations that is carried out within the service is defined.

Note Same input without transformations

Original PayloadMulesofttransformation
payloadpayload

Transformation Response

In this section the matrix of all the data transformations that is carried out within the service is defined.

Note Same input without transformations

Original PayloadMulesofttransformation
payloadpayload

Services dependencies

This section defines all the connections to the web services and the methods that are used within the method.

sap-sys

Reviews