v1

latestOpenAPI 3.0.12026-07-243686491.1 MB
Subscriptions

Create subscription

Required scope: subscriptions:write </br>Organization authorization: supported

post/api/v1/subscriptions

Request body

planIdinteger

Id of the plan to subscribe to

customerIdinteger

Id of the customer the subscription is created for, e.g. team or charge-point id

customerType'team' | 'charge-point' | 'operator' | 'other' required

Enumerate the various subscription customer types

discountAbsolutenumber double nullable

Allows to modify the absolute discount on a subscription if provided. If not provided, the discount of the plan is used. Note: If you want to set it on an existing subscription, you have to cancel the subscription first.

discountPercentagenumber double nullable

Allows to modify the percentage discount on a subscription if provided. If not provided, the discount of the plan is used. Note: If you want to set it on an existing subscription, you have to cancel the subscription first.

userIdinteger nullable

The user that should be assigned as the purchaser of the subscription. If not provided, the subscription will be assigned to the default user for this consumer.

nextPurchaseAtstring date-time nullable

Date when wallet will be charged for the first time (ISO8601: yyyy-MM-ddTHH:mm:ssZ). Has to be a date in the future.

Example request

{
  "serviceConfig": {
    "payoutPerKwh": 1.29,
    "priceIncludesVat": true,
    "additionalFeeAbsolute": 0.5,
    "roamingAdditionalFeeAbsolute": 0.5
  },
  "nextPurchaseAt": "2025-10-22T09:30:03Z"
}

Response

The created subscription

idinteger

Id of the subscription

state'pending' | 'active' | 'paused' | 'cancelling' | 'cancelled' | 'unpaid' | 'other' required
nextPurchaseAtstring date-time nullable

Date of next purchase

cancelledAtstring date-time nullable

Subscription cancellation date

endAtstring date-time nullable

Subscription end date

discountPercentagenumber double

Discount percentage

discountAbsolutenumber double

Discount absolute

discountAmountnumber double

Discount amount

originalAmountnumber double

Original amount

totalAmountnumber double

Total amount

purchaseCountinteger

Number of purchases

chargePointsinteger

Number of charge points

customerIdinteger

The id of the customer

customerType'team' | 'charge-point' | 'operator' | 'other' required

Enumerate the various subscription customer types

planIdinteger

Plan id

createdAtstring date-time required

Subscription creation date

updatedAtstring date-time required

Subscription update date

canCancelboolean

Indicates if the subscription can be cancelled

notestring nullable

A note on the subscription

deletedAtstring date-time nullable

Subscription marked as deleted date

Example response

{
  "id": 1,
  "nextPurchaseAt": "2023-05-12T15:56:45.99Z",
  "cancelledAt": "2023-05-12T15:56:45.99Z",
  "endAt": "2023-05-12T15:56:45.99Z",
  "validityPeriod": {
    "from": "2024-01-01T00:00:00Z",
    "to": "2024-12-31T23:59:59Z"
  },
  "discountPercentage": 7.5,
  "discountAbsolute": 7.5,
  "discountAmount": 7.5,
  "originalAmount": 7.5,
  "totalAmount": 7.5,
  "purchaseCount": 5,
  "chargePoints": 5,
  "customerId": 1,
  "planId": 42,
  "serviceConfig": {
    "payoutPerKwh": 1.29,
    "priceIncludesVat": true,
    "additionalFeeAbsolute": 0.5,
    "roamingAdditionalFeeAbsolute": 0.5
  },
  "createdAt": "2023-05-12T15:56:45.99Z",
  "updatedAt": "2023-05-12T15:56:45.99Z",
  "canCancel": true,
  "note": "Monthly plan for fleet",
  "deletedAt": "2023-05-12T15:56:45.99Z"
}