Tekton API (1.0.0)

Download OpenAPI specification:

Tekton is a lumber store in Perm. This is an early version of the store API, it may be changed in the future.

Sessions

Even if you are not logged in, we ask you to obtain a session key and pass it on with every request. The server can store data that is tied to a session (for example: a list of items in a shopping cart). If the session is authorized, this data will be linked not to the session, but to the account.

Tekton supports 2 ways to send session information:

  • Based on sessionid cookie
  • Based on Authorization header

authorization_header

Prefix your token with Session. For example: Authorization: Session your-token.

Security Scheme Type: API Key
Header parameter name: Authorization

CSRF

To protect against CSRF attacks, the API server requires sending the same token in the csrftoken cookie and in the X-CSRFToken header for POST, PUT, PATCH, and DELETE requests.

You can generate a random token, but its length must be exactly 32 characters. The token value itself does not matter.

Auth

Get session information

You can use this method without providing an existing session. The server always returns a valid session. If the current session has expired, it will be replaced. Try to use the received session key in all subsequent requests, even if you do not have an account or authorization is not required for the endpoint.

Authorizations:
session_cookieauthorization_header

Responses

Response samples

Content type
application/json
{
  • "sessionKey": "long-random-string",
  • "isAuthenticated": true,
  • "expiresAt": "2019-08-24T14:15:22Z"
}

Sign up

Authorizations:
session_cookieauthorization_header
Request Body schema: application/json
required
email
string <email>
password
string <password>

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "password": "pa$$word"
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "expiry": "2019-08-24T14:15:22Z"
}

Log in

Authorizations:
session_cookieauthorization_header
Request Body schema: application/json
required
email
string <email>
password
string <password>

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "password": "pa$$word"
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "expiry": "2019-08-24T14:15:22Z"
}

Log out

Authorizations:
session_cookieauthorization_header

Responses

Get profile information

Authorizations:
session_cookieauthorization_header

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "email": "user@example.com"
}

Products

Get a list of all products

Authorizations:
session_cookieauthorization_header
query Parameters
limit
integer <int64>

Limit on the number of results

offset
integer <int64>

The number of elements skipped from the start

Responses

Response samples

Content type
application/json
{
  • "count": 1,
  • "results": [
    ]
}

Get product information

Authorizations:
session_cookieauthorization_header
path Parameters
productId
required
integer <int64>

Product ID

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "title": "Product 1",
  • "price": "123.45",
  • "description": "<p>Lorem ipsum</p>",
  • "images": [],
  • "properties": [
    ]
}

Get descriptions of all properties.

Each product property has its own scheme. Use this method to get a list of available properties.

Authorizations:
session_cookieauthorization_header

Responses

Response samples

Content type
application/json
{
  • "count": 1,
  • "results": [
    ]
}

Cart

Get items from cart

Authorizations:
session_cookieauthorization_header

Responses

Response samples

Content type
application/json
{
  • "cart": [
    ],
  • "totalCost": "123.45"
}

Change quantity of items in cart

Authorizations:
session_cookieauthorization_header
Request Body schema: application/json
productId
integer <int64>
quantity
integer <int64>

Change in quantity of product in the cart. Can be negative. The value is added to the current quantity of the product. If the new value is less than or equal to 0, the item record is removed from the cart.

Responses

Request samples

Content type
application/json
{
  • "productId": 0,
  • "quantity": 1
}

Response samples

Content type
application/json
{
  • "productId": 0,
  • "quantity": 1
}

Get the quantity of product in the cart

The method allows you to find out the quantity of product in the cart. Works for any products, even for those that were not added to the cart.

Authorizations:
session_cookieauthorization_header
path Parameters
productId
required
integer <int64>

Product ID

Responses

Response samples

Content type
application/json
{
  • "productId": 0,
  • "quantity": 0
}

Get the cost of the items in the cart.

Authorizations:
session_cookieauthorization_header

Responses

Response samples

Content type
application/json
{
  • "totalCost": "123.45"
}

Checkout

Places an order with all current items in the cart.

Authorizations:
session_cookieauthorization_header
Request Body schema: application/json
required
firstName
string
lastName
string
phoneNumber
string
deliveryAddress
string

Responses

Request samples

Content type
application/json
{
  • "firstName": "Ivan",
  • "lastName": "Petrov",
  • "phoneNumber": "88005553535",
  • "deliveryAddress": "string"
}

Response samples

Content type
application/json
{
  • "order": {
    }
}