Перейти к основному содержимому

Check Token Code API

POST /checkTokenCode

Description

This API endpoint allows users to check the details of a token code. It provides information on whether the token is active, its discount rate, and other relevant details.

Request Body

The request utilizes GraphQL to perform the checkTokenCode mutation.

Mutation:

mutation checkTokenCode ($code: String) {
checkTokenCode (code: $code) {
id
userId
tokenCode
discountRate
isActive
usedTimestamp
createdAt
}
}

Variables:

{
"code": "<Token_Code>"
}
  • code (String): The token code to be checked.

Response:

  • Success (200 OK):

    • If the token code is found, the response will include details about the token code, including its ID, associated user ID, discount rate, activation status, and timestamps.
    {
    "data": {
    "checkTokenCode": {
    "id": <Token_Code_ID>,
    "userId": <User_ID>,
    "tokenCode": "<Token_Code>",
    "discountRate": <Discount_Rate>,
    "isActive": <Is_Active>,
    "usedTimestamp": "<Used_Timestamp>",
    "createdAt": "<Creation_Timestamp>"
    }
    }
    }
  • Error (4XX/5XX):

    • If there is an issue finding the token code, such as an invalid code, the response will include an appropriate error message and status code.

Note:

Ensure the code provided is accurate to retrieve the correct token details. If the token code does not exist or has issues, the response will reflect that status.