Redeem a code for a character (user panel)
const url = 'https://your-tenant.api.l2nx.app/gameservers/v1/integration/promo/redeem';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"characterId":1,"code":"example","serverId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","userId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-tenant.api.l2nx.app/gameservers/v1/integration/promo/redeem \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "characterId": 1, "code": "example", "serverId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "userId": "example" }'Activates a promo code for the given character on behalf of the user panel.
Authenticate with your tenant API key as Authorization: Bearer nx_api_....
HTTP 200 is returned for any business outcome — read outcome
(SUCCESS / INVALID_CODE / ALREADY_REDEEMED / GROUP_ALREADY_USED /
CHARACTER_NOT_FOUND).
HTTP 503 means no reward was delivered and the code was not spent — retry after
Retry-After seconds.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "characterId": 1, "code": "example", "serverId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "userId": "example"}Responses
Section titled “Responses”Redeem processed; see outcome
object
object
Bad Request
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Missing / invalid API key
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Key rejected: code is API_KEY_REVOKED, API_KEY_EXPIRED, TENANT_DISABLED, API_KEY_TENANT_MISMATCH or INSUFFICIENT_SCOPE
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Not Found
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Conflict
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Internal Server Error
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Game server offline or refused the reward mail before executing it (code = PROMO_REWARD_NOT_DELIVERED); nothing delivered, code not spent
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}