Skip to content

Retrieve a referral code

Request

Retrieve one of the caller organisation's referral codes.

Security
oauth2(Required scopes: referral:read)
Path
referral_code_idstringprom[A-Z\d]{26}required

The ID of the referral code.

Example:prom01JZQ8V5T7MKXR9NBCDEFGHJ4A
Headers
EvEnergy-Versionnumber

Specify the version of this endpoint to use.

Value:2
Accept-Languagestring

Indicates the natural language and locale that the client prefers.

curl -i -X GET \
  https://developers.ev.energy/_mock/ev.energy-api-v2/referral_codes/prom01JZQ8V5T7MKXR9NBCDEFGHJ4A \
  -H 'Accept-Language: string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'EvEnergy-Version: 2'

Responses

Returns a single referral code.

Headers
EvEnergy-Versionnumber

Indicates the version of the API that generated this response. If EvEnergy-Version was not specified in the request, this will be your OAuth application's default version.

Value:2
Bodyapplication/json
idstringprom[A-Z\d]{26}read-onlyrequired

Unique identifier for the given referral code.

Example:"prom01JZQ8V5T7MKXR9NBCDEFGHJ4A"
urlstring, (uri)read-onlyrequired
Example:"https://api.ev.energy/v2/referral_codes/prom01JZQ8V5T7MKXR9NBCDEFGHJ4A"
codestring^[A-Za-z0-9]{2,16}$required

The public string a driver types. Immutable once issued.

Example:"SPRING24"
labelstring

Internal name for the owning organisation's UI. Never shown to drivers.

Example:"Forecourt poster - spring"
campaign_refstring

Free-text tag the owning organisation groups and reports on.

Example:"spring-forecourt"
statusstring

INACTIVE refuses new redemptions and preserves every historical redemption.

Enum:"ACTIVE""INACTIVE"
Example:"ACTIVE"
limitationstringread-only

How many times the code may be redeemed.

Enum:"SINGLE_USE""SINGLE_USE_PER_USER""UNLIMITED"
Example:"UNLIMITED"
created_atstring, (date-time)read-only
Example:"2026-07-01T09:12:00Z"
performanceobject(ReferralCodePerformance)read-only

Redemption counts for one code, broken down by stage, from a single snapshot. Core computes in_progress_count rather than leaving a client to difference two reads, so all three numbers describe the same instant.

Response
{ "id": "prom01JZQ8V5T7MKXR9NBCDEFGHJ4A", "url": "https://api.ev.energy/v2/referral_codes/prom01JZQ8V5T7MKXR9NBCDEFGHJ4A", "code": "SPRING24", "label": "Forecourt poster - spring", "campaign_ref": "spring-forecourt", "status": "ACTIVE", "limitation": "UNLIMITED", "created_at": "2026-07-01T09:12:00Z", "performance": { "redeemed_count": 64, "qualified_count": 41, "in_progress_count": 23 } }