Skip to main content
POST
/
wallets
Create a new wallet
curl --request POST \
  --url https://api.cloud.flexprice.io/v1/wallets \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "currency": "<string>",
  "alert_config": {
    "threshold": {
      "type": "<string>",
      "value": "<string>"
    }
  },
  "alert_enabled": true,
  "auto_topup": {
    "amount": 123,
    "enabled": true,
    "invoicing": true,
    "threshold": 123
  },
  "config": {
    "allowed_price_types": [
      "ALL"
    ]
  },
  "conversion_rate": "1",
  "customer_id": "<string>",
  "description": "<string>",
  "external_customer_id": "<string>",
  "initial_credits_expiry_date_utc": "<string>",
  "initial_credits_to_load": "0",
  "initial_credits_to_load_expiry_date": 123,
  "metadata": {},
  "name": "<string>",
  "price_unit": "<string>",
  "topup_conversion_rate": "<string>",
  "wallet_type": "PROMOTIONAL"
}
'
{
  "alert_config": {
    "threshold": {
      "type": "amount",
      "value": 123
    }
  },
  "alert_enabled": true,
  "alert_state": "<string>",
  "auto_topup": {
    "amount": 123,
    "enabled": true,
    "invoicing": true,
    "threshold": 123
  },
  "balance": "<string>",
  "config": {
    "allowed_price_types": [
      "ALL"
    ]
  },
  "conversion_rate": "<string>",
  "created_at": "<string>",
  "created_by": "<string>",
  "credit_balance": "<string>",
  "credits_available_breakdown": {
    "free": "<string>",
    "purchased": "<string>"
  },
  "currency": "<string>",
  "customer_id": "<string>",
  "description": "<string>",
  "environment_id": "<string>",
  "id": "<string>",
  "metadata": {},
  "name": "<string>",
  "status": "published",
  "tenant_id": "<string>",
  "topup_conversion_rate": "<string>",
  "updated_at": "<string>",
  "updated_by": "<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>*

Body

application/json

Create wallet request

currency
string
required
alert_config
object
alert_enabled
boolean

alert_enabled is the flag to enable alerts for the wallet defaults to true, can be explicitly set to false to disable alerts

auto_topup
object
config
object
conversion_rate
string
default:1

amount in the currency = number of credits * conversion_rate ex if conversion_rate is 1, then 1 USD = 1 credit ex if conversion_rate is 2, then 1 USD = 0.5 credits ex if conversion_rate is 0.5, then 1 USD = 2 credits

customer_id
string
description
string
external_customer_id
string

external_customer_id is the customer id in the external system

initial_credits_expiry_date_utc
string

initial_credits_expiry_date_utc is the expiry date in UTC timezone (optional to set nil means no expiry) ex 2025-01-01 00:00:00 UTC

initial_credits_to_load
string
default:0

initial_credits_to_load is the number of credits to load to the wallet if not provided, the wallet will be created with 0 balance NOTE: this is not the amount in the currency, but the number of credits

initial_credits_to_load_expiry_date
integer

initial_credits_to_load_expiry_date YYYYMMDD format in UTC timezone (optional to set nil means no expiry) for ex 20250101 means the credits will expire on 2025-01-01 00:00:00 UTC hence they will be available for use until 2024-12-31 23:59:59 UTC

metadata
object
name
string
price_unit
string

price_unit is the code of the price unit to use for wallet creation If provided, the price unit will be used to set the currency and conversion rate of the wallet:

  • currency: set to price unit's base_currency
  • conversion_rate: set to price unit's conversion_rate
topup_conversion_rate
string

topup_conversion_rate is the conversion rate for the topup to the currency ex if topup_conversion_rate is 1, then 1 USD = 1 credit ex if topup_conversion_rate is 2, then 1 USD = 0.5 credits ex if topup_conversion_rate is 0.5, then 1 USD = 2 credits

wallet_type
enum<string>
Available options:
PROMOTIONAL,
PRE_PAID

Response

OK

alert_config
object
alert_enabled
boolean
alert_state
string
auto_topup
object
balance
string
config
object
conversion_rate
string

amount in the currency = number of credits * conversion_rate ex if conversion_rate is 1, then 1 USD = 1 credit ex if conversion_rate is 2, then 1 USD = 0.5 credits ex if conversion_rate is 0.5, then 1 USD = 2 credits

created_at
string
created_by
string
credit_balance
string
credits_available_breakdown
object
currency
string
customer_id
string
description
string
environment_id
string
id
string
metadata
object
name
string
status
enum<string>
Available options:
published,
deleted,
archived
tenant_id
string
topup_conversion_rate
string

topup_conversion_rate is the conversion rate for the topup to the currency ex if topup_conversion_rate is 1, then 1 USD = 1 credit ex if topup_conversion_rate is 2, then 1 USD = 0.5 credits ex if topup_conversion_rate is 0.5, then 1 USD = 2 credits

updated_at
string
updated_by
string
wallet_status
enum<string>
Available options:
active,
frozen,
closed
wallet_type
enum<string>
Available options:
PROMOTIONAL,
PRE_PAID