vippsas / vipps-partner-api

Please see: Vipps MobilePay Technical Documentation: https://developer.vippsmobilepay.com
https://developer.vippsmobilepay.com
1 stars 2 forks source link

Proposal: API statuses: `GET:/saleunits/{msn}/api-status` #9

Open cloveras opened 2 years ago

cloveras commented 2 years ago

The API Dashboard (https://github.com/vippsas/vipps-developers#api-dashboard) is great for merchants, but a bit tricky for partners to get access to: They have to ask every merchant to give them access, and the access is personal and based on phone number.

A possible solution is an endpoint where a partner can use the partner keys to retrieve API (HTTP) statuses for all endpoints in a given time period, like 30 days.

This could be something like: GET:/saleunits/{msn}/api-status

With a response something like:

{
  "endpoint": {
    "uri" : "POST:/ecomm/v2/payments",
    "errorPercentage": 1.2,
    "200": 999999999,
    "500": 5,
    "errorPercentage": 3
  },
  "endpoint": {
    "uri" : "GET:/ecomm/v2/capture",
    "errorPercentage": 2.3,
    "200": 999999999,
    "400": 5,
    "404": 10
  },
  "endpoint": {
    "uri" : "GET:/ecomm/v2/details",
    "errorPercentage": 4.5,
    "200": 999999999,
    "400": 5,
    "404": 10,
    "429": 35
  },
  "endpoint": {
    "uri" : "GET:/ecomm/v2/refund",
    "errorPercentage": 6.7,
    "200": 999999999,
    "400": 3,
    "404": 10
  }
}

We could perhaps also add an optional parameter for selecting the time interval: GET:/saleunits/{msn}/api-status?days={days}. But: These searches in the logs are quite heavy, so we will have to look into how we can "pre-fetch" the data instead of doing it per request, and then how/if we can add some time period functionality.

Comments?

kgpanteon commented 2 years ago

@cloveras Yes. We need this type of endpoint. If vipps provide merchant salasunit data via API then its very important for us to track error.

cloveras commented 2 years ago

@kgpanteon Great, thanks!

Stating the obvious, though: You have already received the information about the errors in the API response for the incorrect API request, so this will be an additional help, but will not provide as fast or detailed information as the response we already send.