Skip to content
Download OpenAPI description
Overview
Languages
Servers
Mock server

https://docs.pers.ninja/_mock/swagger/

https://api.pers.ninja/v2/

Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations

Add token unit to redemption (Admin)

Request

Add a new token unit to an existing redemption. Replaces POST /redemption/admin/{id}/token-units

Security
tenantAdminJWT
Path
idstringrequired
Bodyapplication/jsonrequired
tokenIdstringrequired

Token id

tokenMetadataIncrementalIdnumber

token metadata incremental id for the token unit, this is used to identify the specific token metadata that should be minted

amountnumberrequired

Token unit amount is the amount of tokens that the user will receive when aquiring the token unit

maxAmountnumber

Token unit max amount, this is the maximum amount of tokens that the user can receive when aquiring the token unit. This is relevant e.g. in campaigns where a user may receive token units per revenue spent etc

curl -i -X POST \
  'https://docs.pers.ninja/_mock/swagger/redemption-tokens/{id}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "tokenId": "string",
    "tokenMetadataIncrementalId": 0,
    "amount": 0,
    "maxAmount": 0
  }'

Responses

Token unit added to redemption

Bodyapplication/json
idstringrequired

Redemption id

descriptionstring or nullrequired

Description of the redemption

namestring or nullrequired

Name of the redemption

imageUrlstring or nullrequired

Image url of the redemption

isActivebooleanrequired

Redemptio is active

creditTokenAmountnumberrequired

The amount of credit tokens needed to redeem the redemption tokens

typeobject or nullrequired
type.​namestringrequired

Redemption type name

type.​descriptionstring

Redemption type description

type.​imageUrlstring

Redemption type image url

type.​idnumberrequired

Redemption type id

tokenUnitsArray of objects(TokenUnitDTO)required

The redemption tokens to be redeemed

tokenUnits[].​idstringrequired

Token unit id

tokenUnits[].​tokenobjectrequired
tokenUnits[].​token.​idstringrequired

Id of the token

tokenUnits[].​token.​contractAddressstringrequired

Address of the token

tokenUnits[].​token.​metadataArray of objects(TokenMetadataDTO)

Metadata of the token, this is optional and can be null in case of Point token

tokenUnits[].​token.​abiobjectrequired

this is the abi of the contract, this is the interface of the contract to interact with it

tokenUnits[].​token.​chainIdnumberrequired

this is the chain id of the chain where the token is deployed

tokenUnits[].​token.​abiUrlobjectrequired

this is the url of the abi of the contract, to be used to fetch the abi of the contract

tokenUnits[].​token.​namestring

this is the name of the token contract

tokenUnits[].​token.​symbolstring

this is the symbol of the token contract, this is optional and can be null

tokenUnits[].​token.​decimalsnumber

this is the decimals of the token. This is optional and only used for ERC20 tokens (Points)

tokenUnits[].​token.​isActivebooleanrequired

This can be used to enable or disable the token

tokenUnits[].​token.​isGallerybooleanrequired

This can be used to enable or disable the token for gallery

tokenUnits[].​token.​typestringrequired

This is the underlying web3 native type of the token contract

Enum"ERC20""ERC1155""ERC721"
tokenUnits[].​tokenMetadataIncrementalIdnumber or null

token metadata incremental id for the token unit, this is used to identify the specific token metadata that should be minted

tokenUnits[].​amountnumberrequired

Token unit amount is the amount of tokens that the user will receive when aquiring the token unit

tokenUnits[].​maxAmountnumber or null

Token unit max amount, this is the maximum amount of tokens that the user can receive when aquiring the token unit. This is relevant e.g. in campaigns where a user may receive token units per revenue spent etc

ordernumber or nullrequired

The order of the redemption

supplyobject or null
maxPerUserobjectrequired

The maximum redemption per user

minUserStatusTypeobject or nullrequired
minUserStatusType.​namestringrequired

User Status Type name

minUserStatusType.​descriptionstring

User Status Type description

minUserStatusType.​minTokenBalancenumberrequired

User Status Type eligible Token Addresses

minUserStatusType.​discountPercentagenumberrequired

User Status Type discount Rate in percentage

minUserStatusType.​imageUrlstring

User Status Type image Url

minUserStatusType.​idnumberrequired

User Status Type id

minUserStatusType.​eligibleTokenAddressesArray of stringsrequired

User Status Type eligible Token Addresses

countryCodeRestrictionsobject

Country code restrictions as an array of strings (e.g., ["NOT_ES", "FR"])

Example: ["NOT_ES","FR"]
tagsArray of stringsrequired

Redemption tags

Default []
Response
application/json
{ "id": "string", "description": "string", "name": "string", "imageUrl": "string", "isActive": true, "creditTokenAmount": 0, "type": { "name": "string", "description": "string", "imageUrl": "string", "id": 0 }, "tokenUnits": [ {} ], "order": 0, "supply": { "available": 0, "total": 0 }, "maxPerUser": {}, "minUserStatusType": { "name": "string", "description": "string", "minTokenBalance": 0, "discountPercentage": 0, "imageUrl": "string", "id": 0, "eligibleTokenAddresses": [] }, "countryCodeRestrictions": [ "NOT_ES", "FR" ], "tags": [] }

