# Points (REST)

## Endpoint

> **Real Server :** [**https://api.finenex.net/v1**](https://api.finenex.net/v1)
>
> **Test Server :** [**https://test1-api.finenex.net/v1**](https://test1-api.finenex.net/v1)

## 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

{% openapi src="/files/FfZ24VDpByNXvNRqlNsA" path="/points/{name}/issue" method="post" %}
[points.yaml](https://1515857786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5KMVYVhl4nQjYvpkUrV4%2Fuploads%2FrIAcmVKUoGFBV8mXXXmb%2Fpoints.yaml?alt=media\&token=52b61b24-b370-45bc-93b7-fce96d211329)
{% endopenapi %}

{% hint style="info" %}
If tranNo, amount, and the token name of recently issued points are the same, it is treated as a duplicate issuance and is failed.
{% endhint %}

#### Example

{% tabs %}
{% tab title="Reqeust" %}

```
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"
}'
```

{% endtab %}

{% tab title="Response" %}

```
{
  "rewardId": "6500627A723D0000",
  "tokenSymbol": "NLP",
  "tokenAmount": "10",
  "contractAddress": "0x31a093de11a38d00ec33f112cac623afb1ae9276",
  "rewardDate": "20220510231005+0900"
}
```

{% endtab %}
{% endtabs %}

### Accumulate

{% openapi src="/files/FfZ24VDpByNXvNRqlNsA" path="/points/{name}/{rewardId}/accumulate" method="post" %}
[points.yaml](https://1515857786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5KMVYVhl4nQjYvpkUrV4%2Fuploads%2FrIAcmVKUoGFBV8mXXXmb%2Fpoints.yaml?alt=media\&token=52b61b24-b370-45bc-93b7-fce96d211329)
{% endopenapi %}

#### Example

{% tabs %}
{% tab title="Request" %}

```
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"
}'
```

{% endtab %}

{% tab title="Response" %}

```
{
  "userAddress": "user-address",
  "tokenSymbol": "NLP",
  "tokenAmount": "10.00",
  "contractAddress": "0x31a093de11a38d00ec33f112cac623afb1ae9276"
}
```

{% endtab %}
{% endtabs %}

### Status

{% openapi src="/files/FfZ24VDpByNXvNRqlNsA" path="/points/{name}/{rewardId}/status" method="get" %}
[points.yaml](https://1515857786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5KMVYVhl4nQjYvpkUrV4%2Fuploads%2FrIAcmVKUoGFBV8mXXXmb%2Fpoints.yaml?alt=media\&token=52b61b24-b370-45bc-93b7-fce96d211329)
{% endopenapi %}

#### Example

{% tabs %}
{% tab title="Request" %}

```
curl -X 'GET' \
  '{endpoint}/points/nlp/6500627A723D0000/status' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0MTExQGRzdGEuY29tIiwicm9sZSI6IlJPTEVfU1RPUkUiLCJleHAiOjE2NTIyNzgxNTgsImlhdCI6MTY1MjE5MTc1OH0.MqMd26110LlpuVrY-17so_WJ0icVlom0iqbp_0dVo58'
```

{% endtab %}

{% tab title="Response" %}

```
{
  "userAddress": "user-address",
  "accumulated": true,
  "tokenSymbol": "NLP",
  "contractAddress": "0x31a093de11a38d00ec33f112cac623afb1ae9276"
}
```

{% endtab %}
{% endtabs %}

### Cancel

{% openapi src="/files/FfZ24VDpByNXvNRqlNsA" path="/points/{name}/{rewardId}/cancel" method="post" %}
[points.yaml](https://1515857786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5KMVYVhl4nQjYvpkUrV4%2Fuploads%2FrIAcmVKUoGFBV8mXXXmb%2Fpoints.yaml?alt=media\&token=52b61b24-b370-45bc-93b7-fce96d211329)
{% endopenapi %}

#### Example

{% tabs %}
{% tab title="Request" %}

```
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"
}'
```

{% endtab %}

{% tab title="Response" %}

```
{
  "userAddress": "user-address",
  "tokenSymbol": "NLP",
  "tokenAmount": "10",
  "contractAddress": "0x31a093de11a38d00ec33f112cac623afb1ae9276"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The token amount should be the same as when the points are issued.
{% endhint %}

## Error Codes (resCode)

* 200: Success
* 400: Bad parameters
* 401: Unauthenticated
* 404: Not found
* 500: Internal server error. Please see resMessage


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.finenex.net/application-apis/payment-apis/points-rest.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
