Get Organization Gas Tank Usage History
Overview
This API endpoint allows you to retrieve the gas tank usage history for an organization. It provides details of each usage transaction, including amounts and rates.
- HTTP Method: GET
- Endpoint:
{{BASE_URL}}/api/v1/client/gasTank/history
Query Parameters
limit
(optional): Number of records to return per page. Default is 10.page
(optional): Page number for pagination. Default is 1.
Request Headers
X-CLIENT-ID
: (required): Client ID which was generated when registering in Xellar Account Abstraction API Service Dashboard.X-SIGNATURE
: (required): Calculated signature, please refer to Authorization section.X-TIMESTAMP
: (required): Request timestamp in RFC3339 format.
Example Request Syntax
curl -X GET -H "Content-Type: application/json" \
-H "x-client-id: $YOUR_CLIENT_ID" \
-H "x-signature: $CALCULATED_SIGNATURE" \
-H "x-timestamp: $TIMESTAMP" \
"{{BASE_URL}}/api/v1/client/gasTank/history?limit=10&page=1"
Response
The response will include a JSON object with the following properties:
status
(number): The HTTP status code of the response (e.g., 200 for success).message
(string): A message indicating the result of the request.data
(object): Contains the list of usage transactions and pagination information:data
(array): An array of objects, each representing a gas tank usage transaction with the following properties:id
(string): The unique identifier of the usage transaction.clientId
(string): The client ID associated with the transaction.clientGasTankId
(string): The gas tank ID used in the transaction.userOpId
(string): The user operation ID related to the transaction.nativeToGasTankRate
(number): The conversion rate from native currency to gas tank currency.amountInNative
(string): The amount in native currency.amountInGasTank
(string): The amount in gas tank currency.initialDeductedAmountInNative
(string): The initially deducted amount in native currency.initialDeductedAmountInGasTank
(string): The initially deducted amount in gas tank currency.refundedAmountInNative
(string|null): The refunded amount in native currency, if any.refundedAmountInGasTank
(string|null): The refunded amount in gas tank currency, if any.clientFeeInGasTank
(string|null): The client fee in gas tank currency.xellarFeeInGasTank
(string|null): The Xellar fee in gas tank currency.createdAt
(string): The timestamp when the transaction was created.refundedAt
(string|null): The timestamp when the refund was processed, if applicable.
pagination
(object): Pagination information:total
(number): Total number of records.page
(number): Current page number.limit
(number): Number of records per page.totalPages
(number): Total number of pages.hasNext
(boolean): Whether there is a next page.hasPrev
(boolean): Whether there is a previous page.
Example Response
{
"status": 200,
"message": "success",
"data": {
"data": [
{
"id": "67a48d4a531158cc6112d9d6",
"clientId": "19eb9738-dc52-493a-a602-b4d08f946bba",
"clientGasTankId": "67a4711c28acbaf72c2cf541",
"userOpId": "67a48cef1028c9207b639628",
"nativeToGasTankRate": 0.31823,
"amountInNative": "8409380409424485",
"amountInGasTank": "2676117127691153",
"initialDeductedAmountInNative": "11386606973247233",
"initialDeductedAmountInGasTank": "3623559937096467",
"refundedAmountInNative": "2977226563822748",
"refundedAmountInGasTank": "947442809405314",
"clientFeeInGasTank": "3444140364102532",
"xellarFeeInGasTank": "8610350910259462",
"createdAt": "2025-02-06T10:22:01.886Z",
"refundedAt": "2025-02-06T10:25:06.767Z"
}
],
"pagination": {
"total": 23,
"page": 1,
"limit": 10,
"totalPages": 3,
"hasNext": true,
"hasPrev": false
}
}
}