Skip to content
ABUNA
DocsCustomer messages

API reference

Customer messages

The emails, Telegram and WhatsApp messages Abuna sent your customers.

View as Markdown

List the messages Abuna sends your customers, such as receipts and reminders, and check whether each one went out. In the API, a customer message is a notice. Each notice is one message on one channel: email, Telegram or WhatsApp.

The notice object

Attributes

  • idstring

    Unique identifier for the message.
  • customer_idstring

    The customer the message is for.
  • subscription_idstringnullable

    The subscription the message is about.
  • kindstring

    What the message is about:
    • subscription_started: a new subscription, with a link to pay its first period. Sent 30 minutes after the subscription is created, and only if the customer hasn't paid by then.
    • subscription_renewed: a renewal to pay, sent as its period starts.
    • renewal_upcoming: a paid period ends soon. Sent when the renewal's invoice goes out before the end, with its pay link. With renewal_lead_days at 0 or a downgrade scheduled, sent 3 days before the end without a pay link.
    • payment_overdue: a period is still unpaid.
    • payment_final_notice: the last reminder before an unpaid subscription is canceled.
    • payment_received: a receipt. When the payment puts an upgrade in force, it also gives the old and new plan. For an invoice marked paid, it says the payment was recorded by you.
    • payment_failed: a payment failed after the customer left the pay page. At most one an hour for each 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_switch_requested: the customer checked out another price of the product they subscribe to. It links to the page where they confirm the switch. It goes by email only.
    • 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.
    • trial_email_code: the customer chose to start a free trial at checkout. It goes by email only, with the 6-digit code that confirms their email and starts the trial.
    • email_code: the customer asked to change their email in the customer portal. It goes to the new address only, with the 6-digit code that confirms it.
    • 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, with the new email partly hidden.
    • portal_links: the customer asked for links to their subscriptions.
  • channelstring

    email, telegram, or whatsapp. Every message goes by email. A customer who chose Telegram or WhatsApp also gets it there. WhatsApp is off by default; you turn it on, and Live apps need Plus or higher.
  • recipientstring

    The email address or WhatsApp number 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 or WhatsApp 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 message was withdrawn.
  • next_attempt_attimestamp

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

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

    When it was sent.
The notice object
{
  "id": "e7JpT4cN",
  "customer_id": "Cu5tM8rA",
  "subscription_id": "x9QbL2sK",
  "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 customer messages

GET/v1/apps/{appID}/notices

Lists the app's customer messages, newest first, one page at a time.

Query parameters

  • subscription_idstring

    Returns only messages about this subscription.
  • statusstring

    Returns only messages with this status: pending, sending, sent, failed, or withdrawn.
  • limitinteger

    How many messages to return, from 1 to 100. Defaults to 50.
  • cursorstring

    The next_cursor from the previous page. Send the same filters with it.

Returns items and next_cursor, as described in Lists and filters. A value that isn't allowed, like a limit above 100, returns 422 with code invalid and the parameter's name in errors.

GET /v1/apps/{appID}/notices
curl "https://api.abuna.app/v1/apps/8ddhXCDW/notices?subscription_id=x9QbL2sK" \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "items": [
    {
      "id": "e7JpT4cN",
      "customer_id": "Cu5tM8rA",
      "subscription_id": "x9QbL2sK",
      "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_cursor": null
}

Next steps