Skip to content

Create campaign token unit

Request

Add a new token unit to campaign for reward distribution. Admin or owning business.

Security
authJWT
Path
campaignIdstringrequired
Bodyapplication/jsonrequired
tokenEntityIdstringrequired

Token entity id

tokenMetadataIncrementalIdnumber

Token metadata template ID. For ERC1155: becomes on-chain tokenId. For ERC721: lookup key for template to generate unique metadata.

amountnumberrequired

Amount of tokens to mint/transfer. For ERC721 this is typically 1, for ERC1155/ERC20 can be any quantity.

maxAmountnumber

Token unit max amount. Applies to MINT/EARN contexts only (e.g. campaign reward capping). Ignored for spend/transfer contexts such as redemption priceTokenUnits.

tokenIdnumberrequireddeprecated

Use Token entity id instead

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

Responses

Campaign token unit created successfully

Bodyapplication/json
idstringrequired

Campaign id

ownerBusinessIdstring or nullrequired

Optional owner business ID. If set, this campaign belongs to a specific business. If null, the campaign is tenant-owned (system-level).

namestring or nullrequired

Campaign name

descriptionstring or nullrequired

Campaign description

beneficiaryAccountAddressstring or nullrequired

Campaign beneficiary account address

startDatestring or null, (date-time)required

Campaign start date, default is the current date

endDatestring or null, (date-time)required

Campaign end date

imageUrlstring or nullrequired

img url

logoUrlstring or nullrequired

Logo URL for the campaign

externalUrlstring or nullrequired

Campaign url

isActivebooleanrequired

Campaign isActive

Default:false
statusstring(AvailabilityStatus)required

Computed availability: inactive (isActive=false), ended, scheduled (not started) or active

Enum:"inactive""scheduled""active""ended"
approvalobject(ApprovalDTO)required

Approval metadata for this campaign.

isTestnetboolean

Campaign isTestnet, this means that the campaign is running on testnet, not mainnet

Default:false
createdAtstring, (date-time)required

create date

Default:null
updatedAtstring or null, (date-time)required

update date

Default:null
ordernumber or nullrequired

Campaign order. Null means unordered (not manually positioned) — sorts last in default ascending order.

Default:null
tagsArray of stringsrequired

Campaign tags

Default:[]
countryCodeRestrictionsobject

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

Example:
[ "NOT_ES", "FR" ]
translationsobject

Per-locale translations of the translatable fields, keyed by locale

localizedFieldsArray of strings

Fields whose value comes from a stored translation for the request locale (x-locale); absent when none do

availableLocalesArray of strings

Locales this entity has stored translations for, independent of the request locale; absent when none

triggerobject or null(CampaignTriggerDTO)required

Campaign trigger: what triggers the campaign, and what are the conditions for the trigger to be activated

tokenUnitsArray of itemsrequired
businessEngagementsArray of itemsrequired
triggerSourceIdsArray of arraysrequired

Trigger source IDs. Use to batch fetch or request via ?include=triggerSources

Example:
[ "trigger-uuid-1", "trigger-uuid-2" ]
includedobject or null

Included related data. Only populated when include parameter is specified.

Response
{ "id": "string", "ownerBusinessId": "string", "name": "string", "description": "string", "beneficiaryAccountAddress": "string", "startDate": "2019-08-24T14:15:22Z", "endDate": "2019-08-24T14:15:22Z", "imageUrl": "string", "logoUrl": "string", "externalUrl": "string", "isActive": false, "status": "inactive", "approval": { "status": "pending_approval", "approvedAt": "2019-08-24T14:15:22Z", "approvedBy": "string", "rejectionReason": "string" }, "isTestnet": false, "createdAt": null, "updatedAt": null, "order": null, "tags": [], "countryCodeRestrictions": [ "NOT_ES", "FR" ], "translations": { "property1": { … }, "property2": { … } }, "localizedFields": [ "string" ], "availableLocales": [ "string" ], "trigger": { "name": 0, "description": "string", "terms": "string", "translations": { … }, "maxPerDayPerUser": 0, "maxPerUser": 0, "minCooldownSeconds": 0, "maxGeoDistanceInMeters": 0, "requiredUserInfo": "string", "triggerType": "CLAIM_BY_USER", "maxMultiplier": 0, "completionThreshold": 0, "maxTotal": 0, "maxPerDayTotal": 0, "maxPerSource": 0, "conditions": [ … ], "sourceLogic": "any", "id": "string" }, "tokenUnits": [ [ … ] ], "businessEngagements": [ [ … ] ], "triggerSourceIds": [ "trigger-uuid-1", "trigger-uuid-2" ], "included": { "claimCount": 0, "triggerSources": [ … ], "businesses": [ … ], "ownerBusiness": { … } } }