Skip to content

Latest commit

 

History

History
578 lines (452 loc) · 16.4 KB

openApi.md

File metadata and controls

578 lines (452 loc) · 16.4 KB
title language_tabs language_clients toc_footers includes search highlight_theme headingLevel
EmporioLambda Backend v0.1.1
shell
curl
shell
true
darkula
2

EmporioLambda Backend v0.1.1

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

REST interfaces for EmporioLambda Backend

Base URLs:

Authentication

Scope Scope Description
read read for customers and admins
readAdmin read only for admins
writeUser edit data only for users
writeAdmin edit data only for admins

payments-orders

The payments-orders service

post__orders

Code samples

# You can also use wget
curl -X POST https://app.swaggerhub.com/apis/NotOnlyStudents/Backend/0.0.1/orders \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /orders

Create a new order for the user requesting

Body parameter

{
  "address": {
    "id": "string",
    "nation": "string",
    "city": "string",
    "address": "string",
    "cap": 0
  },
  "cart-token": {
    "token": {
      "data": {
        "products": [
          {
            "id": "string",
            "name": "string",
            "description": "string",
            "images": [
              "string"
            ],
            "quantity": 0,
            "discount": 0,
            "price": 0,
            "available": true,
            "evidence": true,
            "category": [
              "string"
            ]
          }
        ]
      },
      "timeout": "2019-08-24T14:15:22Z"
    },
    "hmac": "stringstringstringstringstringstringstringst"
  },
  "additionalInfo": "string"
}

Parameters

