# Codes

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

{% openapi src="<https://2025772754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKOyoBDhx8ymvd9xgu92d%2Fuploads%2FV9K5lc6vyEJK4GH14sh4%2Fcreator-api.yaml?alt=media&token=9ea3d663-0606-4b83-a29c-d9fd58940b29>" path="/codes/{codeId}" method="get" %}
[creator-api.yaml](https://2025772754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKOyoBDhx8ymvd9xgu92d%2Fuploads%2FV9K5lc6vyEJK4GH14sh4%2Fcreator-api.yaml?alt=media\&token=9ea3d663-0606-4b83-a29c-d9fd58940b29)
{% endopenapi %}

### Redeem code for user

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

{% openapi src="<https://2025772754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKOyoBDhx8ymvd9xgu92d%2Fuploads%2FV9K5lc6vyEJK4GH14sh4%2Fcreator-api.yaml?alt=media&token=9ea3d663-0606-4b83-a29c-d9fd58940b29>" path="/codes/redemptions" method="post" %}
[creator-api.yaml](https://2025772754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKOyoBDhx8ymvd9xgu92d%2Fuploads%2FV9K5lc6vyEJK4GH14sh4%2Fcreator-api.yaml?alt=media\&token=9ea3d663-0606-4b83-a29c-d9fd58940b29)
{% endopenapi %}
