Skip to content

Developer Documentation

Programmable Rules

Attach logic to wallets to automate money flows. When a wallet with a rule receives funds, the rule is executed automatically.

List Rules

GET /v1/rules

Retrieve all active rules for a specific wallet.

Query Parameters
  • wallet_id (integer, required): The ID of the wallet to query.
Request Body
{
  "wallet_id": 101
}
Body Parameters
Test Request
Response
{
  "status": "success",
  "data": [
    {
      "rule_id": 1,
      "rule_type": "split",
      "config": {
        "beneficiaries": [
          { "wallet_id": 201, "percentage": 70 },
          { "wallet_id": 202, "percentage": 30 }
        ]
      },
      "status": "active",
      "created_at": "2025-10-26 14:00:00"
    }
  ]
}

Create Rule

POST /v1/rules

Create a new programmable rule and attach it to a wallet.

Request Body
{
  "wallet_id": 101,
  "type": "split",
  "config": {
    "beneficiaries": [
      { "wallet_id": 201, "percentage": 70 },
      { "wallet_id": 202, "percentage": 30 }
    ]
  }
}
Response
{
  "status": "success",
  "rule_id": "2"
}
Body Parameters
  • wallet_id (integer, required): The ID of the wallet to attach the rule to.
  • type (string, required): The type of rule ('split', 'escrow', 'conditional', 'subscription').
  • config (object, required): The configuration object specific to the rule type.
Test Request

Rule Types

Split Rule

Automatically splits incoming funds between multiple beneficiary wallets based on percentages.

Request Body
{
  "wallet_id": 102,
  "type": "split",
  "config": {
    "beneficiaries": [
      { "wallet_id": 201, "percentage": 80 },
      { "wallet_id": 202, "percentage": 20 }
    ]
  }
}

Escrow Rule

Holds incoming funds in an escrow state until they are explicitly released or refunded.

Request Body
{
  "wallet_id": 103,
  "type": "escrow",
  "config": {
    "release_condition": "manual",
    "refund_address": 101
  }
}

Conditional Rule

Blocks or allows transactions based on a defined condition. The example below blocks any transaction if the wallet balance is over 10,000.

Request Body
{
  "wallet_id": 104,
  "type": "conditional",
  "config": {
    "condition": "balance > 10000",
    "action": "block"
  }
}

Subscription Rule

Automatically triggers a recurring payment from the wallet on a defined schedule.

Request Body
{
  "wallet_id": 105,
  "type": "subscription",
  "config": {
    "recipient_wallet_id": 301,
    "amount": "9.99",
    "currency": "USD",
    "interval": "1 month",
    "next_run": "2025-11-01 09:00:00"
  }
}