Name In Type Required Description
body body object true none
» address body #/paths/1orders/post/requestBody/content/application1json/schema/properties/address true none
»» id body string true none
»» nation body string true none
»» city body string true none
»» address body string true none
»» cap body number true none
» cart-token body object false none
»» token body object true none
»»» data body object false none
»»»» products body [#/paths/1orders/get/responses/200/content/application1json/schema/items/properties/products/items] true none
»»»»» id body string true none
»»»»» name body string true none
»»»»» description body string false none
»»»»» images body [string] false none
»»»»» quantity body integer(int32) true none
»»»»» discount body integer(int32) false none
»»»»» price body integer(int64) true none
»»»»» available body boolean false none
»»»»» evidence body boolean false none
»»»»» category body [string] true none
»»» timeout body string(date-time) false none
»» hmac body string(byte) true none
» additionalInfo body string false none

Example responses

200 Response

{
  "data": {
    "sessionId": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK The checkout session was succesfully opened and the order created Inline
400 Bad Request The given order is not in the correct format. Inline
401 Unauthorized Authorization information is missing or invalid. Inline
5XX Unknown Unexpected error. Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» data object false none none
»» sessionId string false none none

Status Code 400

Name Type Required Restrictions Description
» message string true none none

Status Code 401

Name Type Required Restrictions Description
» message string true none none

Status Code 5XX

Name Type Required Restrictions Description
» message string true none none
To perform this operation, you must be authenticated by means of one of the following methods: oAuth ( Scopes: writeUser writeAdmin )

get__orders

Code samples

# You can also use wget
curl -X GET https://app.swaggerhub.com/apis/NotOnlyStudents/Backend/0.0.1/orders \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /orders

Return a list of orders filtered according to given parameters

Parameters

Name In Type Required Description
status query #/paths/~1orders/get/parameters/0/schema false Filter orders that match the given status
start query string(date-time) false Filter orders that were created on or after the specified date
end query string(date-time) false Filter orders that were created before or on the specified date
email query string(email) false Filter orders made by a specific user (only vendor)

Enumerated Values

Parameter Value
status fulfilled
status new

Example responses

200 Response

[
  {
    "id": "string",
    "customerEmail": "[email protected]",
    "address": {
      "id": "string",
      "nation": "string",
      "city": "string",
      "address": "string",
      "cap": 0
    },
    "products": [
      {
        "id": "string",
        "name": "string",
        "description": "string",
        "images": [
          "string"
        ],
        "quantity": 0,
        "discount": 0,
        "price": 0,
        "available": true,
        "evidence": true,
        "category": [
          "string"
        ]
      }
    ],
    "additionalInfo": "string",
    "date": "2019-08-24T14:15:22Z",
    "status": "fulfilled"
  }
]

Responses

Status Meaning Description Schema
200 OK Successfully returned a list of orders Inline
400 Bad Request Bad parameter format. Inline
401 Unauthorized Authorization information is missing or invalid. Inline
403 Forbidden Only vendor can filter orders by User Inline
404 Not Found No orders with the specified filters where found. Inline
5XX Unknown Unexpected error. Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [#/paths/1orders/get/responses/200/content/application1json/schema/items] false none none
» id string true none none
» customerEmail string(email) false none none
» address #/paths/1orders/post/requestBody/content/application1json/schema/properties/address true none none
»» id string true none none
»» nation string true none none
»» city string true none none
»» address string true none none
»» cap number true none none
» products [#/paths/1orders/get/responses/200/content/application1json/schema/items/properties/products/items] true none none
»» id string true none none
»» name string true none none
»» description string false none none
»» images [string] false none none
»» quantity integer(int32) true none none
»» discount integer(int32) false none none
»» price integer(int64) true none none
»» available boolean false none none
»» evidence boolean false none none
»» category [string] true none none
» additionalInfo string false none none
» date string(date-time) false none none
» status #/paths/~1orders/get/parameters/0/schema false none none

Enumerated Values

Property Value
status fulfilled
status new

Status Code 400

Name Type Required Restrictions Description
» message string true none none

Status Code 401

Name Type Required Restrictions Description
» message string true none none

Status Code 403

Name Type Required Restrictions Description
» message string true none none

Status Code 404

Name Type Required Restrictions Description
» message string true none none

Status Code 5XX

Name Type Required Restrictions Description
» message string true none none
To perform this operation, you must be authenticated by means of one of the following methods: oAuth ( Scopes: read readAdmin )

get__orders_{orderId}

Code samples

# You can also use wget
curl -X GET https://app.swaggerhub.com/apis/NotOnlyStudents/Backend/0.0.1/orders/{orderId} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /orders/{orderId}

Return an order by id

Parameters

Name In Type Required Description
orderId path string true The id of the desired order

Example responses

200 Response

{
  "id": "string",
  "customerEmail": "[email protected]",
  "address": {
    "id": "string",
    "nation": "string",
    "city": "string",
    "address": "string",
    "cap": 0
  },
  "products": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "images": [
        "string"
      ],
      "quantity": 0,
      "discount": 0,
      "price": 0,
      "available": true,
      "evidence": true,
      "category": [
        "string"
      ]
    }
  ],
  "additionalInfo": "string",
  "date": "2019-08-24T14:15:22Z",
  "status": "fulfilled"
}

Responses

Status Meaning Description Schema
200 OK Successfully returned a order by id Inline
400 Bad Request The order ID does not fit the correct format. None
401 Unauthorized Authorization information is missing or invalid. None
404 Not Found An order with the specified ID was not found. None
5XX Unknown Unexpected error. None

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id string true none none
» customerEmail string(email) false none none
» address #/paths/1orders/post/requestBody/content/application1json/schema/properties/address true none none
»» id string true none none
»» nation string true none none
»» city string true none none
»» address string true none none
»» cap number true none none
» products [#/paths/1orders/get/responses/200/content/application1json/schema/items/properties/products/items] true none none
»» id string true none none
»» name string true none none
»» description string false none none
»» images [string] false none none
»» quantity integer(int32) true none none
»» discount integer(int32) false none none
»» price integer(int64) true none none
»» available boolean false none none
»» evidence boolean false none none
»» category [string] true none none
» additionalInfo string false none none
» date string(date-time) false none none
» status #/paths/~1orders/get/parameters/0/schema false none none

Enumerated Values

Property Value
status fulfilled
status new
To perform this operation, you must be authenticated by means of one of the following methods: oAuth ( Scopes: read )

patch__orders_{orderId}

Code samples

# You can also use wget
curl -X PATCH https://app.swaggerhub.com/apis/NotOnlyStudents/Backend/0.0.1/orders/{orderId} \
  -H 'Authorization: Bearer {access-token}'

PATCH /orders/{orderId}

Set an order to fulfilled

Parameters

Name In Type Required Description
orderId path string true The id of the desired order

Responses

Status Meaning Description Schema
200 OK Successfully updated the order status None
400 Bad Request Bad status format. None
401 Unauthorized Authorization information is missing or invalid. None
403 Forbidden Only vendor can perform this action. None
404 Not Found An order with the specified ID was not found. None
5XX Unknown Unexpected error. None
To perform this operation, you must be authenticated by means of one of the following methods: oAuth ( Scopes: writeAdmin )

post__stripe-hook

Code samples

# You can also use wget
curl -X POST https://app.swaggerhub.com/apis/NotOnlyStudents/Backend/0.0.1/stripe-hook \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /stripe-hook

Webhook to recieve payment events from stripe API

Body parameter

{
  "type": "payment_intent.succeeded",
  "data": {
    "object": {
      "id": "string"
    }
  }
}

Parameters

Name In Type Required Description
body body object true none
» type body string false none
» data body object false none
»» object body object false none
»»» id body string false none

Enumerated Values

Parameter Value
» type payment_intent.succeeded
» type payment_intent.payment_failed
» type payment_intent.canceled

Example responses

403 Response

{
  "message": "string"
}

Responses

Status Meaning Description Schema
204 No Content Acknowledgment of the recieved event None
403 Forbidden Access prohibited, only Stripe API can access this backend call Inline
5XX Unknown Unexpected server error Inline

Response Schema

Status Code 403

Name Type Required Restrictions Description
» message string true none none

Status Code 5XX

Name Type Required Restrictions Description
» message string true none none
This operation does not require authentication