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
api_keystringRequired
Body
stripe_customer_idstringOptionalExample: cus_HKJ432LKJ12
initial_balancenumber · floatOptional
Responses
201

Account created successfully

application/json
post
/account/create
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
api_keystringRequired
Path parameters
idstringRequired

Account ID

Responses
get
/account/{id}
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
api_keystringRequired
Path parameters
idstringRequired

Account ID

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

No content

Last updated