Update redemption token unit (Admin)

Request

Update an existing token unit within a redemption. Replaces PUT /redemption/admin/{id}/token-units/{tokenUnitId}

Security
tenantAdminJWT
Path
idstringrequired
tokenUnitIdstringrequired
Bodyapplication/jsonrequired
tokenIdstringrequired

Token id

tokenMetadataIncrementalIdnumber

token metadata incremental id for the token unit, this is used to identify the specific token metadata that should be minted

amountnumberrequired

Token unit amount is the amount of tokens that the user will receive when aquiring the token unit

maxAmountnumber

Token unit max amount, this is the maximum amount of tokens that the user can receive when aquiring the token unit. This is relevant e.g. in campaigns where a user may receive token units per revenue spent etc

curl -i -X PUT \
  'https://docs.pers.ninja/_mock/swagger/redemption-tokens/{id}/{tokenUnitId}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "tokenId": "string",
    "tokenMetadataIncrementalId": 0,
    "amount": 0,
    "maxAmount": 0
  }'

Responses

Token unit updated successfully

Bodyapplication/json
idstringrequired

Redemption id

descriptionstring or nullrequired

Description of the redemption

namestring or nullrequired

Name of the redemption

imageUrlstring or nullrequired

Image url of the redemption

isActivebooleanrequired

Redemptio is active

creditTokenAmountnumberrequired

The amount of credit tokens needed to redeem the redemption tokens

typeobject or nullrequired
type.​namestringrequired

Redemption type name

type.​descriptionstring

Redemption type description

type.​imageUrlstring

Redemption type image url

type.​idnumberrequired

Redemption type id

tokenUnitsArray of objects(TokenUnitDTO)required

The redemption tokens to be redeemed

tokenUnits[].​idstringrequired

Token unit id

tokenUnits[].​tokenobjectrequired
tokenUnits[].​token.​idstringrequired

Id of the token

tokenUnits[].​token.​contractAddressstringrequired

Address of the token

tokenUnits[].​token.​metadataArray of objects(TokenMetadataDTO)

Metadata of the token, this is optional and can be null in case of Point token

tokenUnits[].​token.​abiobjectrequired

this is the abi of the contract, this is the interface of the contract to interact with it

tokenUnits[].​token.​chainIdnumberrequired

this is the chain id of the chain where the token is deployed

tokenUnits[].​token.​abiUrlobjectrequired

this is the url of the abi of the contract, to be used to fetch the abi of the contract

tokenUnits[].​token.​namestring

this is the name of the token contract

tokenUnits[].​token.​symbolstring

this is the symbol of the token contract, this is optional and can be null

tokenUnits[].​token.​decimalsnumber

this is the decimals of the token. This is optional and only used for ERC20 tokens (Points)

tokenUnits[].​token.​isActivebooleanrequired

This can be used to enable or disable the token

tokenUnits[].​token.​isGallerybooleanrequired

This can be used to enable or disable the token for gallery

tokenUnits[].​token.​typestringrequired

This is the underlying web3 native type of the token contract

Enum"ERC20""ERC1155""ERC721"
tokenUnits[].​tokenMetadataIncrementalIdnumber or null

token metadata incremental id for the token unit, this is used to identify the specific token metadata that should be minted

tokenUnits[].​amountnumberrequired

Token unit amount is the amount of tokens that the user will receive when aquiring the token unit

tokenUnits[].​maxAmountnumber or null

Token unit max amount, this is the maximum amount of tokens that the user can receive when aquiring the token unit. This is relevant e.g. in campaigns where a user may receive token units per revenue spent etc

ordernumber or nullrequired

The order of the redemption

supplyobject or null
maxPerUserobjectrequired

The maximum redemption per user

minUserStatusTypeobject or nullrequired
minUserStatusType.​namestringrequired

User Status Type name

minUserStatusType.​descriptionstring

User Status Type description

minUserStatusType.​minTokenBalancenumberrequired

User Status Type eligible Token Addresses

minUserStatusType.​discountPercentagenumberrequired

User Status Type discount Rate in percentage

minUserStatusType.​imageUrlstring

User Status Type image Url

minUserStatusType.​idnumberrequired

User Status Type id

minUserStatusType.​eligibleTokenAddressesArray of stringsrequired

User Status Type eligible Token Addresses

countryCodeRestrictionsobject

Country code restrictions as an array of strings (e.g., ["NOT_ES", "FR"])

Example: ["NOT_ES","FR"]
tagsArray of stringsrequired

Redemption tags

