Fuel API (1.0.0)

Download OpenAPI specification:

API for credit and wallet management.

NodeJS SDK

Offical SDK for NodeJS is available at https://www.npmjs.com/package/@underspark/fuel-node.

Authentication

All API requests require an API Key. Include it in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Getting an API Key

  1. Sign up at https://underspark.dev
  2. Create a new project in the dashboard
  3. Navigate to API Keys and generate a new key

認証 (日本語)

すべてのAPIリクエストにはAPIキーが必要です。Authorizationヘッダーに含めてください:

Authorization: Bearer YOUR_API_KEY

APIキーの取得方法

  1. https://underspark.dev でアカウント登録
  2. ダッシュボードで新しいプロジェクトを作成
  3. APIキーを発行

/v1/wallets/{id}

Authorizations:
BearerAuth
path Parameters
id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9_-]+$
Example: user_123

Responses

Response samples

Content type
application/json
{
  • "buckets": [
    ],
  • "events": [
    ]
}

/v1/wallets/{id}/charge

Authorizations:
BearerAuth
path Parameters
id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9_-]+$
Example: user_123
Request Body schema: application/json
amount
required
number >= 1
reason
required
string
object
property name*
additional property
any
actor
string

Responses

Request samples

Content type
application/json
{
  • "amount": 1,
  • "reason": "string",
  • "metadata": {
    },
  • "actor": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "deducted": 0,
  • "remainingBalance": 0,
  • "details": [
    ]
}

/v1/wallets/{id}/reserve

Authorizations:
BearerAuth
path Parameters
id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9_-]+$
Example: user_123
Request Body schema: application/json
amount
required
number >= 1
reason
required
string
ttl
number
object
property name*
additional property
any
actor
string

Responses

Request samples

Content type
application/json
{
  • "amount": 1,
  • "reason": "string",
  • "ttl": 0,
  • "metadata": {
    },
  • "actor": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "reservationId": "string",
  • "expiresAt": "2019-08-24T14:15:22Z"
}

/v1/wallets/{id}/commit

Authorizations:
BearerAuth
path Parameters
id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9_-]+$
Example: user_123
Request Body schema: application/json
reservationId
required
string
amount
number

Responses

Request samples

Content type
application/json
{
  • "reservationId": "string",
  • "amount": 0
}

Response samples

Content type
application/json
{
  • "success": true,
  • "deducted": 0,
  • "remainingBalance": 0
}

/v1/wallets/{id}/rollback

Authorizations:
BearerAuth
path Parameters
id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9_-]+$
Example: user_123
Request Body schema: application/json
reservationId
required
string

Responses

Request samples

Content type
application/json
{
  • "reservationId": "string"
}

Response samples

Content type
application/json
{
  • "success": true
}

/v1/wallets/{id}/balance

Authorizations:
BearerAuth
path Parameters
id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9_-]+$
Example: user_123

Responses

Response samples

Content type
application/json
{
  • "balance": 1500
}

/v1/wallets/{id}/grant

Authorizations:
BearerAuth
path Parameters
id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9_-]+$
Example: user_123
Request Body schema: application/json
amount
required
number >= 1
reason
required
string
expiresAt
string <date-time>
sourceType
string
object
property name*
additional property
any
actor
string

Responses

Request samples

Content type
application/json
{
  • "amount": 1,
  • "reason": "string",
  • "expiresAt": "2019-08-24T14:15:22Z",
  • "sourceType": "string",
  • "metadata": {
    },
  • "actor": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "bucketId": "string",
  • "granted": 0,
  • "expiresAt": "2019-08-24T14:15:22Z"
}

/v1/wallets/{id}/cleanup

Authorizations:
BearerAuth
path Parameters
id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9_-]+$
Example: user_123

Responses

Response samples

Content type
application/json
{
  • "success": true
}