Lightning Nodes

API Reference

API Reference

Complete REST API documentation for Comet Platform.

Complete REST API documentation for Comet Platform.

This API reference documents two types of APIs:

  1. Lightning Node API - Direct calls to user-deployed Lightning nodes (LND API)

  2. Backend Services API - Calls to Comet Platform backend services for managing nodes, billing, and users

Lightning Node API

The Lightning Node API allows you to interact directly with your deployed Lightning nodes using the LND (Lightning Network Daemon) REST API.

Base URL

The base URL for Lightning Node API calls is your node's API endpoint. Users receive their node API endpoint after deployment. The endpoint format is:

Example:


Note: Each deployed node has its own unique API endpoint that you own and control.

Authentication

Macaroon Authentication: Lightning Node API endpoints require macaroon authentication via the Grpc-Metadata-macaroon header:

curl -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
     <https: your-node.example.com="" v1="" getinfo=""

Generate Macaroons: Macaroons can be generated and managed through the Comet Platform dashboard or via the Backend Services API (see Macaroon Management in Provisioning Service).

Rate Limits

Rate limits are configured per node and depend on your subscription tier.

Tier

Requests/min

Burst

Free

60

100

Pro

600

1000

Enterprise

6000

10000

Nodes

Get Node Info

GET /v1/getinfo

Get information about the Lightning node.

cURL Example:

curl -X GET \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  <https: your-node.example.com="" v1="" getinfo=""

Response:

{
  "identity_pubkey": "03abc...",
  "alias": "my-node",
  "num_pending_channels": 0,
  "num_active_channels": 15,
  "num_peers": 10,
  "block_height": 800000,
  "block_hash": "0000000000000000000...",
  "synced_to_chain": true,
  "testnet": false
}

Get Balance

GET /v1/balance/blockchain

Get on-chain balance.

cURL Example:

curl -X GET \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  <https: your-node.example.com="" v1="" balance="" blockchain=""

Response:

{
  "total_balance": "5000000",
  "confirmed_balance": "4900000",
  "unconfirmed_balance": "100000"
}

GET /v1/balance/channels

Get channel balance.

cURL Example:

curl -X GET \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  <https: your-node.example.com="" v1="" balance="" channels=""

Response:

{
  "balance": "25000000",
  "pending_open_balance": "1000000"
}

Channels

List Channels

GET /v1/channels

List all channels for the node.

cURL Example:

curl -X GET \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  "<https: your-node.example.com="" v1="" channels?active_only="true">"

Query Parameters:

  • active_only: boolean (optional)

  • inactive_only: boolean (optional)

  • public_only: boolean (optional)

  • private_only: boolean (optional)

Response:

{
  "channels": [
    {
      "active": true,
      "remote_pubkey": "03def...",
      "channel_point": "abc123:0",
      "chan_id": "123456789",
      "capacity": "1000000",
      "local_balance": "500000",
      "remote_balance": "500000",
      "commit_fee": "1000",
      "commit_weight": "600",
      "fee_per_kw": "12500",
      "unsettled_balance": "0",
      "total_satoshis_sent": "100000",
      "total_satoshis_received": "200000",
      "num_updates": "5",
      "pending_htlcs": []
    }
  ]
}

Open Channel

POST /v1/channels

Open a new channel.

cURL Example:

curl -X POST \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "node_pubkey": "03def...",
    "node_pubkey_string": "03def...",
    "local_funding_amount": "1000000",
    "push_sat": "0",
    "sat_per_byte": "10",
    "private": false,
    "min_htlc_msat": "1000",
    "remote_csv_delay": 144,
    "min_confs": 1,
    "spend_unconfirmed": false
  }' \\
  <https: your-node.example.com="" v1="" channels=""

Request:

{
  "node_pubkey": "03def...",
  "node_pubkey_string": "03def...",
  "local_funding_amount": "1000000",
  "push_sat": "0",
  "sat_per_byte": "10",
  "private": false,
  "min_htlc_msat": "1000",
  "remote_csv_delay": 144,
  "min_confs": 1,
  "spend_unconfirmed": false
}

Response:

{
  "funding_txid_bytes": "abc123...",
  "funding_txid_str": "abc123...",
  "output_index": 0
}

Close Channel

POST /v1/channels/{channel_point}/close

Close a channel.

