API reference
Pockets & rules
Sub-balances and split rules.
POST
/v1/pocketsSession or account keyCreate a pocket.
Body
{ "name": "Treasury" }curl
curl -X POST https://dapp.railpay.app/v1/pockets \
-H "Authorization: Bearer $RAILPAY_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "Treasury" }'GET
/v1/pocketsSession or account keyList pockets with balances.
curl
curl https://dapp.railpay.app/v1/pockets \
-H "Authorization: Bearer $RAILPAY_KEY"POST
/v1/pockets/:id/moveSession or account keyMove money in or out of a pocket.
Body
{ "amount": "50", "direction": "in" }curl
curl -X POST https://dapp.railpay.app/v1/pockets/<id>/move \
-H "Authorization: Bearer $RAILPAY_KEY" \
-H "Content-Type: application/json" \
-d '{ "amount": "50", "direction": "in" }'POST
/v1/rulesSession or account keyCreate a split rule.
Body
{ "trigger": "invoice.paid", "action": "split", "pocket_id": "<pocket id>", "percent": 20 }curl
curl -X POST https://dapp.railpay.app/v1/rules \
-H "Authorization: Bearer $RAILPAY_KEY" \
-H "Content-Type: application/json" \
-d '{ "trigger": "invoice.paid", "action": "split", "pocket_id": "<pocket id>", "percent": 20 }'GET
/v1/rulesSession or account keyList rules.
curl
curl https://dapp.railpay.app/v1/rules \
-H "Authorization: Bearer $RAILPAY_KEY"PATCH
/v1/rules/:idSession or account keyEnable or disable a rule.
Body
{ "enabled": false }curl
curl -X PATCH https://dapp.railpay.app/v1/rules/<id> \
-H "Authorization: Bearer $RAILPAY_KEY" \
-H "Content-Type: application/json" \
-d '{ "enabled": false }'DELETE
/v1/rules/:idSession or account keyDelete a rule.
curl
curl -X DELETE https://dapp.railpay.app/v1/rules/<id> \
-H "Authorization: Bearer $RAILPAY_KEY"