Skip to main content
POST
/
wallets
/
{id}
/
top-up
Top up wallet
curl --request POST \
  --url https://api.cloud.flexprice.io/v1/wallets/{id}/top-up \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "amount": 123,
  "credits_to_add": 123,
  "description": "<string>",
  "expiry_date_utc": "<string>",
  "idempotency_key": "<string>",
  "metadata": {},
  "priority": 123,
  "transaction_reason": "INVOICE_PAYMENT"
}'
{
  "invoice_id": "<string>",
  "wallet": {
    "alert_config": {
      "threshold": {
        "type": "amount",
        "value": 123
      }
    },
    "alert_enabled": true,
    "alert_state": "<string>",
    "auto_topup_amount": 123,
    "auto_topup_min_balance": 123,
    "auto_topup_trigger": "disabled",
    "balance": 123,
    "config": {
      "allowed_price_types": [
        "ALL"
      ]
    },
    "conversion_rate": 123,
    "created_at": "<string>",
    "credit_balance": 123,
    "currency": "<string>",
    "customer_id": "<string>",
    "description": "<string>",
    "id": "<string>",
    "metadata": {},
    "name": "<string>",
    "updated_at": "<string>",
    "wallet_status": "active",
    "wallet_type": "PROMOTIONAL"
  },
  "wallet_transaction": {
    "amount": 123,
    "created_at": "<string>",
    "credit_amount": 123,
    "credit_balance_after": 123,
    "credit_balance_before": 123,
    "credits_available": 123,
    "description": "<string>",
    "expiry_date": "<string>",
    "id": "<string>",
    "metadata": {},
    "priority": 123,
    "reference_id": "<string>",
    "reference_type": "PAYMENT",
    "transaction_reason": "INVOICE_PAYMENT",
    "transaction_status": "pending",
    "type": "<string>",
    "updated_at": "<string>",
    "wallet_id": "<string>"
  }
}

Authorizations

x-api-key
string
header
required

Enter your API key in the format x-api-key <api-key>*

Path Parameters

id
string
required

Wallet ID

Body

application/json

Top up request

transaction_reason
enum<string>
required
Available options:
INVOICE_PAYMENT,
FREE_CREDIT_GRANT,
SUBSCRIPTION_CREDIT_GRANT,
PURCHASED_CREDIT_INVOICED,
PURCHASED_CREDIT_DIRECT,
CREDIT_NOTE,
CREDIT_EXPIRED,
WALLET_TERMINATION,
MANUAL_BALANCE_DEBIT
amount
number

amount is the amount in the currency of the wallet to be added NOTE: this is not the number of credits to add, but the amount in the currency amount = credits_to_add * conversion_rate if both amount and credits_to_add are provided, amount will be ignored ex if the wallet has a conversion_rate of 2 then adding an amount of 10 USD in the wallet wil add 5 credits in the wallet

credits_to_add
number

credits_to_add is the number of credits to add to the wallet

description
string

description to add any specific details about the transaction

expiry_date_utc
string

expiry_date_utc is the expiry date in UTC timezone ex 2025-01-01 00:00:00 UTC

idempotency_key
string

idempotency_key is a unique key for the transaction

metadata
object
priority
integer

priority is the priority of the transaction lower number means higher priority default is nil which means no priority at all

Response

OK

invoice_id
string

Invoice ID if an invoice was created (only for PURCHASED_CREDIT_INVOICED)

wallet
object
wallet_transaction
object