cURL Example:

curl -X POST \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "channel_point": {
      "funding_txid_bytes": "abc123...",
      "funding_txid_str": "abc123...",
      "output_index": 0
    },
    "force": false,
    "target_conf": 6,
    "sat_per_byte": "10",
    "delivery_address": "bc1q..."
  }' \\
  <https: your-node.example.com="" v1="" channels="" abc123:0="" close=""

Request:

{
  "channel_point": {
    "funding_txid_bytes": "abc123...",
    "funding_txid_str": "abc123...",
    "output_index": 0
  },
  "force": false,
  "target_conf": 6,
  "sat_per_byte": "10",
  "delivery_address": "bc1q..."
}

Invoices

Create Invoice

POST /v1/invoices

Create a new invoice.

cURL Example:

curl -X POST \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "memo": "Payment for order #123",
    "value": "50000",
    "value_msat": "50000000",
    "description_hash": null,
    "expiry": "3600",
    "fallback_addr": "",
    "cltv_expiry": 0,
    "private": false
  }' \\
  <https: your-node.example.com="" v1="" invoices=""

Request:

{
  "memo": "Payment for order #123",
  "value": "50000",
  "value_msat": "50000000",
  "description_hash": null,
  "expiry": "3600",
  "fallback_addr": "",
  "cltv_expiry": 0,
  "private": false
}

Response:

{
  "r_hash": "abc123...",
  "payment_request": "lnbc500n1...",
  "add_index": "5",
  "payment_addr": "def456..."
}

List Invoices

GET /v1/invoices

List invoices.

cURL Example:

curl -X GET \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  "<https: your-node.example.com="" v1="" invoices?pending_only="false&num_max_invoices=10">"

Query Parameters:

  • pending_only: boolean (optional)

  • index_offset: uint64 (optional)

  • num_max_invoices: uint64 (optional)

  • reversed: boolean (optional)

Response:

{
  "invoices": [
    {
      "memo": "Payment for order #123",
      "r_preimage": "def456...",
      "r_hash": "abc123...",
      "value": "50000",
      "value_msat": "50000000",
      "settled": true,
      "creation_date": "1704537000",
      "settle_date": "1704537100",
      "payment_request": "lnbc500n1...",
      "add_index": "5",
      "settle_index": "5"
    }
  ],
  "last_index_offset": "5",
  "first_index_offset": "0"
}

Lookup Invoice

GET /v1/invoices/{r_hash_str}

Look up an invoice by payment hash.

cURL Example:

curl -X GET \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  <https: your-node.example.com="" v1="" invoices="" abc123=""

Response:

{
  "memo": "Payment for order #123",
  "r_preimage": "def456...",
  "r_hash": "abc123...",
  "value": "50000",
  "value_msat": "50000000",
  "settled": true,
  "creation_date": "1704537000",
  "settle_date": "1704537100",
  "payment_request": "lnbc500n1...",
  "add_index": "5",
  "settle_index": "5"
}

Payments

Send Payment

POST /v1/channels/transactions

Send a payment.

cURL Example:

curl -X POST \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "payment_request": "lnbc500n1...",
    "amt": "50000",
    "fee_limit": {
      "fixed": "1000"
    },
    "timeout_seconds": 60
  }' \\
  <https: your-node.example.com="" v1="" channels="" transactions=""

Request:

{
  "payment_request": "lnbc500n1...",
  "amt": "50000",
  "fee_limit": {
    "fixed": "1000"
  },
  "timeout_seconds": 60
}

Response:

{
  "payment_error": "",
  "payment_preimage": "def456...",
  "payment_route": {
    "total_time_lock": 800000,
    "total_fees": "100",
    "total_amt": "50100",
    "hops": []
  },
  "payment_hash": "abc123..."
}

List Payments

GET /v1/payments

List payments.

cURL Example:

curl -X GET \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  "<https: your-node.example.com="" v1="" payments?include_incomplete="false&max_payments=10">"

Query Parameters:

  • include_incomplete: boolean (optional)

  • index_offset: uint64 (optional)

  • max_payments: uint64 (optional)

  • reversed: boolean (optional)

Response:

