# Smart Contracts

#### Issue

Mint a token with given specifications (can be both token or NFT). Only users having a manager or admin role can access this endpoint.

```
curl --location --request POST 'https://api.enterprise.relysia.com/api/v1/issue' \
--header 'authToken: authToken' \
--header 'serviceid: serviceid' \
--header 'reminting: false' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Store Bonus Points",
  "protocolId": "STAS",
  "symbol": "SBP",
  "description": "A supermarket bonus point.",
  "image": "https://upload.wikimedia.org/wikipedia/en/9/95/Test_image.jpg",
  "tokenSupply": 3,
  "decimals": 0,
  "satsPerToken": 1500,
  "properties": {
    "legal": {
      "terms": "Your token terms and description.",
      "licenceId": "T3ST-2"
    },
    "issuer": {
      "organisation": "Vaionex Corp.",
      "legalForm": "Limited",
      "governingLaw": "US",
      "issuerCountry": "US",
      "jurisdiction": "US",
      "email": "info@vaionex.com"
    },
    "meta": {
      "schemaId": "NFT1.0/MA",
      "website": "vaionex.com",
      "legal": {
        "terms": "© 2020 TAAL TECHNOLOGIES SEZC\nALL RIGHTS RESERVED. ANY USE OF THIS SOFTWARE IS SUBJECT TO TERMS AND CONDITIONS OF LICENSE. USE OF THIS SOFTWARE WITHOUT LICENSE CONSTITUTES INFRINGEMENT OF INTELLECTUAL PROPERTY. FOR LICENSE DETAILS OF THE SOFTWARE, PLEASE REFER TO: www.taal.com/stas-token-license-agreement"
      },
      "media": [
        {
          "URI": "string",
          "type": "string",
          "altURI": "string"
        }
      ]
    }
  },
  "splitable": true
}'
```

#### Redeem

The Redeem Token Endpoint allows users to redeem their tokens and dissolve the underlying smart contract in exchange for satoshis. Only users having a manager or admin roles can access this endpoint.

The request body is a JSON object that contains an array of data items, each representing a single redemption request. Each data item in the array should contain the following properties:

* "amount": The amount of tokens to be redeemed, represented as a positive integer.
* "tokenId": The identifier of the token to be redeemed, represented as a string.
* "sn": The serial number of the token to be redeemed, represented as a positive integer.

<pre><code>curl --location --request POST 'https://api.enterprise.relysia.com/api/v1/redeem' \
<strong>--header 'authToken: authToken' \
</strong>--header 'serviceid: serviceid' \
--header 'Content-Type: application/json' \
--data-raw '
{
  "dataArray": [
    {
      "amount": 1,
      "tokenId": "tokenId",
      "sn": 0
    }
  ]
}'
</code></pre>

#### Get token details

The Token Details API is a GET request endpoint that returns detailed information about a specific token. This API can be accessed by all authorized users.

The API endpoint is a URL that consists of the base URL followed by the token Id in the format ':id'.

```
curl --location --request GET 'https://api.enterprise.relysia.com/api/v1/token:id' \
--header 'authToken: authToken' \
--header 'serviceid: serviceid' \
--header 'Content-Type: application/json' \
```


---

# 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.relysia.com/enterprise-wallet/smart-contracts.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.
