9 API reference

Complete reference for the Stablix API. Base URL: https://api.stablix.xyz/api/v1

Authentication

API Key (Server-to-Server)

X-API-Key: sk_live_your_secret_key

JWT Token (Dashboard)

Authorization: Bearer your_jwt_token

Public Endpoints

No authentication required. Used for payment pages and buyer protection.


Response Format

All responses follow this structure:

{
  "success": true,
  "data": { ... },
  "message": "Optional message"
}

Error Response

Pagination


Idempotency

For POST requests, include an idempotency key to prevent duplicate operations:


Invoices

One-time payments with escrow protection.

Create Invoice

Creates a draft invoice. Call /activate to generate deposit addresses.

Auth: API Key

Headers:

Request:

Field
Type
Required
Description

amount

number

Payment amount

currencies

string[]

Accepted currencies (default: all)

chains

string[]

Accepted chains (default: all)

customer_email

string

Customer email for notifications

external_id

string

Your internal reference

description

string

Invoice description

buffer_hours

number

Escrow buffer 0-168 (default: 24)

expires_in

number

Seconds until expiry (default: 3600)

redirect_url

string

Redirect after payment

metadata

object

Custom data

Response:


Activate Invoice

Generates deposit addresses. Called automatically when user visits payment page, or manually via API.

Auth: API Key or Public

Response:


Get Invoice

Auth: API Key

Response:


Get Invoice (Public)

For payment pages. Limited fields.

Auth: None

Response:


List Invoices

Auth: API Key

Query Parameters:

Parameter
Type
Description

status

string

Filter by status

external_id

string

Filter by external ID

customer_email

string

Filter by customer email

from

string

Start date (ISO)

to

string

End date (ISO)

page

number

Page number

limit

number

Items per page (max 100)

Response:


Release Invoice

Manually release funds from escrow before buffer period ends.

Auth: API Key

Response:


Refund Invoice

Refund a paid invoice (funds must still be in escrow).

Auth: API Key

Request:

Response:


Cancel Invoice

Cancel a draft or pending invoice.

Auth: API Key

Response:


Get Invoice Stats

Auth: API Key

Query Parameters:

Parameter
Type
Description

from

string

Start date (ISO)

to

string

End date (ISO)

Response:


Plans

Reusable subscription product templates.

Create Plan

Auth: API Key

Request:

Field
Type
Required
Description

name

string

Plan name (max 100)

description

string

Description (max 500)

amount

number

Price per cycle (min 0.01)

interval

string

weekly, monthly, yearly

interval_count

number

Every N intervals (1-12, default: 1)

chains

string[]

Accepted chains

currencies

string[]

Accepted currencies

buffer_hours

number

Escrow buffer 0-168 (default: 24)

trial_days

number

Free trial 0-90 (default: 0)

splits

array

Revenue splits (max 5, max 50% total)

metadata

object

Custom data

Splits Object:

Field
Type
Description

address

string

Recipient wallet

chain

string

Chain for payment

percentage

number

Basis points (100 = 1%)

label

string

Description

Response:


Get Plan

Auth: API Key

Response:


Get Plan (Public)

For subscription pages. Limited fields.

Auth: None

Response:


List Plans

Auth: API Key

Query Parameters:

Parameter
Type
Description

is_active

boolean

Filter by active status

interval

string

Filter by interval

page

number

Page number

limit

number

Items per page (max 100)

Response:


Update Plan

Only certain fields can be updated.

Auth: API Key

Request:

Field
Updatable

name

description

is_active

metadata

amount

interval

chains

currencies

splits

Response:


Archive Plan

Deactivate a plan. Existing subscriptions continue.

Auth: API Key

Response:


Get Plan Stats

Auth: API Key

Response:


Subscriptions

Recurring payment relationships between subscribers and plans.

Subscribe (Public)

Start a subscription from the plan page. Called when user enters email.

Auth: None

Request:

Response:


Create Subscription (Merchant)

Pre-create a subscription for a specific user.

Auth: API Key

Request:

Field
Type
Required
Description

plan_id

string

Plan to subscribe to

subscriber_email

string

Subscriber's email

subscriber_external_id

string

Your internal customer ID

metadata

object

Custom data

Response:


Get Subscription (Public)

For approval pages.

Auth: None

Response:


Confirm Approval

After subscriber approves in wallet.

Auth: None

Request:

Field
Type
Required
Description

chain

string

Selected chain

currency

string

Selected currency

wallet_address

string

Subscriber's wallet

tx_hash

string

Approval transaction hash

approved_amount

number

Total approved allowance

expires_at

string

Approval expiry (ISO)

Response:


Get Subscription

Auth: API Key

Response:


List Subscriptions

Auth: API Key

Query Parameters:

Parameter
Type
Description

status

string

Filter by status

plan_id

string

Filter by plan

chain

string

Filter by approved chain

subscriber_wallet

string

Filter by wallet

subscriber_email

string

Filter by email

