Redeem a code
Moth DocsReference
POSThttps://api.runmoth.si/v1
/account/redeemAdds a credit code's dollars to the balance, once per account.
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"
}Body
coderequiredThe 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 sent401authentication_errorNo live wallet session was sent, and a key can't be used here404not_found_errorThe code isn't valid409invalid_request_errorThis account has used the code, or it has been used up410invalid_request_errorThe code has ended or isn't open yet429rate_limit_errorToo many tries, so wait a few minutes