Subscriber Credits API

Overview

This API provides programmatic access to manage subscriber credits. For a complete understanding of how credits work, including lifecycle, expiration, and renewal behaviour, see the Subscriber Credits and Credit Profiles documentation.

API Integrity and Deduplication

The external_id field provides idempotency for credit creation:

  • A unique identifier for the subscriber in an external system

  • Correlates subscribers between Nebula and external systems

  • Must be unique per subscriber

  • Prevents duplicate credits when retrying failed requests

  • Returns 409 Conflict if a credit with the same external_id already exists

  • Can be used to look up credits without storing internal credit IDs

Upgrading and Downgrading Credits

Since the platform supports multiple active credits per subscriber, upgrading or downgrading is achieved by adding a new credit and removing the existing one.

Each credit tracks its own data balance independently. Removing an existing credit without proper handling may result in loss of remaining data balance.

Recommended approach: Use replace_credit_id or replace_external_id when creating the new credit. This performs an atomic operation that:

  • Creates the new credit

  • Purges the specified existing credit

  • Copies data usage from the old credit to the new credit

This ensures data integrity and continuity of service.

Understanding Multiple Active Credits

Multiple credits can be active simultaneously on a subscriber account. This is by design to support rollover scenarios where volume expiration exceeds the renewal date.

To filter for current (non-rolled-over) credits only, use the query parameter ?rolled_over=false when listing credits.

Credit Profiles and Subscriber Credits

These APIs manage Credit Profiles and apply them to Subscribers. This is the standard approach for credit management via the UI and API.

See Subscriber Credits and Credit Profiles for detailed documentation.

Credit Group Names

Define at least one credit group name before creating credit profiles.

See Credit Group Names.

GET
/v1/credit/names
(subscriber)

List Credit Names.
Service
subscriber
GET
/v1/credit/name/{credit_group_name_id}
(subscriber)

Get credit name by ID.
Service
subscriber
POST
/v1/credit/name
(subscriber)

Add credit name.
Service
subscriber
PATCH
/v1/credit/name/{credit_group_name_id}
(subscriber)

Update credit group name by ID.
Service
subscriber
DELETE
/v1/credit/name/{credit_group_name_id}
(subscriber)

Remove credit group name by ID.
Service
subscriber

Credit Profiles

Define at least one credit profile before applying credits to subscribers.

See Credit Profiles.

GET
/v1/credit/profiles
(subscriber)

List Credit Profiles.
Service
subscriber
GET
/v1/credit/profile/{credit_profile_id}
(subscriber)

View credit profile by ID.
Service
subscriber
POST
/v1/credit/profile
(subscriber)

Add credit profile.
Service
subscriber
PATCH
/v1/credit/profile/{credit_profile_id}
(subscriber)

Update credit profile by ID.
Service
subscriber
DELETE
/v1/credit/profile/{credit_profile_id}
(subscriber)

Remove credit profile by ID.
Service
subscriber

Subscriber Credits

Apply credits to subscribers using predefined credit profiles, or purge existing credits.

See Subscriber Credits.

GET
/v1/credits/{subscriber_id}
(subscriber)

List Credits for a subscriber.
Service
subscriber
GET
/v1/credit/{subscriber_credit_id}
(subscriber)

Show subscriber credit by ID.
Service
subscriber
POST
/v1/credit
(subscriber)

Add credit to subscriber.
Service
subscriber
DELETE
/v1/credit/{subscriber_credit_id}
(subscriber)

Remove subscriber credit by ID.
Service
subscriber

Raw Subscriber Credits API

Provision credits directly without using credit profiles. This API is designed for external billing systems and provisioning platforms that manage their own credit logic.

GET
/v1/topups/{subscriber_id}
(subscriber)

List credits for a subscriber.
Service
subscriber
GET
/v1/topup/{id}
(subscriber)

Get credit by ID.
Service
subscriber
POST
/v1/topup
(subscriber)

Add credit to subscriber.
Service
subscriber
DELETE
/v1/topup/{id}
(subscriber)

Delete credit by ID.
Service
subscriber
DELETE
/v1/topup/group/{group_id}
(subscriber)

Delete credits by group ID.
Service
subscriber
DELETE
/v1/topup/by_external_id/{subscriber_id}/{external_id}
(subscriber)

Delete credit by external ID.
Service
subscriber