Get an authentication token

Gets an authorization token. The format is OAuth 2.0. The token is included in the header of each request as Authorization: Bearer token.

Alert

The request body must be sent as a single line.

Request Example
curl -X 'POST' \
'{host}/security/oauth/token' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'client_id=client_id&client_secret=client_secret&grant_type=client_credentials&scope=read%20write'

Request

POST

/security/oauth/token

Body

application/x-www-form-urlencoded
{
    "client_id": "123123123",
    "client_secret": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
    "grant_type": "client_credentials",
    "scope": "read write"
}

Name

Description

client_id*

Type: string

client ID

Example: client_id

client_secret*

Type: string

secret

Example: client_secret

grant_type*

Type: string

Type of access

Default: client_credentials

scope*

Type: string

Access rights

Default: read write

Responses

200 OK

Successful authentication

Body

application/json
{
    "access_token": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
}

Name

Description

access_token*

Type: string

400 Bad Request

Error in the parameters, the response contains a list of validation errors

Body

application/json
[
    {
        "code": 100,
        "description": "Description of error"
    }
]

OrderStatusPut[]

OrderStatusPut

Name

Description

status*

Type: string

Order ststus.
Status description:

  • TAKEN_BY_COURIER - courier picked up the order from the restaurant.
  • DELIVERED – order completed.
  • CANCELLED – order cancelled.

Enum: CANCELLED, TAKEN_BY_COURIER, DELIVERED

attributes

Type: string[]

Additional attributes when changing the order status, for example, a sign of payment upon cancellation

Example: paid

comment

Type: string

Description of cancellation reasons (can be empty)

Example: test

Max length: 500

reason

Type: string

The reason for the cancellation of the order. It is transmitted only with the CANCELLED status

Example: place.unable_to_call

updatedAt

Type: string

The date when the order status changed, in RFC 3339 format with fractional part of seconds (Y-m-d\TH:i:s.uP)

Example: 1937-01-01T12:00:27.870000+00:20

500 Internal Server Error

Internal server errors

Body

application/json
[
    {
        "code": 100,
        "description": "Description of error"
    }
]

OrderStatusPut[]

No longer supported, please use an alternative and newer version.

Previous