Balance Accounts

Create a new account

post

Endpoint to create a new account using a Stripe customer ID. Verifies the existence of the customer ID in Stripe before account creation.

Authorizations
Body
stripe_customer_idstringOptionalExample: cus_HKJ432LKJ12
initial_balancenumber · floatOptional
Responses
201

Account created successfully

application/json
post
POST /v1/account/create HTTP/1.1
Host: api.example.com
api_key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 60

{
  "stripe_customer_id": "cus_HKJ432LKJ12",
  "initial_balance": 0
}
{
  "id": "account123",
  "stripe_customer_id": "cus_HKJ432LKJ12",
  "balance": 100,
  "recharge_settings": {
    "autorecharge_enabled": true,
    "autorecharge_threshold": 1,
    "autorecharge_amount": 1
  }
}

Get account details

get

Endpoint to retrieve account details.

Authorizations
Path parameters
idstringRequired

Account ID

Responses
200

Account details retrieved successfully

application/json
get
GET /v1/account/{id} HTTP/1.1
Host: api.example.com
api_key: YOUR_API_KEY
Accept: */*
{
  "id": "account123",
  "stripe_customer_id": "cus_HKJ432LKJ12",
  "balance": 100,
  "recharge_settings": {
    "autorecharge_enabled": true,
    "autorecharge_threshold": 1,
    "autorecharge_amount": 1
  }
}

Delete an account

delete

Endpoint to delete an account. An account can't be deleted if it still has funds.

Authorizations
Path parameters
idstringRequired

Account ID

Responses
204

Account deleted successfully

No content

delete
DELETE /v1/account/{id} HTTP/1.1
Host: api.example.com
api_key: YOUR_API_KEY
Accept: */*

No content

Last updated