Skip to content
ABUNA
DocsNotices

API reference

Notices

The emails and Telegram messages Abuna sent your customers.

A notice is an email or Telegram message Abuna sends one of your customers, like a receipt or a payment reminder. Abuna sends one notice per channel.

The notice object

Attributes

  • idstring

    Unique identifier for the notice.
  • customer_idstring

    The customer the notice is for.
  • subscription_idstringnullable

    The subscription the notice is about.
  • kindstring

    What the notice is about:
    • subscription_started: a new subscription, with a link to pay its first period.
    • subscription_renewed: a new billing period to pay.
    • renewal_upcoming: a paid period ends in 3 days.
    • payment_overdue: a period is still unpaid.
    • payment_final_notice: the last reminder before the subscription is canceled for not paying.
    • payment_received: a receipt. When the payment puts an upgrade in force, it also gives the old and new plan.
    • payment_failed: a payment failed after the customer left the pay page. At most one an hour per invoice.
    • subscription_cancel_scheduled: a cancel at the end of the paid period was scheduled. It gives the end date and how to keep the subscription.
    • subscription_cancel_undone: a scheduled cancel was undone, so the subscription continues.
    • subscription_canceled: the subscription ended.
    • plan_change_offered: you offered the customer a plan change. It links to the page where they accept it.
    • plan_upgraded: an upgrade took effect without a payment first: nothing was due, or the new period is to pay through the pay link it gives. It gives the new plan and the new billing date.
    • plan_upgrade_due: an upgrade waits for the customer to pay. It gives the amount, the date to pay by, and the pay link.
    • plan_downgrade_scheduled: a downgrade was scheduled. It gives the new plan and the date it starts.
    • plan_downgrade_undone: a scheduled downgrade was undone, so the plan renews as it is.
    • price_change_scheduled: a price the customer pays is changing. It gives the new amount and the date it first applies to them.
    • price_change_canceled: a scheduled price change was canceled or replaced, so the customer keeps paying what they pay now.
    • contact_changed: the customer changed their email or phone number in the customer portal. It goes to the old email and the connected Telegram chat.
    • portal_links: the customer asked for links to their subscriptions.
  • channelstring

    email or telegram.
  • recipientstring

    The email address it goes to. Empty for Telegram, to keep the customer's chat private.
  • subjectstring

    The subject line.
  • statusstring

    pending while it waits to be sent, sending while Abuna sends it, sent, or failed. withdrawn when it stopped being true before it went out, like a reminder for a period that was paid, or a Telegram message to a customer who disconnected the chat.
  • attemptsinteger

    How many times Abuna has tried to send it.
  • last_errorstringnullable

    Why the last attempt failed, or why the notice was withdrawn.
  • next_attempt_attimestamp

    When Abuna next tries to send it, while it is pending.
  • created_attimestamp

    When the notice was created, in Unix seconds.
  • sent_attimestampnullable

    When it was sent.
The notice object
{
  "id": "01J9ZQ9N1P2Q3R4S5T6V7W8X9Y",
  "customer_id": "01J9ZQ6A1B2C3D4E5F6G7H8J9K",
  "subscription_id": "01J9ZQ6M1N2P3Q4R5S6T7V8W9X",
  "kind": "payment_received",
  "channel": "email",
  "recipient": "jane@example.com",
  "subject": "Receipt from My store: FCFA 5,000 paid",
  "status": "sent",
  "attempts": 1,
  "last_error": null,
  "next_attempt_at": 1727600100,
  "created_at": 1727600100,
  "sent_at": 1727600102
}

List notices

GET/v1/apps/{appID}/notices

Lists the app's 100 newest notices, newest first.

Query parameters

  • subscription_idstring

    Returns only notices about this subscription.
  • statusstring

    Returns only notices with this status: pending, sending, sent, failed, or withdrawn.

Returns an array of notice objects. There is no way to page past the newest 100. An unknown status returns 422 with code invalid.

GET /v1/apps/{appID}/notices
curl 'https://api.abuna.app/v1/apps/01J9ZQ4Y7R3T6V8W2X5B1C0DEF/notices?subscription_id=01J9ZQ6M1N2P3Q4R5S6T7V8W9X' \
  -H "Authorization: Bearer sk_test_..."
Response
[
  {
    "id": "01J9ZQ9N1P2Q3R4S5T6V7W8X9Y",
    "customer_id": "01J9ZQ6A1B2C3D4E5F6G7H8J9K",
    "subscription_id": "01J9ZQ6M1N2P3Q4R5S6T7V8W9X",
    "kind": "payment_received",
    "channel": "email",
    "recipient": "jane@example.com",
    "subject": "Receipt from My store: FCFA 5,000 paid",
    "status": "sent",
    "attempts": 1,
    "last_error": null,
    "next_attempt_at": 1727600100,
    "created_at": 1727600100,
    "sent_at": 1727600102
  }
]

Next steps