Subscription (billing)

GET/api/v1/billing/subscription
Requires anorganization API keywith the scopeaccount:read

Request

GET/api/v1/billing/subscription
curl -X GET 'https://app.mailyte.com/api/v1/billing/subscription' \
  -H 'Authorization: Bearer mk_live_YOUR_API_KEY'
The key names its own organization, so no X-Organization-ID header is needed.

Response

Success.

  • dataobject

    Your subscription, or null (with HTTP 200) when you have never subscribed.

    • objectstringsubscription
    • idstring

      Unique identifier for the subscription.

    • statusstringpending | active | past_due | suspended | cancelled

      Where the subscription stands. past_due means a payment failed; suspended means sending has stopped.

    • product_linestringmail | send | marketing

      Which product this subscription is for. An organization holds at most one live subscription per line, each with its own interval, renewal and cancellation.

    • currencystring

      ISO 4217 code, e.g. NGN or USD. THE CURRENCY THE CUSTOMER AGREED — nothing here is converted. Every amount below is in this currency's minor unit.

    • intervalstringmonth | year

      The billing period. (One-off prices exist for credit packs, which are bought outright and never appear on a subscription.)

    • itemsarray<object>

      What the subscription is made of, one line per product, such as 3 Standard and 4 Pro seats.

      • product_keystring

        The stable catalogue key, and the ONLY catalogue identifier published — it is the handle you pass to POST /billing/subscription/items to change quantity. Internal product and price row ids are not published.

      • tierstringstandard | pro | workplace

        The mailbox tier this line buys seats of. Null when the line is not seats, such as a Send plan or an add-on; product_key names it.

      • quantityinteger

        How many of this product.

      • next_quantityinteger

        A lower quantity that starts at the next renewal. Null when no change is planned. Until then the line keeps quantity; a reduction is not refunded.

      • unit_amountinteger

        The price of one unit per interval, as a whole number in the smallest unit of currency (kobo for NGN, cents for USD): 150000 NGN is ₦1,500.00. This is the price locked to this line.

      • subtotalinteger

        quantity times unit_amount, in the smallest unit of currency (kobo for NGN, cents for USD).

    • totalinteger

      The total for one interval, in the smallest unit of currency (kobo for NGN, cents for USD): 150000 NGN is ₦1,500.00. Tax and payment fees are not included.

    • current_period_startstring

      When the current billing period began. Null until the first payment succeeds (status is then pending).

    • current_period_endstring

      When the current period ends. With auto_renew on, total is charged again then. Null until the first payment succeeds.

    • auto_renewboolean
    • cancelled_atstring

      When cancellation was asked for. Null when it was not. Service continues until current_period_end.

    • cancel_at_period_endboolean

      True when the customer cancelled and the subscription is still running to current_period_end. It can be undone with POST /billing/subscriptions/{line}/resume until then.

    • next_billing_datestring

      When you will next be charged. Null when no charge is coming: it is cancelling, waiting for its first payment, or has ended.

    • price_locked_untilstring

      Prices on this subscription will not rise before this date. Null when there is no price lock: monthly plans have none, paying a year ahead does.

    • created_atstring

      When the subscription was created at checkout. Billing starts at current_period_start.

    • updated_atstring

      When the subscription last changed.

Returned inside the standard envelope.

Errors

StatusWhen
401The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist.
403The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys.
404No such resource in this organization.
422The request was understood but the values were not acceptable.
429Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait.

Every status, with what causes it and what to do, is on the error reference.