Skip to main content
The promotional codes API lets you create discount codes that drivers can apply to their charging sessions. Codes support both percentage-based and fixed-amount discounts, with optional usage limits and expiry dates. This section also covers the user types API, which lets you segment drivers into groups for use with billing rules.

Create a promotional code

POST /api/v1/billing/promotional-codes
string
required
The code string drivers will enter (e.g. SUMMER25). Must be unique within your organisation. Uppercase letters and numbers only, 4–20 characters.
string
required
How the discount is calculated. Accepted values: percent (percentage off the total), fixed (fixed amount off the total).
number
required
The discount amount. For percent, this is the percentage (e.g. 25 for 25% off). For fixed, this is the amount in your default currency.
string
ISO 4217 currency code. Required when discount_type is fixed.
number
Maximum number of times this code can be redeemed across all users. Leave unset for unlimited uses.
number
Maximum number of times a single user can redeem this code. Leave unset for unlimited.
string
ISO 8601 date/time after which the code can no longer be applied. Leave unset for no expiry.
string
Internal description for the code — not shown to drivers.
string
Unique identifier for the promotional code.
string
The code string.
number
Number of times this code has been successfully redeemed.
boolean
Whether the code is currently redeemable. Set to false automatically when max_uses is reached or expires_at passes.

List promotional codes

GET /api/v1/billing/promotional-codes Returns all promotional codes in your organisation.
boolean
Filter by active status.
string
Filter by discount type: percent or fixed.
number
default:"50"
Maximum number of codes to return.
number
default:"0"
Pagination offset.

Get a promotional code

GET /api/v1/billing/promotional-codes/{code_id}
string
required
The unique identifier of the promotional code.

Apply a promotional code to a session

POST /api/v1/billing/promotional-codes/sessions/{session_id}/apply-code Applies a promotional code to a completed session. The discount is calculated and recorded against the session. This endpoint can be called by a driver application or by an operator on behalf of a driver.
Codes can only be applied to sessions with status completed. Active sessions cannot have a code applied until the session ends.
string
required
The billing session to apply the code to.
string
required
The promotional code string to apply.
number
Session total before the code was applied.
number
Amount discounted from the session.
number
Session total after the discount.

Get promotional code usage stats

GET /api/v1/billing/promotional-codes/{code_id}/usage Returns detailed usage statistics for a promotional code, including a breakdown of redemptions over time.
string
required
The unique identifier of the promotional code.
string
ISO 8601 start date/time to filter usage from.
string
ISO 8601 end date/time to filter usage to.
number
Total number of times the code has been applied.
number
Number of distinct users who redeemed the code.
number
Total value discounted across all redemptions.
object[]
Daily redemption counts and discount totals for the requested period.

User types

User types let you segment drivers into groups so billing rules can target them specifically. For example, you might create types like staff, fleet, and public and then write rules that grant free sessions to staff drivers.

Create a user type

POST /api/v1/billing/user-types
string
required
Unique name for the user type (e.g. staff, fleet-customer, vip).
string
Optional description of who belongs to this type.

List user types

GET /api/v1/billing/user-types Returns all user types in your organisation.

Assign a user type to a driver

PUT /api/v1/billing/user-types/users/{user_id}/user-type Sets the user type for a specific driver. Replaces any previously assigned type.
string
required
The user to assign the type to.
string
required
The user type to assign.