moth docs
Reference Redeem a code

Redeem a code

Adds a credit code's dollars to the balance, once per account.

POSThttps://api.runmoth.si/v1/account/redeem

Body

coderequired

The code as given. Case, spaces and dashes don't matter.

GET /account/redeemed lists the codes this account has redeemed, newest first. Credit codes has each refusal's exact message.

Errors

400invalid_request_errorNo code was sent
401authentication_errorNo live wallet session was sent, and a key can't be used here
404not_found_errorThe code isn't valid
409invalid_request_errorThis account has used the code, or it has been used up
410invalid_request_errorThe code has ended or isn't open yet
429rate_limit_errorToo many tries, so wait a few minutes
curl https://api.runmoth.si/v1/account/redeem \
  -H "Authorization: Bearer $MOTH_SESSION" \
  -H "Content-Type: application/json" \
  -d '{ "code": "ABCD-1234" }'
Response
{
  "code": "ABCD1234",
  "credit_usd": "5.000000",
  "balance_usd": "17.418306"
}