This endpoint allows you to create a Token.
collectionIdrequired stringThe Token Collection that will govern the branding and redemption rules for the token. Currently only Collections of typeproductare supported.
Tokens are assets which can only be spent in full. Every token is associated with a collection, which defines the branding and general rules for the tokens, such as active duration.
Tokens have the following attributes along with the base asset fields.
collectionIdstringThe token collection that will govern the branding and redemption rules for the token.
errorstringThe name of the HTTP status. AlwaysBad Request.messageenumThe error code, or for a 400 a description of what's wrong with the request.Bad RequestThe request is malformed or missing required fields. The message says what's wrong, egamount is required. See 400 Malformed Request.
statusCodeintegerThe HTTP status code. Always400.
errorstringThe name of the HTTP status. AlwaysUnauthorized.messageenumThe error code, or for a 400 a description of what's wrong with the request.Missing authenticationAPI key or JWT is missing, expired or invalid. See Auth.
statusCodeintegerThe HTTP status code. Always401.
errorstringThe name of the HTTP status. AlwaysForbidden.messageenumThe error code, or for a 400 a description of what's wrong with the request.ForbiddenThe resource doesn't exist, or your user or API key doesn't have permission to access it. See 403 Forbidden.LIVENESS_MISMATCHThe account is test and the collection's liveness is main or vice versa.TOKEN_ALREADY_CREATEDToken with supplied parameters already exists.
statusCodeintegerThe HTTP status code. Always403.
errorstringThe name of the HTTP status. AlwaysNot Found.messageenumThe error code, or for a 400 a description of what's wrong with the request.Not FoundThe route doesn't exist. Check the URL and HTTP method against the examples. See 404 Route Not Found.
statusCodeintegerThe HTTP status code. Always404.
errorstringThe name of the HTTP status. AlwaysToo Many Requests.messageenumThe error code, or for a 400 a description of what's wrong with the request.RATE_LIMIT_EXCEEDEDCentrapay API rate limits have been exceeded. See Rate Limits.
statusCodeintegerThe HTTP status code. Always429.
errorstringThe name of the HTTP status. AlwaysInternal Server Error.messageenumThe error code, or for a 400 a description of what's wrong with the request.An internal server error occurredSomething went wrong on our end. Retrying should solve the issue. See 5xx Server Error.
statusCodeintegerThe HTTP status code. Always500.
curl -X POST https://service.centrapay.com/api/tokens \-H 'content-type: application/json' \-H 'x-api-key: <TOKEN>' \-d '{ "collectionId": "c_Jaim1Cu1Q55uooxSens6yk", "externalId": "23403283262", "idempotencyKey": "payment-de32dd90-b46c-11ea-93c3-83a333b86e7b"}'{ "accountId": "WRhAxxWpTKb5U7pXyxQjjP", "activeFrom": "2021-01-17T18:00:23.000Z", "category": "token", "collectionId": "c_Jaim1Cu1Q55uooxSens6yk", "createdAt": "2021-01-17T18:00:23.000Z", "createdBy": "crn:WRhAxxWpTKb5U7pXyxQjjP:api-key:MyAssetIssuerKey", "description": "My Cafe Token", "expiresAt": "2022-01-18T18:00:23.000Z", "externalId": "23403283262", "id": "NqYjGHzkL3s6v9TFbwWcdR", "img": "https://static.centrapay.com/assets/brands/centraperk/cafe-token.png", "issuer": "Centraperk Cafe", "issuerImg": "https://static.centrapay.com/assets/brands/centraperk/logo.png", "issuerWebsite": "www.centraperk-cafe.com", "liveness": "test", "status": "active", "type": "centrapay.token.test"}{ "error": "Bad Request", "message": "amount is required", "statusCode": 400}{ "error": "Unauthorized", "message": "Missing authentication", "statusCode": 401}{ "error": "Forbidden", "message": "TOKEN_ALREADY_CREATED", "statusCode": 403}{ "error": "Not Found", "message": "Not Found", "statusCode": 404}{ "error": "Too Many Requests", "message": "RATE_LIMIT_EXCEEDED", "statusCode": 429}{ "error": "Internal Server Error", "message": "An internal server error occurred", "statusCode": 500}