Default []
Response
application/json
{ "id": "string", "description": "string", "name": "string", "imageUrl": "string", "isActive": true, "creditTokenAmount": 0, "type": { "name": "string", "description": "string", "imageUrl": "string", "id": 0 }, "tokenUnits": [ {} ], "order": 0, "supply": { "available": 0, "total": 0 }, "maxPerUser": {}, "minUserStatusType": { "name": "string", "description": "string", "minTokenBalance": 0, "discountPercentage": 0, "imageUrl": "string", "id": 0, "eligibleTokenAddresses": [] }, "countryCodeRestrictions": [ "NOT_ES", "FR" ], "tags": [] }

Remove token unit from redemption (Admin)

Request

Remove an existing token unit from a redemption. Replaces DELETE /redemption/admin/{id}/token-units/{tokenUnitId}

Security
tenantAdminJWT
Path
idstringrequired
tokenUnitIdstringrequired
curl -i -X DELETE \
  'https://docs.pers.ninja/_mock/swagger/redemption-tokens/{id}/{tokenUnitId}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Token unit removed from redemption

Bodyapplication/json
idstringrequired

Redemption id

descriptionstring or nullrequired

Description of the redemption

namestring or nullrequired

Name of the redemption

imageUrlstring or nullrequired

Image url of the redemption

isActivebooleanrequired

Redemptio is active

creditTokenAmountnumberrequired

The amount of credit tokens needed to redeem the redemption tokens

typeobject or nullrequired
type.​namestringrequired

Redemption type name

type.​descriptionstring

Redemption type description

type.​imageUrlstring

Redemption type image url

type.​idnumberrequired

Redemption type id

tokenUnitsArray of objects(TokenUnitDTO)required

The redemption tokens to be redeemed

tokenUnits[].​idstringrequired

Token unit id

tokenUnits[].​tokenobjectrequired
tokenUnits[].​token.​idstringrequired

Id of the token

tokenUnits[].​token.​contractAddressstringrequired

Address of the token

tokenUnits[].​token.​metadataArray of objects(TokenMetadataDTO)

Metadata of the token, this is optional and can be null in case of Point token

tokenUnits[].​token.​abiobjectrequired

this is the abi of the contract, this is the interface of the contract to interact with it

tokenUnits[].​token.​chainIdnumberrequired

this is the chain id of the chain where the token is deployed

tokenUnits[].​token.​abiUrlobjectrequired

this is the url of the abi of the contract, to be used to fetch the abi of the contract

tokenUnits[].​token.​namestring

this is the name of the token contract

tokenUnits[].​token.​symbolstring

this is the symbol of the token contract, this is optional and can be null

tokenUnits[].​token.​decimalsnumber

this is the decimals of the token. This is optional and only used for ERC20 tokens (Points)

tokenUnits[].​token.​isActivebooleanrequired

This can be used to enable or disable the token

tokenUnits[].​token.​isGallerybooleanrequired

This can be used to enable or disable the token for gallery

tokenUnits[].​token.​typestringrequired

This is the underlying web3 native type of the token contract

Enum"ERC20""ERC1155""ERC721"
tokenUnits[].​tokenMetadataIncrementalIdnumber or null

token metadata incremental id for the token unit, this is used to identify the specific token metadata that should be minted

tokenUnits[].​amountnumberrequired

Token unit amount is the amount of tokens that the user will receive when aquiring the token unit

tokenUnits[].​maxAmountnumber or null

Token unit max amount, this is the maximum amount of tokens that the user can receive when aquiring the token unit. This is relevant e.g. in campaigns where a user may receive token units per revenue spent etc

ordernumber or nullrequired

The order of the redemption

supplyobject or null
maxPerUserobjectrequired

The maximum redemption per user

minUserStatusTypeobject or nullrequired
minUserStatusType.​namestringrequired

User Status Type name

minUserStatusType.​descriptionstring

User Status Type description

minUserStatusType.​minTokenBalancenumberrequired

User Status Type eligible Token Addresses

minUserStatusType.​discountPercentagenumberrequired

User Status Type discount Rate in percentage

minUserStatusType.​imageUrlstring

User Status Type image Url

minUserStatusType.​idnumberrequired

User Status Type id

minUserStatusType.​eligibleTokenAddressesArray of stringsrequired

User Status Type eligible Token Addresses

countryCodeRestrictionsobject

Country code restrictions as an array of strings (e.g., ["NOT_ES", "FR"])

Example: ["NOT_ES","FR"]
tagsArray of stringsrequired

Redemption tags

Default []
Response
application/json
{ "id": "string", "description": "string", "name": "string", "imageUrl": "string", "isActive": true, "creditTokenAmount": 0, "type": { "name": "string", "description": "string", "imageUrl": "string", "id": 0 }, "tokenUnits": [ {} ], "order": 0, "supply": { "available": 0, "total": 0 }, "maxPerUser": {}, "minUserStatusType": { "name": "string", "description": "string", "minTokenBalance": 0, "discountPercentage": 0, "imageUrl": "string", "id": 0, "eligibleTokenAddresses": [] }, "countryCodeRestrictions": [ "NOT_ES", "FR" ], "tags": [] }