Our platform enables service providers to create bills with payment links for their clients and send them to the email addresses associated with their Forguard accounts. This process is facilitated through Stripe. Here's how it works:
Service providers need a Stripe account to connect it to GPS-Trace Console.
After connecting Stripe account to GPS-Trace Console, service providers gain the ability to create bills with payment links for their clients. They can specify the currency, describe products, assign quantities and prices, which will be reflected in the bill received by their client.
Client Billing API enables service providers to perform various operations seamlessly. It allows:
With these capabilities, service providers can manage payment processes and track the status of invoices issued to their clients.
This endpoint allows you to retrieve bill information about Forguard client accounts within a specified time frame. This method is crucial for tracking and managing client billing activities for accounts billed using the Stripe API Secret key.
GET /billing/stripe-payments
Mandatory request fields:
Forguard app_id: b901da51-ce00-4af2-b978-8d0fca8ae1ea
Note: Results are returned for a maximum duration of 31 days from the begin timestamp.
Request example:
curl -X 'GET' \
'https://api.gps-trace.com/billing/stripe-payments?
app_id=b901da51-ce00-4af2-b978-8d0fca8ae1ea&from=&to=&account_id=&fields=' \
-H 'accept: application/json' \
-H 'X-AccessToken: '
200 response example:
{
"string": {
"id": "string",
"status": "open",
"payment_status": "string",
"created": number,
"expires_at": number,
"account_id": number,
"url": "",
"metadata": {
"app_id": "b901da51-ce00-4af2-b978-8d0fca8ae1ea",
"cid": "string",
"email": "string",
"lang": "string",
"name": "string",
"td_cid": "string"
},
"amount_total": number
},
"string": {
"id": "string",
"status": "string",
"payment_status": "string",
"created": number,
"expires_at": number,
"account_id": number,
"url": null,
"metadata": {
"app_id": "b901da51-ce00-4af2-b978-8d0fca8ae1ea",
"cid": "number",
"email": "<string@iliken.com>",
"lang": "string",
"name": "string",
"td_cid": "string"
},
"amount_total": number
}
}
The response returns a list with the payment ID as the key and the payment information as the value.
Total amount of the bill represented in the smallest currency unit (e.g., for EUR, the amount is in cents. So, 25 EUR is represented as 2500).
This endpoint allows you to create a bill with a payment link for the client. You specify the amount, product, currency, and other information to generate the bill. The response includes the bill details and a payment link. Clients can use this link to pay the bill created by you.
Example of the bill issued by the service provider, viewed by the client through the payment link:
POST /billing/stripe-payments
Mandatory request fields:
Forguard app_id: b901da51-ce00-4af2-b978-8d0fca8ae1ea
For example - "eur"
Total amount must convert to at least 50 cents
Request example:
curl -X 'POST' \
'https://api.gps-trace.com/billing/stripe-payments' \
-H 'accept: application/json' \
-H 'X-AccessToken: ' \
-H 'Content-Type: application/json' \
-d '{
"app_id": "b901da51-ce00-4af2-b978-8d0fca8ae1ea",
"account_id": number,
"prices": [
{
"quantity": number,
"currency": "string",
"unit_amount": number,
"name": "string"
},
{
"quantity": number,
"currency": "string",
"unit_amount": number,
"name": "string"
}
],
"name": "string"
}'
201 response example:
{
"id": "string",
"status": "string",
"payment_status": "string",
"created": number,
"expires_at": number,
"account_id": number,
"url": "",
"metadata": {
"app_id": "b901da51-ce00-4af2-b978-8d0fca8ae1ea",
"cid": "string",
"email": "string",
"lang": "string",
"td_cid": "string"
},
"amount_total": number
}
The response returns a list with the payment ID as the key and the payment information as the value.
Total amount of the bill represented in the smallest currency unit (e.g., for EUR, the amount is in cents. So, 25 EUR is represented as 2500).
This method sends a payment notification via email to the client associated with the specified payment ID. The email is sent to the email address linked to the Forguard account on which the bill is issued. The email contains a payment link. When the client clicks on this link, they are directed to a page where they can view the bill issued by you, along with its description and all the necessary tools for making the payment.
POST /billing/stripe-payments/{payment_id}/send
Mandatory request fields:
Currently, this is set to "Forguard" with the ID b901da51-ce00-4af2-b978-8d0fca8ae1ea.
Request example:
curl -X 'POST' \
'https://api.gps-trace.com/billing/stripe-payments//send?app_id=b901da51-ce00-4af2-b978-8d0fca8ae1ea' \
-H 'accept: application/json' \
-H 'X-AccessToken: '
Upon a successful request, the response will include a field "result" set to true.
This endpoint allows you to forcibly change the status of a client's bill to "expired". This method is useful for expiring bills that are no longer relevant or were generated by mistake, without having to wait for the auto-expire process.
POST /billing/stripe-payments/{payment_id}/expire
Mandatory request fields:
Currently, this is set to "Forguard" with the ID b901da51-ce00-4af2-b978-8d0fca8ae1ea.
Request example:
curl -X 'POST' \
'https://api.gps-trace.com/billing/stripe-payments//expire' \
-H 'accept: application/json' \
-H 'X-AccessToken: ' \
-H 'Content-Type: application/json' \
-d '{
"app_id": "b901da51-ce00-4af2-b978-8d0fca8ae1ea",
"account_id":
}'
200 response example:
{
"id": "",
"status": "expired",
"payment_status": "string",
"created": number,
"expires_at": number,
"account_id": number,
"url": null,
"metadata": {
"app_id": "b901da51-ce00-4af2-b978-8d0fca8ae1ea",
"cid": "string",
"email": "string",
"lang": "string",
"name": "string",
"td_cid": "string"
},
"amount_total": number
}
Expected value: expired
Total amount of the bill represented in the smallest currency unit (e.g., for EUR, the amount is in cents. So, 25 EUR is represented as 2500).
This endpoint allows you to retrieve all information about a specific issued bill, including its items.
GET /billing/stripe-payments/{payment_id}/items
Request Parameters:
Currently, this is set to "Forguard" with the ID b901da51-ce00-4af2-b978-8d0fca8ae1ea.
Request example:
curl -X 'GET' \
'https://api.gps-trace.com/billing/stripe-payments/?app_id=b901da51-ce00-4af2-b978-8d0fca8ae1ea&account_id=' \
-H 'accept: application/json' \
-H 'X-AccessToken: '
200 response example:
{
"id": "string",
"object": "string",
"amount_discount": number,
"amount_subtotal": number,
"amount_tax": number,
"amount_total": number,
"currency": "string",
"description": "string",
"price": {
"id": "string",
"object": "string",
"active": false,
"billing_scheme": "string",
"created": number,
"currency": "string",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "string",
"recurring": null,
"tax_behavior": "string",
"tiers_mode": null,
"transform_quantity": null,
"type": "string",
"unit_amount": number,
"unit_amount_decimal": "string"
},
"quantity": number
}
The response contains an array of data objects. Each object represents an item in the bill with detailed information about the item. Here are the fields included in each item: