API doc for NovoWatt app - Mobile API (1.0.0)

Download OpenAPI specification:

This is the API documentation for Novowatt app.

Merchants

Get all merchant

Get all merchant

query Parameters
keyword
string

Get merchants by name, code

page
integer

Page number

per_page
integer

Number of items per page

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "total": 25,
  • "page": 1,
  • "data": [
    ]
}

Subscription plans

Get all subscription plans

Get all subscription plans

query Parameters
keyword
string

Get subscription plans by name or code

merchant_id
string

Merchant ID

merchant_code
string

Merchant code

status
string
Enum: "active" "inactive" "deleted"

Status of the subscription plan

per_page
integer

Number of items per page

page
integer

Page number

deleteAt
string <date-time>

Deletion date

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "total": 25,
  • "page": 1,
  • "data": [
    ]
}

Get a subscription plan by ID

Get a subscription plan by ID

path Parameters
id
required
string

ID of the subscription plan to get

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": {
    }
}

Subscribe to a subscription plan

Subscribe to a subscription plan. The request is rejected when the user already has a same-scope effective subscription. Effective checks ignore deleted records and match records with status=active or records where subscribe_to is non-null and still in the future. Global effective duplicates are also rejected for global-scope flows.

Request Body schema: application/json
required
subscription_plan_id
string

ID of the subscription plan

user_id
string

ID of the user

location_id
string

Location ID that bounds where the purchased subscription can receive subscription pricing. Required for all regular purchases. Global-scope (null location_id) is valid only for activation-code subscriptions (generated via /generate-activation-codes, redeemed via /activate-by-code).

object

Plan price details

active_date
string <date-time>

Activation date

is_auto_renew
boolean

Enable automatic renewal after this subscription becomes active. Defaults to false.

Responses

Request samples

Content type
application/json
{
  • "subscription_plan_id": "string",
  • "user_id": "string",
  • "location_id": "string",
  • "plan_price": {
    },
  • "active_date": "2019-08-24T14:15:22Z",
  • "is_auto_renew": false
}

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": { }
}

Subscription

Get all subscriptions

Get all subscriptions. Callers that need charging subscription selection should fetch a user's active subscriptions with user_id and status=active, then order the returned data client-side by nearest subscribe_to first, then subscribe_from, then _id, with missing subscribe_to sorted last.

query Parameters
user_id
string

Filter subscriptions by user ID. Use together with status=active to fetch the canonical active subscription list for a user.

subscription_plan_id
string

Subscription plan ID

merchant_id
string

Merchant ID

status
string

Subscription status

include_subscription_plan
boolean

Include populated subscription plan data. Charging-selection callers use this with user_id and status=active to enforce subscription plan status eligibility.

per_page
integer

Number of items per page

page
integer

Page number

active_from
string <date>

Active from date

active_to
string <date>

Active to date

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "total": 25,
  • "page": 1,
  • "data": [
    ]
}

Make a payment for a subscription

Make a payment for a subscription. Activation is rejected when the user already has a same-scope effective subscription. Effective checks ignore deleted records and match records with status=active or records where subscribe_to is non-null and still in the future.

Request Body schema: application/json
required
subscription_id
string

Subscription ID

promo_code_id
string

Promo code ID

Responses

Request samples

Content type
application/json
{
  • "subscription_id": "string",
  • "promo_code_id": "string"
}

Response samples

Content type
application/json
{
  • "ok": true,
  • "msg": "Subscription already paid",
  • "data": {
    }
}

Update subscription support details

Internal endpoint used by Admin API to update controlled support-managed subscription fields. Supported fields are location_id, user_email, and user_phone only. When location_id is provided, the service loads the subscription, validates the target location through Charging service, verifies the location enables the subscription's own plan using the same EVSE-level source as the location-fetch API, checks same-location active/effective conflicts, and updates the allowed fields only. The generic internal PUT /subscriptions/{subscription_id} remains available for existing service-to-service updates.

path Parameters
subscription_id
required
string

Subscription ID

Request Body schema: application/json
required
non-empty
location_id
string

Target location ID. The location must enable the subscription's plan.

user_email
string <email>

Subscription email to store on the subscription record.

user_phone
string

Subscription phone to store on the subscription record.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": {
    }
}

Activate a subscription

Activate a subscription

path Parameters
subscription_id
required
string

Subscription ID

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": {
    }
}

Deactivate a subscription

Deactivate a subscription

path Parameters
subscription_id
required
string

Subscription ID

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": {
    }
}

Toggle auto-renew for a subscription

Toggles recurring renewal for one owned, active, paid, unexpired subscription whose plan supports renewal.

path Parameters
subscription_id
required
string

Subscription ID

Request Body schema: application/json
required
is_auto_renew
required
boolean
user_id
required
string

Authenticated user ID supplied by the mobile forwarder.

Responses

Request samples

Content type
application/json
{
  • "is_auto_renew": true,
  • "user_id": "507f1f77bcf86cd799439011"
}

Response samples

Content type
application/json
{
  • "ok": true,
  • "msg": "string"
}

Get Subscription's consumption

path Parameters
id
required
string

Subscription ID (UUID)

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": {
    }
}

Get locations that enable subscription price

Returns locations that can be selected for subscription usage. Runtime pricing eligibility is still bound to the subscription's stored location_id when present; legacy subscriptions without location_id use temporary plan-only fallback until migration is finalized.

query Parameters
page
integer
Default: 1

Page number

per_page
integer
Default: 100

Number records/page

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": [
    ],
  • "msg": "",
  • "total": 30,
  • "page": 1,
  • "per_page": 100
}

Get locations that enable subscription price

path Parameters
id
required
string

Subscription ID (UUID)

query Parameters
page
integer
Default: 1

Page number

per_page
integer
Default: 100

Number records/page

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": [
    ],
  • "msg": "",
  • "total": 30,
  • "page": 1,
  • "per_page": 100
}

Subscriptions

Get Subscription's consumption

path Parameters
id
required
string

Subscription ID (UUID)

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": {
    }
}

Get locations that enable subscription price

Returns locations that can be selected for subscription usage. Runtime pricing eligibility is still bound to the subscription's stored location_id when present; legacy subscriptions without location_id use temporary plan-only fallback until migration is finalized.

query Parameters
page
integer
Default: 1

Page number

per_page
integer
Default: 100

Number records/page

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": [
    ],
  • "msg": "",
  • "total": 30,
  • "page": 1,
  • "per_page": 100
}

Get locations that enable subscription price

path Parameters
id
required
string

Subscription ID (UUID)

query Parameters
page
integer
Default: 1

Page number

per_page
integer
Default: 100

Number records/page

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": [
    ],
  • "msg": "",
  • "total": 30,
  • "page": 1,
  • "per_page": 100
}

PromoCodes

Get list promo codes programs with pagination

query Parameters
keyword
string

Search by keyword - code, name, ...

code
string

Filter by code

promo_type
string
Enum: "Subscription" "FeePayment"

Filter by promo type

status
string
Enum: "active" "inactive" "deleted"

Filter by status

is_used
boolean

Filter by is used

merchant_id
string

Filter by merchant id

page
integer

The page number.

per_page
integer

The numbers of items to return.

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "total": 25,
  • "page": 1,
  • "data": [
    ]
}

Get promo codes

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": [
    ]
}

Calculate discount with promo code

path Parameters
id
required
string

Promo code ID

Request Body schema: application/json
required

Calculate discount request body

invoice_type
string

Type of invoice

amount
number

Amount for which discount is to be calculated

Responses

Request samples

Content type
application/json
{
  • "invoice_type": "Subscription",
  • "amount": 100
}

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": {
    }
}

Redeem a promo code

path Parameters
id
required
string

Promo code ID

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "msg": "Promo code redeemed successfully"
}

PromoPrograms

Get promo programs

query Parameters
keyword
string

Keyword to search promo programs

code
string

Filter by code

merchant_id
string

Merchant ID

promo_type
string

Promo type

used_codes
integer

Number of used codes

start_date
string <date>

Start date

end_date
string <date>

End date

per_page
integer >= 1

Items per page

page
integer >= 1

Page number

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "total": 25,
  • "page": 1,
  • "data": [
    ]
}

Get a specific promo program

path Parameters
promo_program_id
required
string

Promo program ID

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "data": [
    ]
}

Faq

Get a faq promo code

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "msg": "string",
  • "data": [
    ]
}

Get a faq subscription

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "msg": "string",
  • "data": [
    ]
}