TokenOS
  • Overview
    • Introduction
    • Authentication
    • User & Wallet Identification
    • Errors
    • Versioning
  • Guides
    • How our system works
    • Rewarding your audience
      • In exchange for completing an incentive
      • In exchange for your own points
      • As a credit
  • Wallet API
    • Balances
    • Allocations
  • Management API
    • Token Selection
    • Campaigns
    • Subscriptions
    • Codes
  • Payments API
    • Introduction
    • Payments
    • Deliveries
    • Relayer
Powered by GitBook
On this page
  1. Management API

Codes

PreviousSubscriptionsNextIntroduction

Last updated 2 years ago

Codes are used to credit users with $TOKENs. Each code has two required parameters, a reward amount and total number of times the code can be redeemed.

The code object

This object represents a code. It lets you retrieve information about the code including amount, status, redemptions, and redemptions remaining.

Retrieve code

Redeem code for user

For a more seamless UX, you can instantly credit a user by redeeming a code on their behalf.

Get token code status

get
Authorizations
Path parameters
codeIdstringRequired
Responses
200
Ok
application/json
get
GET /v1/codes/{codeId} HTTP/1.1
Host: localhost:8080
Accept: */*
200

Ok

{
  "status": "ACTIVE",
  "redemptions": 1,
  "reward": 1,
  "number": 1
}
  • The code object
  • Retrieve code
  • GETGet token code status
  • Redeem code for user
  • POSTRedeem a token code for a user

Redeem a token code for a user

post
Authorizations
Body
userany ofRequired
or
or
codeIdstringRequired
Responses
200
Ok
post
POST /v1/codes/redemptions HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: */*
Content-Length: 51

{
  "user": {
    "email": "name@gmail.com"
  },
  "codeId": "text"
}
200

Ok

No content