Webhook API
Push transaction data into LAYA Finance in real time from any external service — Maya, GCash, UnionBank, Wise, PayPal, Zapier automations, and more. All requests hit a single base URL and are secured with a per-user bearer token.
Base URL
https://webhook.laya.finance/api/Authentication
All endpoints (except /paypal.php) require a bearer token and a JSON content-type header. Your personal token is available in LAYA Finance under Settings → Integrations.
Bearer Token
A static per-user secret issued from within the LAYA Finance app. Keep it private — treat it like a password.
PayPal Exception
The /paypal.php endpoint does not use a bearer token. It validates requests using PayPal's own webhook signature verification.
Authorization: Bearer <your_token>
Content-Type: application/jsonEndpoints
/transaction.phpIngest a transaction from any external source. Used by Zapier automations, Maya forwarding, GCash email parsing, and direct API integrations.
Request Body
{
"source": "maya", // maya | gcash | unionbank | wise | paypal | marbank_email
"external_id": "TXN-20260314", // unique ID from the source system (deduplication)
"amount": 1500.00,
"currency": "PHP", // ISO 4217 currency code
"type": "expense", // income | expense | transfer
"category": "Food", // any TransactionCategory string
"merchant": "Jollibee",
"notes": "Lunch with team",
"transaction_at": "2026-03-14T12:00:00Z"
}Response
{ "success": true, "id": "uuid-of-created-transaction" }external_id already exists for the same source, the request is accepted (200) but no duplicate record is created./register_token.phpRegister an iOS APNs device token so the server can push remote notifications to the user's device. Called automatically by the LAYA iOS app on launch.
Request Body
{
"token": "abc123def456...", // APNs device token (hex string)
"platform": "ios",
"bundleId": "finance.laya.app"
}Response
{ "success": true, "registered": true }/paypal.phpNo bearer tokenPayPal webhook handler. Requests are authenticated using PayPal's own signature verification — do not include an Authorization header. Register this URL in your PayPal Developer Dashboard.
Supported Events
PAYMENT.SALE.COMPLETEDPAYMENT.CAPTURE.COMPLETEDINVOICING.INVOICE.PAIDMONEY.TRANSFER.COMPLETED
/apple_signin.phpValidate a Sign in with Apple identity token server-side and return a LAYA session. Called by the iOS and macOS apps during the Apple Sign-In flow.
Request Body
{
"identity_token": "eyJraWQiOi...", // JWT from ASAuthorizationAppleIDCredential
"user_identifier": "001234.abc...", // Apple user sub
"full_name": "Juan dela Cruz", // optional, only provided on first sign-in
"email": "[email protected]"
}Response
{
"success": true,
"user_id": "laya-uuid",
"token": "bearer-session-token"
}/health.phpPublicHealth check endpoint. Returns server status, database connectivity, and APNs key availability. No authentication required.
Response
{
"success": true,
"status": "ok",
"db": "connected",
"apns_key": "present",
"timestamp": "2026-03-14T12:00:00Z"
}Zapier Integration
Connect any service to LAYA Finance in minutes using Webhooks by Zapier — no custom code needed. Whenever a Zap fires (e.g. a new Gmail email matching "You sent ₱"), Zapier can POST the transaction directly into LAYA.
Zapier Webhook Configuration
Method: POST
URL: https://webhook.laya.finance/api/transaction.php
Headers:
Authorization: Bearer <your_token>
Content-Type: application/json
Body (map from your trigger fields):
source: "zapier"
external_id: {{trigger.id}}
amount: {{trigger.amount}}
currency: "PHP"
type: "expense"
category: {{trigger.category}}
merchant: {{trigger.merchant}}
notes: {{trigger.notes}}
transaction_at: {{trigger.timestamp}}Example: cURL
A working example posting a single expense transaction:
curl -X POST https://webhook.laya.finance/api/transaction.php \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"source": "gcash",
"external_id": "GCASH-20260314-001",
"amount": 350.00,
"currency": "PHP",
"type": "expense",
"category": "Food",
"merchant": "Mang Inasal",
"notes": "Lunch",
"transaction_at": "2026-03-14T12:30:00Z"
}'Response Format
All endpoints return JSON. Successful responses include "success": true and any relevant data. Errors include "success": false and a human-readable "error" string.
Success (HTTP 200)
{
"success": true,
"id": "uuid",
...
}Error (HTTP 4xx / 5xx)
{
"success": false,
"error": "Missing required field: amount"
}HTTP Status Codes
200OKRequest succeeded (or duplicate was silently ignored).400Bad RequestMissing or invalid fields in the request body.401UnauthorizedMissing, malformed, or invalid bearer token.409ConflictDuplicate external_id (also returns 200 in some endpoints — check the response body).500Server ErrorInternal error — check /health.php and contact support.