{
  "payments": [
    {
      "payment_hash": "abc123...",
      "payment_preimage": "def456...",
      "value": "50000",
      "value_sat": "50000",
      "value_msat": "50000000",
      "creation_date": "1704537000",
      "fee": "100",
      "fee_sat": "100",
      "fee_msat": "100000",
      "payment_preimage": "def456...",
      "value_sat": "50000",
      "value_msat": "50000000",
      "payment_request": "lnbc500n1...",
      "status": "SUCCEEDED",
      "htlcs": []
    }
  ],
  "first_index_offset": "0",
  "last_index_offset": "5"
}

Peers

List Peers

GET /v1/peers

List connected peers.

cURL Example:

curl -X GET \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  <https: your-node.example.com="" v1="" peers=""

Response:

{
  "peers": [
    {
      "pub_key": "03def...",
      "address": "45.67.89.10:9735",
      "bytes_sent": "1234567",
      "bytes_recv": "7654321",
      "sat_sent": "100000",
      "sat_recv": "200000",
      "inbound": false,
      "ping_time": "50"
    }
  ]
}

Connect Peer

POST /v1/peers

Connect to a peer.

cURL Example:

curl -X POST \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "addr": {
      "pubkey": "03def...",
      "host": "45.67.89.10:9735"
    },
    "perm": false,
    "timeout": "60"
  }' \\
  <https: your-node.example.com="" v1="" peers=""

Request:

{
  "addr": {
    "pubkey": "03def...",
    "host": "45.67.89.10:9735"
  },
  "perm": false,
  "timeout": "60"
}

On-Chain

New Address

POST /v1/newaddress

Generate a new on-chain address.

cURL Example:

curl -X POST \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "type": 1
  }' \\
  <https: your-node.example.com="" v1="" newaddress=""

Request:

{
  "type": 1
}

Response:

{
  "address": "bc1q..."
}

Send Coins

POST /v1/transactions

Send on-chain transaction.

cURL Example:

curl -X POST \\
  -H "Grpc-Metadata-macaroon: <macaroon_hex>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "addr": "bc1q...",
    "amount": "100000",
    "target_conf": 6,
    "sat_per_byte": "10",
    "send_all": false,
    "label": "payment"
  }' \\
  <https: your-node.example.com="" v1="" transactions=""

Request:

{
  "addr": "bc1q...",
  "amount": "100000",
  "target_conf": 6,
  "sat_per_byte": "10",
  "send_all": false,
  "label": "payment"
}

Response:

{
  "txid": "abc123...",
  "tx_bytes": "..."
}

Errors

Error Response:

{
  "error": "insufficient balance",
  "code": 2,
  "message": "Insufficient balance for payment"
}

Error Codes:

  • 1: Cancelled

  • 2: Unknown

  • 3: Invalid argument

  • 4: Deadline exceeded

  • 5: Not found

  • 6: Already exists

  • 7: Permission denied

  • 8: Resource exhausted

  • 9: Failed precondition

  • 10: Aborted

  • 11: Out of range

  • 12: Unimplemented

  • 13: Internal

  • 14: Unavailable

  • 15: Data loss

  • 16: Unauthenticated

Backend Services API

The Backend Services API allows you to manage your nodes, billing, subscriptions, and user account through Comet Platform's backend services.

Base URLs

Each backend service has its own base URL:

  • User Service: https://users.cometplatform.com

  • Billing Service: https://billing.cometplatform.com

  • Provisioning Service: https://provisioning.cometplatform.com

Authentication

Bearer Token (RSA Auth): Most endpoints require Bearer token authentication:

curl -H "Authorization: Bearer <access_token>" \\
     <https: users.cometplatform.com="" user="" me=""

API Key Authentication: Some endpoints support API key authentication via the X-API-Key header:

curl -H "X-API-Key: <api_key>" \\
     <https: provisioning.cometplatform.com="" company="" {company_id}="" nodes=""

User Service

Base URL: https://users.cometplatform.com

User Management

Get Current User

GET /user/me

Get the current authenticated user's information.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: users.cometplatform.com="" user="" me=""

Response:

{
  "email": "user@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "phone": "+1234567890",
  "status": "active",
  "avatar": "https://...",
  "currency": "USD",
  "company": {
    "id": "company_abc123",
    "name": "My Company",
    "country": "US"
  }
}

Update Current User

PATCH /user/me

Update the current user's information.

cURL Example:

