LogoLogo
  • Authentication API
  • Chain API
    • Smart Account
    • API References
      • Net
      • ERC20 Token
      • ERC721 Token
      • ERC1155 Token
      • Smart Account
  • Chain Application API
    • ServerWallet API
    • Payment API
      • Payment (gRPC)
      • Points (REST)
    • IPFS API
      • API References
  • Chain API Errors
Powered by GitBook
On this page
  1. Chain Application API
  2. Payment API

Points (REST)

PreviousPayment (gRPC)NextIPFS API

Last updated 11 months ago

Endpoint

Real Server :

Test Server :

Authentication

To make a request, you need to include the JWT in the HTTP header. JWT can be received through the authentication server.

Example

If JWT is "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0MTExQGRzdGEuY29tIiwicm9sZSI6IlJPTEVfU1RPUkUiLCJleHAiOjE2NDgyMDc1OTIsImlhdCI6MTY0ODEyMTE5Mn0.AYNcBLhKqtqwzxNm7kOREEUH0_3gFevOXxI94TBORao",

curl -X 'POST' \
  '{endpoint}/nlp/issue' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0MTExQGRzdGEuY29tIiwicm9sZSI6IlJPTEVfU1RPUkUiLCJleHAiOjE2NDgyMDc1OTIsImlhdCI6MTY0ODEyMTE5Mn0.AYNcBLhKqtqwzxNm7kOREEUH0_3gFevOXxI94TBORao' \
  -H 'Content-Type: application/json' \
  -d '{
  "tokenAmount": "10"
}'

API References

Issue

If tranNo, amount, and the token name of recently issued points are the same, it is treated as a duplicate issuance and is failed.

Example

curl -X 'POST' \
  '{endpoint}/points/nlp/issue' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0MTExQGRzdGEuY29tIiwicm9sZSI6IlJPTEVfU1RPUkUiLCJleHAiOjE2NTIyNzgxNTgsImlhdCI6MTY1MjE5MTc1OH0.MqMd26110LlpuVrY-17so_WJ0icVlom0iqbp_0dVo58' \
  -H 'Content-Type: application/json' \
  -d '{
  "tokenAmount": "10",
  "tid": "test01"
}'
{
  "rewardId": "6500627A723D0000",
  "tokenSymbol": "NLP",
  "tokenAmount": "10",
  "contractAddress": "0x31a093de11a38d00ec33f112cac623afb1ae9276",
  "rewardDate": "20220510231005+0900"
}

Accumulate

Example

curl -X 'POST' \
  '{endpoint}/points/nlp/6500627A723D0000/accumulate' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0MTExQGRzdGEuY29tIiwicm9sZSI6IlJPTEVfU1RPUkUiLCJleHAiOjE2NTIyNzgxNTgsImlhdCI6MTY1MjE5MTc1OH0.MqMd26110LlpuVrY-17so_WJ0icVlom0iqbp_0dVo58' \
  -H 'Content-Type: application/json' \
  -d '{
  "tokenAmount": "10",
  "userAddress": "user-address"
}'
{
  "userAddress": "user-address",
  "tokenSymbol": "NLP",
  "tokenAmount": "10.00",
  "contractAddress": "0x31a093de11a38d00ec33f112cac623afb1ae9276"
}

Status

Example

curl -X 'GET' \
  '{endpoint}/points/nlp/6500627A723D0000/status' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0MTExQGRzdGEuY29tIiwicm9sZSI6IlJPTEVfU1RPUkUiLCJleHAiOjE2NTIyNzgxNTgsImlhdCI6MTY1MjE5MTc1OH0.MqMd26110LlpuVrY-17so_WJ0icVlom0iqbp_0dVo58'
{
  "userAddress": "user-address",
  "accumulated": true,
  "tokenSymbol": "NLP",
  "contractAddress": "0x31a093de11a38d00ec33f112cac623afb1ae9276"
}

Cancel

Example

curl -X 'POST' \
  '{endpoint}/points/nlp/6500627A723D0000/cancel' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0MTExQGRzdGEuY29tIiwicm9sZSI6IlJPTEVfU1RPUkUiLCJleHAiOjE2NTIyNzgxNTgsImlhdCI6MTY1MjE5MTc1OH0.MqMd26110LlpuVrY-17so_WJ0icVlom0iqbp_0dVo58' \
  -H 'Content-Type: application/json' \
  -d '{
  "tokenAmount": "10"
}'
{
  "userAddress": "user-address",
  "tokenSymbol": "NLP",
  "tokenAmount": "10",
  "contractAddress": "0x31a093de11a38d00ec33f112cac623afb1ae9276"
}

The token amount should be the same as when the points are issued.

Error Codes (resCode)

  • 200: Success

  • 400: Bad parameters

  • 401: Unauthenticated

  • 404: Not found

  • 500: Internal server error. Please see resMessage

https://api.vixco.net/v1
https://test1-api.vixco.net/v1

Check if it has been accumulated

get
Authorizations
Path parameters
namestringRequired

Token name

rewardIdstringRequired

Reward ID

Responses
200
Return successfully
application/json
get
GET /v1/points/{name}/{rewardId}/status HTTP/1.1
Host: test1-api.vixco.net
Authorization: Bearer JWT
Accept: */*
200

Return successfully

{
  "userAddress": "text",
  "accumulated": true,
  "tokenSymbol": "text",
  "contractAddress": "text"
}
  • Endpoint
  • Authentication
  • API References
  • Issue
  • POSTPoints are issued
  • Accumulate
  • POSTThe issued points are accumulated to the user wallet address
  • Status
  • GETCheck if it has been accumulated
  • Cancel
  • POSTCancel the issued points
  • Error Codes (resCode)

Points are issued

post
Authorizations
Path parameters
namestringRequired

Token name

Body
tokenAmountstringOptional

Token amount

tidstringOptional

Store TID

Responses
200
Points issued successfully
application/json
post
POST /v1/points/{name}/issue HTTP/1.1
Host: test1-api.vixco.net
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 35

{
  "tokenAmount": "text",
  "tid": "text"
}
200

Points issued successfully

{
  "rewardId": "text",
  "tokenSymbol": "text",
  "tokenAmount": "text",
  "contractAddress": "text",
  "rewardDate": "text"
}

The issued points are accumulated to the user wallet address

post
Authorizations
Path parameters
namestringRequired

Token name

rewardIdstringRequired

Reward ID

Body
tokenAmountstringOptional

Token amount

userAddressstringOptional

User wallet address to accumulate

Responses
200
Points are accumulated successfully
application/json
post
POST /v1/points/{name}/{rewardId}/accumulate HTTP/1.1
Host: test1-api.vixco.net
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 43

{
  "tokenAmount": "text",
  "userAddress": "text"
}
200

Points are accumulated successfully

{
  "userAddress": "text",
  "tokenSymbol": "text",
  "tokenAmount": "text",
  "contractAddress": "text"
}

Cancel the issued points

post
Authorizations
Path parameters
namestringRequired

Token name

rewardIdstringRequired

Reward ID

Body
tokenAmountstringOptional

Token amount

Responses
200
Canceled successfully
application/json
post
POST /v1/points/{name}/{rewardId}/cancel HTTP/1.1
Host: test1-api.vixco.net
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 22

{
  "tokenAmount": "text"
}
200

Canceled successfully

{
  "userAddress": "text",
  "tokenSymbol": "text",
  "tokenAmount": "text",
  "contractAddress": "text"
}