The Dealer (Service Provider) Billing section of the API provides service providers information regarding financial aspects related to their accounts within the GPS-Trace platform.
This section exclusively consists of methods dedicated to retrieving various types of data, such as subscription details, partner plans, service fees, and invoices.
Service providers can use these methods to fetch relevant information about subscription plans and billing-related activities, enabling them to make informed decisions and manage their accounts effectively.
This endpoint allows you to retrieve data about subscriptions applicable to a specific application.
Premium subscriptions are currently applicable to Ruhavik application. Therefore, if you request subscriptions for other applications, the response will contain default data about the free subscription.
GET /billing/plans/{app_id}
Request example:
curl -X 'GET' \
'https://api.gps-trace.com/billing/plans/5a5ca87f-7cbe-4540-ab5d-77bf4bf69884' \
-H 'accept: */*' \
-H 'X-AccessToken: '
200 Response example:
{
"free": {
"name": "free",
"subscriptions": [
"free"
],
"platforms": [
"google",
"web",
"apple",
"ios"
],
"subscr_types": [
"custom",
"google",
"ios-appstore",
"paypal",
"stripe",
"td-paypal",
"td-stripe",
"space"
],
"data": {
"user": 1,
"unit": 1,
"geofence": 2,
"calculator": 200,
"unit_notify_settings": null,
"triggers": 0,
"unit_storage": 10,
"config_send_notifications": false
}
},
"basic": {
"name": "basic",
"subscriptions": [
"basic.monthly",
"basic.yearly"
],
"platforms": [
"web",
"apple",
"google"
],
"subscr_types": [
"custom",
"google",
"ios-appstore",
"paypal",
"stripe"
],
"data": {
"user": 1,
"unit": 1,
"geofence": 15,
"calculator": 200,
"unit_notify_settings": null,
"triggers": 1,
"unit_storage": 100,
"config_send_notifications": true
}
}
}
The response to the request returns an array of objects, where each object describes a subscription type applicable to the chosen application. The provided example response showcases the first two objects from the entire array.
Creating a Forguard or Tags account requires assigning a Client plan to it.
Client plans are made based on Partner plans provided by the GPS-Trace platform.
Partner plans consist of two main parts:
Available modules in Forguard:
Available modules in Tags:
"limits": {
"geofence": {
"default": 35,
"max": 70,
"min": 0,
"step": 1
},
"unit": {
"default": 35,
"max": 70,
"min": 1,
"step": 1
},
"unit_storage": {
"default": 102400,
"max": 204800,
"min": 10240,
"step": 10240
}
}
Client Plans based on partner plans include specific quotas and modules.
Quotas for geofences, units, and data storage volume are set during client plan creation, within the limits of the partner plan. Service providers can activate or deactivate modules available in the partner plan.
For example, a service provider might select a partner plan allowing 10 units, create a client plan based on it, set an 8-unit limit, and apply this plan to a Forguard account for the client to track up to 8 units.
Scheme for creating a Forguard account:
This endpoint allows you to retrieve data about all partner plans.
GET /billing/managed-plans/{app_id}
Request example:
curl -X 'GET' \
'https://api.gps-trace.com/billing/managed-plans/b901da51-ce00-4af2-b978-8d0fca8ae1ea' \
-H 'accept: application/json' \
-H 'X-AccessToken: '
Body response example:
[
{
"id": "68b840a975a34140831f4b0d7f3a4261",
"name": "Advanced 2024",
"status": "active",
"description": "",
"price": number,
"currency": "eur",
"period": "monthly",
"features": {
"limits": {
"geofence": {
"default": 35,
"max": 70,
"min": 0,
"step": 1
},
"unit": {
"default": 35,
"max": 70,
"min": 1,
"step": 1
},
"unit_storage": {
"default": 102400,
"max": 204800,
"min": 10240,
"step": 10240
}
},
"modules": [
"account",
"unit",
"fuel",
"service_mode",
"tools",
"notification",
"unit_event",
"geofence",
"timeline",
"sharing",
"command",
"statistics",
"maintenance",
"extended_notification",
"google_maps"
]
},
"data": {
"time_begin": number
},
"type": "managed"
}
]
This endpoint allows retrieving information about the latest invoice of the service provider.
GET /billing/stripe-invoice
Request example:
curl -X 'GET' \
'https://api.gps-trace.com/billing/stripe-invoice' \
-H 'accept: application/json' \
-H 'X-AccessToken: '
Body response example:
{
"id": "string",
"status": "open"
}
This method allows you to retrieve data about the customer portal.
GET /billing/customer-portal
Example of curl:
curl -X 'GET' \
'https://api.gps-trace.com/billing/customer-portal' \
-H 'accept: application/json' \
-H 'X-AccessToken: '
Example of success response:
{
"id": "string",
"object": "billing_portal.session",
"configuration": "string",
"created": number,
"customer": "string",
"flow": null,
"livemode": false,
"locale": null,
"return_url": "https://partner.gps-trace.com/billing/forguard/billing/reports",
"url": "https://billing.stripe.com/p/session/w2sXXXXXXXXXXXX2T54w"
}