Skip to main content
POST
/
wallets
/
{id}
/
debit
Debit a wallet
curl --request POST \
  --url https://api.cloud.flexprice.io/v1/wallets/{id}/debit \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "credits": 123,
  "description": "<string>",
  "idempotency_key": "<string>",
  "metadata": {},
  "transaction_reason": "INVOICE_PAYMENT"
}'
{
  "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"
}

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

Debit wallet request

idempotency_key
string
required

idempotency_key is a unique key for the transaction

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
credits
number

credits is the number of credits to debit from the wallet

description
string

description to add any specific details about the transaction

metadata
object

Response

OK

alert_config
object
alert_enabled
boolean
alert_state
string
auto_topup_amount
number
auto_topup_min_balance
number
auto_topup_trigger
enum<string>
Available options:
disabled,
balance_below_threshold
balance
number
config
object
conversion_rate
number
created_at
string
credit_balance
number
currency
string
customer_id
string
description
string
id
string
metadata
object
name
string
updated_at
string
wallet_status
enum<string>
Available options:
active,
frozen,
closed
wallet_type
enum<string>
Available options:
PROMOTIONAL,
PRE_PAID