curl -X PATCH \\
  -H "Authorization: Bearer <access_token>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "firstName": "John",
    "lastName": "Doe",
    "phone": "+1234567890",
    "avatar": "https://...",
    "currency": "USD"
  }' \\
  <https: users.cometplatform.com="" user="" me=""

Request:

{
  "firstName": "John",
  "lastName": "Doe",
  "phone": "+1234567890",
  "avatar": "https://...",
  "currency": "USD"
}

Response:

{
  "email": "user@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "phone": "+1234567890",
  "status": "active",
  "avatar": "https://...",
  "currency": "USD",
  "company": {
    "id": "company_abc123",
    "name": "My Company",
    "country": "US"
  }
}

Delete Current User

DELETE /user

Soft delete the current user account.

cURL Example:

curl -X DELETE \\
  -H "Authorization: Bearer <access_token>" \\
  <https: users.cometplatform.com="" user=""

Response:

{
  "message": "User deleted successfully"
}

Company Management

Create Company

POST /companies

Create a new company.

cURL Example:

curl -X POST \\
  -H "Authorization: Bearer <access_token>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "name": "My Company",
    "country": "US"
  }' \\
  <https: users.cometplatform.com="" companies=""

Request:

{
  "name": "My Company",
  "country": "US"
}

Response:

{
  "id": "company_abc123",
  "name": "My Company",
  "country": "US"
}

Update Company

PATCH /companies

Update the current user's company.

cURL Example:

curl -X PATCH \\
  -H "Authorization: Bearer <access_token>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "name": "Updated Company Name",
    "country": "CA"
  }' \\
  <https: users.cometplatform.com="" companies=""

Request:

{
  "name": "Updated Company Name",
  "country": "CA"
}

Response:

{
  "id": "company_abc123",
  "name": "Updated Company Name",
  "country": "CA"
}

API Keys

Create API Key

POST /apikeys

Create a new API key.

cURL Example:

curl -X POST \\
  -H "Authorization: Bearer <access_token>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "name": "My API Key",
    "permissions": ["read", "write"]
  }' \\
  <https: users.cometplatform.com="" apikeys=""

Request:

{
  "name": "My API Key",
  "permissions": ["read", "write"]
}

Response:

{
  "id": "apikey_abc123",
  "name": "My API Key",
  "key": "sk_live_abc123...",
  "created_at": "2025-01-06T10:00:00Z"
}

List API Keys

GET /apikeys

List all API keys for the current user.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: users.cometplatform.com="" apikeys=""

Response:

{
  "keys": [
    {
      "id": "apikey_abc123",
      "name": "My API Key",
      "created_at": "2025-01-06T10:00:00Z"
    }
  ]
}

Get API Key

GET /apikeys/{id}

Get a specific API key by ID.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: users.cometplatform.com="" apikeys="" apikey_abc123=""

Response:

{
  "id": "apikey_abc123",
  "name": "My API Key",
  "created_at": "2025-01-06T10:00:00Z"
}

Delete API Key

DELETE /apikeys/{id}

Delete an API key.

cURL Example:

curl -X DELETE \\
  -H "Authorization: Bearer <access_token>" \\
  <https: users.cometplatform.com="" apikeys="" apikey_abc123=""

Response:

{
  "message": "API key deleted successfully"
}

Notifications

Get Notification Settings

GET /notification/settings

Get user notification settings.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: users.cometplatform.com="" notification="" settings=""

Response:

[
  {
    "eventType": "node-status-change",
    "email": true,
    "sms": false,
    "push": true
  }
]

Update Notification Settings

PATCH /notification/settings

Update user notification settings.

cURL Example:

curl -X PATCH \\
  -H "Authorization: Bearer <access_token>" \\
  -H "Content-Type: application/json" \\
  -d '[
    {
      "eventType": "node-status-change",
      "email": true,
      "sms": false,
      "push": true
    }
  ]' \\
  <https: users.cometplatform.com="" notification="" settings=""

Request:

[
  {
    "eventType": "node-status-change",
    "email": true,
    "sms": false,
    "push": true
  }
]

Response:

[
  {
    "eventType": "node-status-change",
    "email": true,
    "sms": false,
    "push": true
  }
]

Provisioning Service

Base URL: https://provisioning.cometplatform.com

Node Management

Create Node

POST /company/{company_id}/nodes

Create a new Lightning node.

cURL Example:

