API reference
Customer messages
The emails, Telegram and WhatsApp messages Abuna sent your customers.
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
idstringUnique identifier for the message.customer_idstringThe customer the message is for.subscription_idstringnullableThe subscription the message is about.kindstringWhat 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. Withrenewal_lead_daysat 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.
channelstringemail,telegram, orwhatsapp. 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.recipientstringThe email address or WhatsApp number it goes to. Empty for Telegram, to keep the customer's chat private.subjectstringThe subject line.statusstringpendingwhile it waits to be sent,sendingwhile Abuna sends it,sent, orfailed.withdrawnwhen 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.attemptsintegerHow many times Abuna has tried to send it.last_errorstringnullableWhy the last attempt failed, or why the message was withdrawn.next_attempt_attimestampWhen Abuna next tries to send it, while it ispending.created_attimestampWhen the message was created, in Unix seconds.sent_attimestampnullableWhen it was sent.
{
"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_idstringReturns only messages about this subscription.statusstringReturns only messages with this status:pending,sending,sent,failed, orwithdrawn.limitintegerHow many messages to return, from 1 to 100. Defaults to 50.cursorstringThenext_cursorfrom 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.
curl "https://api.abuna.app/v1/apps/8ddhXCDW/notices?subscription_id=x9QbL2sK" \
-H "Authorization: Bearer sk_test_..."{
"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
}