subscriber_external_id

string

Filter by external ID

page

number

Page number

limit

number

Items per page

Response:


Pause Subscription

Auth: API Key

Response:


Resume Subscription

Auth: API Key

Response:


Cancel Subscription

Auth: API Key

Request:

Field
Type
Default
Description

at_period_end

boolean

true

Cancel at period end vs immediately

reason

string

Cancellation reason

Response:


List Charges

Auth: API Key

Query Parameters:

Parameter
Type
Description

escrow_status

string

pending, funded, released, refunded

page

number

Page number

limit

number

Items per page

Response:


Refund Charge

Refund a specific charge (must still be in escrow).

Auth: API Key

Request:

Response:


Disputes

Buyer protection and conflict resolution.

Open Dispute (Merchant API)

Auth: API Key

Request:

Field
Type
Required
Description

invoice_id

string

Invoice to dispute

reason

string

Reason code

description

string

Detailed explanation

buyer_email

string

Email for updates

evidence

array

Supporting evidence

Reason Codes:

  • product_not_received

  • product_not_as_described

  • unauthorized_transaction

  • duplicate_charge

  • service_not_rendered

  • other

Response:


Open Dispute (Buyer Dashboard)

Auth: None (wallet verification)

Request:


Get Dispute

Auth: API Key

Response:


Get Dispute (Buyer)

Auth: None (wallet verification)


List Disputes

Auth: API Key

Query Parameters:

Parameter
Type
Description

status

string

Filter by status

invoice_id

string

Filter by invoice

page

number

Page number

limit

number

Items per page


List Buyer Disputes

Auth: None (wallet verification)


Find Buyer Transactions

Look up transactions by wallet for dispute dashboard.

or

Auth: None

Response:


Submit Evidence (Merchant)

Auth: API Key

Content-Type: multipart/form-data

Field
Type
Description

files

file[]

Evidence files (max 5, 10MB each)

description

string

Text explanation

links

string[]

Supporting URLs

Response:


Submit Evidence (Buyer)

Auth: None (wallet verification)

Content-Type: multipart/form-data

Field
Type
Description

wallet_address

string

Buyer's wallet

files

file[]

Evidence files

description

string

Text explanation

links

string[]

Supporting URLs


Accept Dispute

Merchant accepts and agrees to refund.

Auth: API Key

Response:


Webhooks

Event notifications sent to your endpoint.

Events

Invoice Events

Event
Description

invoice.created

Invoice created

invoice.activated

Deposit addresses generated

invoice.paid

Payment received

invoice.released

Funds released to merchant

invoice.refunded

Invoice refunded

invoice.expired

Invoice expired

invoice.cancelled

Invoice cancelled

Plan Events

Event
Description

plan.created

Plan created

plan.updated

Plan updated

plan.archived

Plan archived

Subscription Events

Event
Description

subscription.created

Subscription created

subscription.approved

Subscriber approved spending

subscription.charged

Successful charge

subscription.charge_failed

Charge failed

subscription.charge_released

Charge released

subscription.charge_refunded

Charge refunded

subscription.paused

Subscription paused

subscription.resumed

Subscription resumed

subscription.cancelled

Subscription cancelled

subscription.low_allowance

Allowance below threshold

subscription.approval_expiring

Approval expires soon

Dispute Events

Event
Description

dispute.opened

New dispute

dispute.evidence_submitted

Evidence added

dispute.status_changed

Status changed

dispute.resolved

Dispute resolved

dispute.closed

Dispute closed

Webhook Payload

Webhook Headers

Signature Verification


Error Codes

Code
HTTP
Description

VALIDATION_ERROR

400

Invalid request data

UNAUTHORIZED

401

Invalid or missing auth

FORBIDDEN

403

Insufficient permissions

NOT_FOUND

404

Resource not found

CONFLICT

409

Resource state conflict

RATE_LIMITED

429

Too many requests

INTERNAL_ERROR

500

Server error


Rate Limits

Endpoint Type
Limit

Public

60/minute

API Key

1000/minute

Dashboard

300/minute

Rate limit headers:


Status Values

Invoice Status

Status
Description

draft

Created, no deposit addresses

pending

Activated, awaiting payment

paid

Payment received, in escrow

released

Funds released to merchant

refunded

Refunded to buyer

expired

Payment deadline passed

cancelled

Cancelled by merchant

Subscription Status

Status
Description

pending_approval

Awaiting wallet approval

trialing

In free trial

active

Active and billing

paused

Temporarily paused

past_due

Charge failed, retrying

cancelled

Subscription ended

expired

Approval never completed

Escrow Status

Status
Description

pending

Awaiting payment

funded

Funds in escrow

released

Released to merchant

refunded

Returned to buyer

Dispute Status

Status
Description

open

Newly opened

pending_merchant

Awaiting merchant response

pending_buyer

Awaiting buyer response

under_review

Admin reviewing

resolved

Decision made

closed

Withdrawn/expired

Last updated