curl -X POST \\
  -H "Authorization: Bearer <access_token>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "name": "my-node",
    "network": "mainnet",
    "region": "us-east",
    "type": "standard",
    "tier": "pro"
  }' \\
  <https: provisioning.cometplatform.com="" company="" company_abc123="" nodes=""

Request:

{
  "name": "my-node",
  "network": "mainnet",
  "region": "us-east",
  "type": "standard",
  "tier": "pro"
}

Response:

{
  "node_id": "node_abc123",
  "status": "creating"
}

List Nodes

GET /company/{company_id}/nodes

List all nodes for a company.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: provisioning.cometplatform.com="" company="" company_abc123="" nodes=""

Response:

[
  {
    "node_name": "my-node",
    "status": "running",
    "node_id": "node_abc123",
    "region": "us-east",
    "type": "standard",
    "tier": "pro",
    "tls_cert": "created",
    "api_endpoint": "node-abc123.example.com:8080",
    "created": "2025-01-06T10:00:00Z",
    "delete_requested_at": null,
    "purge_requested_at": null,
    "network": "mainnet",
    "owner_id": "company_abc123",
    "version": "0.17.0",
    "update_available": false,
    "macaroons": [],
    "command_history": [],
    "settings": {}
  }
]

Get Node

GET /company/{company_id}/nodes/{node_id}

Get details for a specific node.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: provisioning.cometplatform.com="" company="" company_abc123="" nodes="" node_abc123=""

Response:

{
  "node_name": "my-node",
  "status": "running",
  "node_id": "node_abc123",
  "region": "us-east",
  "type": "standard",
  "tier": "pro",
  "tls_cert": "created",
  "api_endpoint": "node-abc123.example.com:8080",
  "created": "2025-01-06T10:00:00Z",
  "delete_requested_at": null,
  "purge_requested_at": null,
  "network": "mainnet",
  "owner_id": "company_abc123",
  "version": "0.17.0",
  "update_available": false,
  "macaroons": [],
  "command_history": [],
  "settings": {}
}

Start Node

POST /company/{company_id}/nodes/{node_id}/start

Start a stopped node.

cURL Example:

curl -X POST \\
  -H "Authorization: Bearer <access_token>" \\
  <https: provisioning.cometplatform.com="" company="" company_abc123="" nodes="" node_abc123="" start=""

Response:

{
  "node_name": "my-node",
  "status": "starting",
  "node_id": "node_abc123",
  "region": "us-east",
  "type": "standard",
  "tier": "pro",
  "tls_cert": "created",
  "api_endpoint": "node-abc123.example.com:8080",
  "created": "2025-01-06T10:00:00Z",
  "delete_requested_at": null,
  "purge_requested_at": null,
  "network": "mainnet",
  "owner_id": "company_abc123",
  "version": "0.17.0",
  "update_available": false,
  "macaroons": [],
  "command_history": [],
  "settings": {}
}

Stop Node

POST /company/{company_id}/nodes/{node_id}/stop

Stop a running node.

cURL Example:

curl -X POST \\
  -H "Authorization: Bearer <access_token>" \\
  <https: provisioning.cometplatform.com="" company="" company_abc123="" nodes="" node_abc123="" stop=""

Response:

{
  "node_name": "my-node",
  "status": "stopping",
  "node_id": "node_abc123",
  "region": "us-east",
  "type": "standard",
  "tier": "pro",
  "tls_cert": "created",
  "api_endpoint": "node-abc123.example.com:8080",
  "created": "2025-01-06T10:00:00Z",
  "delete_requested_at": null,
  "purge_requested_at": null,
  "network": "mainnet",
  "owner_id": "company_abc123",
  "version": "0.17.0",
  "update_available": false,
  "macaroons": [],
  "command_history": [],
  "settings": {}
}

Delete Node

DELETE /company/{company_id}/nodes/{node_id}

Delete a node.

cURL Example:

curl -X DELETE \\
  -H "Authorization: Bearer <access_token>" \\
  <https: provisioning.cometplatform.com="" company="" company_abc123="" nodes="" node_abc123=""

Response:

