Rafobase Logo

Redeem balance

Redeem available wallet balance for subscription discount or store credit.

POST
/members/{id}/redeem

Redeem available wallet balance for subscription discount or store credit.

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication. Use your API key as the bearer token.

In: header

Path Parameters

id*string

Member ID

Request Body

application/json

amount?integer

Amount in cents (null = full balance)

type*string

Redemption type

Value in"subscription_discount" | "store_credit"
subscription_id?string

Required for subscription_discount type

Response Body

application/json

application/json

application/json

curl -X POST "https://api-base.rafo.work/api/v1/members/string/redeem" \  -H "Content-Type: application/json" \  -d '{    "amount": 5000,    "type": "subscription_discount",    "subscription_id": "sub_xxxxx"  }'
{
  "data": {
    "id": "red_xxxxx",
    "member_id": "string",
    "amount": 0,
    "type": "subscription_discount",
    "status": "pending",
    "transaction_id": "string",
    "metadata": {
      "subscription_id": "string",
      "coupon_code": "string",
      "expires_at": "2019-08-24T14:15:22Z"
    },
    "created_at": "2019-08-24T14:15:22Z"
  }
}

{
  "error": {
    "code": "insufficient_balance",
    "message": "Insufficient available balance"
  }
}

{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key"
  }
}