Skip to main content
Configure how you receive notifications for payment events. AnySpend supports email and Telegram delivery channels with per-event granularity.
Reading notification settings requires read permission. Updating settings and linking/unlinking Telegram requires admin permission.

Authentication

Authorization: Bearer asp_xxx
Base URL: https://platform-api.anyspend.com/api/v1

Endpoints

Get Notification Settings

GET /notifications
read
Retrieve the current notification configuration for your account.
curl -X GET https://platform-api.anyspend.com/api/v1/notifications \
  -H "Authorization: Bearer asp_xxx"
Response
{
  "success": true,
  "data": {
    "email_enabled": true,
    "email_address": "merchant@example.com",
    "telegram_enabled": true,
    "telegram_chat_id": "123456789",
    "telegram_username": "@merchant",
    "enabled_events": [
      "payment.completed",
      "payment.failed",
      "checkout.completed"
    ],
    "updated_at": "2026-02-20T14:30:00Z"
  }
}

Update Notification Settings

PATCH /notifications
admin
Update notification preferences. All fields are optional — only the provided fields are changed.
email_enabled
boolean
Enable or disable email notifications.
email_address
string
Email address to receive notifications. Must be a valid email format.
telegram_enabled
boolean
Enable or disable Telegram notifications. Telegram must be linked first.
enabled_events
string[]
Array of event types to receive notifications for. Applies to both email and Telegram channels.
curl -X PATCH https://platform-api.anyspend.com/api/v1/notifications \
  -H "Authorization: Bearer asp_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "email_enabled": true,
    "email_address": "payments@mycompany.com",
    "telegram_enabled": true,
    "enabled_events": ["payment.completed", "payment.failed"]
  }'
Response
{
  "success": true,
  "data": {
    "email_enabled": true,
    "email_address": "payments@mycompany.com",
    "telegram_enabled": true,
    "telegram_chat_id": "123456789",
    "telegram_username": "@merchant",
    "enabled_events": ["payment.completed", "payment.failed"],
    "updated_at": "2026-02-27T12:00:00Z"
  }
}

POST /notifications/telegram/link
admin
Generate a Telegram bot link URL. Opening this link starts a conversation with the AnySpend notification bot and links your Telegram account.
curl -X POST https://platform-api.anyspend.com/api/v1/notifications/telegram/link \
  -H "Authorization: Bearer asp_xxx"
Response
{
  "success": true,
  "data": {
    "link_url": "https://t.me/AnySpendBot?start=link_abc123def456",
    "expires_at": "2026-02-27T12:15:00Z"
  }
}
1

Generate link

Call POST /notifications/telegram/link to get a bot link URL.
2

Open in Telegram

Open the link_url in Telegram. Press Start in the bot conversation.
3

Enable notifications

Call PATCH /notifications with telegram_enabled: true.
The link URL expires after 15 minutes. Generate a new one if it expires before being used.

DELETE /notifications/telegram
admin
Disconnect Telegram from your notification settings. Telegram notifications will be automatically disabled.
curl -X DELETE https://platform-api.anyspend.com/api/v1/notifications/telegram \
  -H "Authorization: Bearer asp_xxx"

Send Test Email

POST /notifications/test/email
admin
Send a test notification to your configured email address. Email must be enabled and an address must be set.
curl -X POST https://platform-api.anyspend.com/api/v1/notifications/test/email \
  -H "Authorization: Bearer asp_xxx"
Response
{
  "success": true,
  "data": {
    "sent_to": "payments@mycompany.com",
    "status": "sent"
  }
}

Send Test Telegram Message

POST /notifications/test/telegram
admin
Send a test notification to your linked Telegram account. Telegram must be linked and enabled.
curl -X POST https://platform-api.anyspend.com/api/v1/notifications/test/telegram \
  -H "Authorization: Bearer asp_xxx"
Response
{
  "success": true,
  "data": {
    "sent_to": "@merchant",
    "status": "sent"
  }
}

Notification Settings Object

FieldTypeDescription
email_enabledbooleanWhether email notifications are active
email_addressstring | nullConfigured email address
telegram_enabledbooleanWhether Telegram notifications are active
telegram_chat_idstring | nullLinked Telegram chat ID
telegram_usernamestring | nullLinked Telegram username
enabled_eventsstring[]Event types that trigger notifications
updated_atstringISO 8601 last update timestamp

Supported Events

The same event types are available for both email and Telegram channels:
Event TypeDescription
payment.completedA payment was successfully processed
payment.failedA payment attempt failed
checkout.completedA checkout session completed with all form/shipping data