{
  "node_name": "my-node",
  "status": "deleting",
  "node_id": "node_abc123",
  "region": "us-east",
  "type": "standard",
  "tier": "pro",
  "tls_cert": "created",
  "api_endpoint": "node-abc123.example.com:8080",
  "created": "2025-01-06T10:00:00Z",
  "delete_requested_at": "2025-01-06T11:00:00Z",
  "purge_requested_at": null,
  "network": "mainnet",
  "owner_id": "company_abc123",
  "version": "0.17.0",
  "update_available": false,
  "macaroons": [],
  "command_history": [],
  "settings": {}
}

Macaroon Management

Upload Macaroon

POST /company/{company_id}/nodes/{node_id}/macaroon

Upload an encrypted macaroon for a node.

cURL Example:

curl -X POST \\
  -H "Authorization: Bearer <access_token>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "encrypted_macaroon": "encrypted_data...",
    "permissions": "readonly"
  }' \\
  <https: provisioning.cometplatform.com="" company="" company_abc123="" nodes="" node_abc123="" macaroon=""

Request:

{
  "encrypted_macaroon": "encrypted_data...",
  "permissions": "readonly"
}

Response:

{
  "node_id": "node_abc123",
  "name": "readonly",
  "created": "2025-01-06T10:00:00Z"
}

Get Macaroon

GET /company/{company_id}/nodes/{node_id}/macaroon/{permission}

Get an encrypted macaroon by permission type.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: provisioning.cometplatform.com="" company="" company_abc123="" nodes="" node_abc123="" macaroon="" readonly=""

Response:

{
  "node_id": "node_abc123",
  "permission": "readonly-macaroon",
  "macaroon": "encrypted_data..."
}

Seed Management

Upload Seed

POST /company/{company_id}/nodes/{node_id}/seed

Upload an encrypted seed for a node.

cURL Example:

curl -X POST \\
  -H "Authorization: Bearer <access_token>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "encrypted_seed": "encrypted_data..."
  }' \\
  <https: provisioning.cometplatform.com="" company="" company_abc123="" nodes="" node_abc123="" seed=""

Request:

{
  "encrypted_seed": "encrypted_data..."
}

Response:

{
  "node_id": "node_abc123",
  "seed": "encrypted_data..."
}

Get Seed

GET /company/{company_id}/nodes/{node_id}/seed

Get the encrypted seed for a node.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: provisioning.cometplatform.com="" company="" company_abc123="" nodes="" node_abc123="" seed=""

Response:

{
  "node_id": "node_abc123",
  "seed": "encrypted_data..."
}

Resources

Get Resources

GET /resources

Get available resource configurations.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  "<https: provisioning.cometplatform.com="" resources?type="node&region=us-east&network=mainnet">"

Query Parameters:

  • type: string (required) - Resource type (e.g., "node")

  • region: string (required) - Region (e.g., "us-east")

  • network: string (required) - Network (e.g., "mainnet", "testnet")

Response:

[
  {
    "type": "node",
    "region": "us-east",
    "network": "mainnet",
    "vCpu": 2,
    "memGB": 4,
    "storageSizeGB": 100,
    "credits": 100
  }
]

Billing Service

Base URL: https://billing.cometplatform.com

Billing Account

Get or Create Billing Account

GET /company/{companyId}/billing-account

Get or create a billing account for a company.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: billing.cometplatform.com="" company="" company_abc123="" billing-account=""

Response:

{
  "id": "billing_account_abc123",
  "companyId": "company_abc123",
  "status": "active",
  "address1": "123 Main St",
  "address2": "",
  "city": "New York",
  "state": "NY",
  "zip": "10001",
  "country": "US",
  "taxIdNumber": "",
  "subscriptionId": "subscription_abc123",
  "subscription": {
    "id": "subscription_abc123",
    "name": "Pro Plan",
    "status": "active"
  }
}

Update Billing Account

PATCH /company/{companyId}/billing-account/{billingAccountId}

Update billing account information.

cURL Example:

curl -X PATCH \\
  -H "Authorization: Bearer <access_token>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "address1": "456 Oak Ave",
    "city": "Los Angeles",
    "state": "CA",
    "zip": "90001",
    "country": "US",
    "taxIdNumber": "12-3456789"
  }' \\
  <https: billing.cometplatform.com="" company="" company_abc123="" billing-account="" billing_account_abc123=""

Request:

{
  "address1": "456 Oak Ave",
  "city": "Los Angeles",
  "state": "CA",
  "zip": "90001",
  "country": "US",
  "taxIdNumber": "12-3456789"
}

Subscriptions

Get Available Plans

GET /company/{companyId}/billing-account/{billingAccountId}/subscription/available-plans

Get list of available subscription plans.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: billing.cometplatform.com="" company="" company_abc123="" billing-account="" billing_account_abc123="" subscription="" available-plans=""

Response:

[
  {
    "id": "plan_basic",
    "name": "Basic Plan",
    "description": "Basic features",
    "price": 29.99,
    "credits": 1000,
    "billingFrequency": "monthly",
    "features": ["feature1", "feature2"]
  }
]

Create or Update Subscription

POST /company/{companyId}/billing-account/{billingAccountId}/subscription

Create, upgrade, or downgrade a subscription.

cURL Example:

curl -X POST \\
  -H "Authorization: Bearer <access_token>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "plan": "pro",
    "billingFrequency": "monthly",
    "confirm": false,
    "paymentMethod": "card"
  }' \\
  <https: billing.cometplatform.com="" company="" company_abc123="" billing-account="" billing_account_abc123="" subscription=""

Request:

{
  "plan": "pro",
  "billingFrequency": "monthly",
  "confirm": false,
  "paymentMethod": "card"
}

Response:

{
  "action": "created",
  "subscription": {
    "id": "subscription_abc123",
    "name": "Pro Plan",
    "status": "pending_payment",
    "type": "pro",
    "billingFrequency": "monthly",
    "price": 99.99,
    "credits": 10000
  }
}

Cancel Subscription

POST /company/{companyId}/billing-account/{billingAccountId}/subscription/cancel

Cancel a subscription.

cURL Example:

curl -X POST \\
  -H "Authorization: Bearer <access_token>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "reason": "No longer needed"
  }' \\
  <https: billing.cometplatform.com="" company="" company_abc123="" billing-account="" billing_account_abc123="" subscription="" cancel=""

Request:

{
  "reason": "No longer needed"
}

Response:

{
  "id": "subscription_abc123",
  "name": "Pro Plan",
  "status": "cancelled",
  "cancelReason": "No longer needed",
  "canceledAt": "2025-01-06T11:00:00Z"
}

Reactivate Subscription

POST /company/{companyId}/billing-account/{billingAccountId}/subscription/re-activate

Reactivate a cancelled subscription.

cURL Example:

curl -X POST \\
  -H "Authorization: Bearer <access_token>" \\
  <https: billing.cometplatform.com="" company="" company_abc123="" billing-account="" billing_account_abc123="" subscription="" re-activate=""

Response:

{
  "id": "subscription_abc123",
  "name": "Pro Plan",
  "status": "active",
  "type": "pro",
  "billingFrequency": "monthly",
  "price": 99.99,
  "credits": 10000
}

Invoices

List Invoices

GET /company/{companyId}/billing-account/{billingAccountId}/invoice

Get list of invoices.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: billing.cometplatform.com="" company="" company_abc123="" billing-account="" billing_account_abc123="" invoice=""

Response:

[
  {
    "id": "invoice_abc123",
    "amount": 99.99,
    "currency": "USD",
    "status": "paid",
    "createdAt": "2025-01-06T10:00:00Z",
    "paidAt": "2025-01-06T10:05:00Z"
  }
]

Get Invoice

GET /company/{companyId}/billing-account/{billingAccountId}/invoice/{invoiceId}

Get a specific invoice.

cURL Example:

curl -X GET \\
  -H "Authorization: Bearer <access_token>" \\
  <https: billing.cometplatform.com="" company="" company_abc123="" billing-account="" billing_account_abc123="" invoice="" invoice_abc123=""

Response:

{
  "id": "invoice_abc123",
  "amount": 99.99,
  "currency": "USD",
  "status": "paid",
  "createdAt": "2025-01-06T10:00:00Z",
  "paidAt": "2025-01-06T10:05:00Z",
  "lineItems": [
    {
      "description": "Pro Plan - Monthly",
      "amount": 99.99
    }
  ]
}

Table of Contents

Copyright © 2025 Comet Cash

Czech Republic VASP License Registration Nº 22053751

info@cometcash.com

All rights reserved.

Copyright © 2025 Comet Cash

Czech Republic VASP License Registration Nº 22053751

info@cometcash.com

All rights reserved.