/** * Shell Data & Reporting APIsLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { ApiResponse, RequestOptions } from '../core.js'; import { CardUsageSummaryReq, cardUsageSummaryReqSchema, } from '../models/cardUsageSummaryReq.js'; import { CardUsageSummaryRes, cardUsageSummaryResSchema, } from '../models/cardUsageSummaryRes.js'; import { FeeSummaryResponse, feeSummaryResponseSchema, } from '../models/feeSummaryResponse.js'; import { FuelConsumptionReq, fuelConsumptionReqSchema, } from '../models/fuelConsumptionReq.js'; import { FuelConsumptionResponse, fuelConsumptionResponseSchema, } from '../models/fuelConsumptionResponse.js'; import { MultiPricedTransactionReq, multiPricedTransactionReqSchema, } from '../models/multiPricedTransactionReq.js'; import { MultiPricedTransactionRes, multiPricedTransactionResSchema, } from '../models/multiPricedTransactionRes.js'; import { PricedTransactionRequestV2, pricedTransactionRequestV2Schema, } from '../models/pricedTransactionRequestV2.js'; import { PricedTransactionRes, pricedTransactionResSchema, } from '../models/pricedTransactionRes.js'; import { PricedTransactionResponseV2, pricedTransactionResponseV2Schema, } from '../models/pricedTransactionResponseV2.js'; import { PricedTransSummaryResp, pricedTransSummaryRespSchema, } from '../models/pricedTransSummaryResp.js'; import { PriceTransactionReq, priceTransactionReqSchema, } from '../models/priceTransactionReq.js'; import { PriceTransSummaryReq, priceTransSummaryReqSchema, } from '../models/priceTransSummaryReq.js'; import { RecentTransactionRequest, recentTransactionRequestSchema, } from '../models/recentTransactionRequest.js'; import { RecentTransactionsResponse, recentTransactionsResponseSchema, } from '../models/recentTransactionsResponse.js'; import { TransactionExceptionsReq, transactionExceptionsReqSchema, } from '../models/transactionExceptionsReq.js'; import { TransactionExceptionsRes, transactionExceptionsResSchema, } from '../models/transactionExceptionsRes.js'; import { TransactionFeesReq, transactionFeesReqSchema, } from '../models/transactionFeesReq.js'; import { TransactionFeesRes, transactionFeesResSchema, } from '../models/transactionFeesRes.js'; import { TransactionFeesSummaryReq, transactionFeesSummaryReqSchema, } from '../models/transactionFeesSummaryReq.js'; import { UpdateOdometerRequest, updateOdometerRequestSchema, } from '../models/updateOdometerRequest.js'; import { UpdateOdometerResp, updateOdometerRespSchema, } from '../models/updateOdometerResp.js'; import { VolumeBasedBonusReq, volumeBasedBonusReqSchema, } from '../models/volumeBasedBonusReq.js'; import { VolumeBasedBonusRes, volumeBasedBonusResSchema, } from '../models/volumeBasedBonusRes.js'; import { VolumeBasedPricingReq, volumeBasedPricingReqSchema, } from '../models/volumeBasedPricingReq.js'; import { VolumeBasedPricingRes, volumeBasedPricingResSchema, } from '../models/volumeBasedPricingRes.js'; import { optional, string } from '../schema.js'; import { BaseController } from './baseController.js'; import { TransactionDataV1Cardusagesummary400Error } from '../errors/transactionDataV1Cardusagesummary400Error.js'; import { TransactionDataV1Cardusagesummary401Error } from '../errors/transactionDataV1Cardusagesummary401Error.js'; import { TransactionDataV1Cardusagesummary403Error } from '../errors/transactionDataV1Cardusagesummary403Error.js'; import { TransactionDataV1Cardusagesummary404Error } from '../errors/transactionDataV1Cardusagesummary404Error.js'; import { TransactionDataV1Cardusagesummary500Error } from '../errors/transactionDataV1Cardusagesummary500Error.js'; import { TransactionDataV1Exceptions400Error } from '../errors/transactionDataV1Exceptions400Error.js'; import { TransactionDataV1Exceptions401Error } from '../errors/transactionDataV1Exceptions401Error.js'; import { TransactionDataV1Exceptions403Error } from '../errors/transactionDataV1Exceptions403Error.js'; import { TransactionDataV1Exceptions404Error } from '../errors/transactionDataV1Exceptions404Error.js'; import { TransactionDataV1Exceptions500Error } from '../errors/transactionDataV1Exceptions500Error.js'; import { TransactionDataV1Fees400Error } from '../errors/transactionDataV1Fees400Error.js'; import { TransactionDataV1Fees401Error } from '../errors/transactionDataV1Fees401Error.js'; import { TransactionDataV1Fees403Error } from '../errors/transactionDataV1Fees403Error.js'; import { TransactionDataV1Fees404Error } from '../errors/transactionDataV1Fees404Error.js'; import { TransactionDataV1Fees500Error } from '../errors/transactionDataV1Fees500Error.js'; import { TransactionDataV1Feessummary400Error } from '../errors/transactionDataV1Feessummary400Error.js'; import { TransactionDataV1Feessummary401Error } from '../errors/transactionDataV1Feessummary401Error.js'; import { TransactionDataV1Feessummary403Error } from '../errors/transactionDataV1Feessummary403Error.js'; import { TransactionDataV1Feessummary404Error } from '../errors/transactionDataV1Feessummary404Error.js'; import { TransactionDataV1Feessummary500Error } from '../errors/transactionDataV1Feessummary500Error.js'; import { TransactionDataV1Fuelconsumption400Error } from '../errors/transactionDataV1Fuelconsumption400Error.js'; import { TransactionDataV1Fuelconsumption401Error } from '../errors/transactionDataV1Fuelconsumption401Error.js'; import { TransactionDataV1Fuelconsumption403Error } from '../errors/transactionDataV1Fuelconsumption403Error.js'; import { TransactionDataV1Fuelconsumption404Error } from '../errors/transactionDataV1Fuelconsumption404Error.js'; import { TransactionDataV1Fuelconsumption500Error } from '../errors/transactionDataV1Fuelconsumption500Error.js'; import { TransactionDataV1Multipayerspricedtransactions400Error } from '../errors/transactionDataV1Multipayerspricedtransactions400Error.js'; import { TransactionDataV1Multipayerspricedtransactions401Error } from '../errors/transactionDataV1Multipayerspricedtransactions401Error.js'; import { TransactionDataV1Multipayerspricedtransactions403Error } from '../errors/transactionDataV1Multipayerspricedtransactions403Error.js'; import { TransactionDataV1Multipayerspricedtransactions404Error } from '../errors/transactionDataV1Multipayerspricedtransactions404Error.js'; import { TransactionDataV1Multipayerspricedtransactions500Error } from '../errors/transactionDataV1Multipayerspricedtransactions500Error.js'; import { TransactionDataV1Priced400Error } from '../errors/transactionDataV1Priced400Error.js'; import { TransactionDataV1Priced401Error } from '../errors/transactionDataV1Priced401Error.js'; import { TransactionDataV1Priced403Error } from '../errors/transactionDataV1Priced403Error.js'; import { TransactionDataV1Priced404Error } from '../errors/transactionDataV1Priced404Error.js'; import { TransactionDataV1Priced500Error } from '../errors/transactionDataV1Priced500Error.js'; import { TransactionDataV1Pricedtransaction400Error } from '../errors/transactionDataV1Pricedtransaction400Error.js'; import { TransactionDataV1Pricedtransaction401Error } from '../errors/transactionDataV1Pricedtransaction401Error.js'; import { TransactionDataV1Pricedtransaction403Error } from '../errors/transactionDataV1Pricedtransaction403Error.js'; import { TransactionDataV1Pricedtransaction404Error } from '../errors/transactionDataV1Pricedtransaction404Error.js'; import { TransactionDataV1Pricedtransaction500Error } from '../errors/transactionDataV1Pricedtransaction500Error.js'; import { TransactionDataV1Pricedtransactionssummary400Error } from '../errors/transactionDataV1Pricedtransactionssummary400Error.js'; import { TransactionDataV1Pricedtransactionssummary401Error } from '../errors/transactionDataV1Pricedtransactionssummary401Error.js'; import { TransactionDataV1Pricedtransactionssummary403Error } from '../errors/transactionDataV1Pricedtransactionssummary403Error.js'; import { TransactionDataV1Pricedtransactionssummary404Error } from '../errors/transactionDataV1Pricedtransactionssummary404Error.js'; import { TransactionDataV1Pricedtransactionssummary500Error } from '../errors/transactionDataV1Pricedtransactionssummary500Error.js'; import { TransactionDataV1Recent400Error } from '../errors/transactionDataV1Recent400Error.js'; import { TransactionDataV1Recent401Error } from '../errors/transactionDataV1Recent401Error.js'; import { TransactionDataV1Recent403Error } from '../errors/transactionDataV1Recent403Error.js'; import { TransactionDataV1Recent404Error } from '../errors/transactionDataV1Recent404Error.js'; import { TransactionDataV1Recent500Error } from '../errors/transactionDataV1Recent500Error.js'; import { TransactionDataV1Updateodometer400Error } from '../errors/transactionDataV1Updateodometer400Error.js'; import { TransactionDataV1Updateodometer401Error } from '../errors/transactionDataV1Updateodometer401Error.js'; import { TransactionDataV1Updateodometer403Error } from '../errors/transactionDataV1Updateodometer403Error.js'; import { TransactionDataV1Updateodometer404Error } from '../errors/transactionDataV1Updateodometer404Error.js'; import { TransactionDataV1Updateodometer500Error } from '../errors/transactionDataV1Updateodometer500Error.js'; import { TransactionDataV1Volumebasedbonus400Error } from '../errors/transactionDataV1Volumebasedbonus400Error.js'; import { TransactionDataV1Volumebasedbonus401Error } from '../errors/transactionDataV1Volumebasedbonus401Error.js'; import { TransactionDataV1Volumebasedbonus403Error } from '../errors/transactionDataV1Volumebasedbonus403Error.js'; import { TransactionDataV1Volumebasedbonus404Error } from '../errors/transactionDataV1Volumebasedbonus404Error.js'; import { TransactionDataV1Volumebasedbonus500Error } from '../errors/transactionDataV1Volumebasedbonus500Error.js'; import { TransactionDataV1Volumebasedpricing400Error } from '../errors/transactionDataV1Volumebasedpricing400Error.js'; import { TransactionDataV1Volumebasedpricing401Error } from '../errors/transactionDataV1Volumebasedpricing401Error.js'; import { TransactionDataV1Volumebasedpricing403Error } from '../errors/transactionDataV1Volumebasedpricing403Error.js'; import { TransactionDataV1Volumebasedpricing404Error } from '../errors/transactionDataV1Volumebasedpricing404Error.js'; import { TransactionDataV1Volumebasedpricing500Error } from '../errors/transactionDataV1Volumebasedpricing500Error.js'; export class TransactionController extends BaseController { /** * This API allows querying transaction data (i.e. Priced, Billed and Unbilled sales items). It * provides a flexible search criteria and supports paging. * * * * Transactions that are posted but not yet priced, billed or that are in error will not be returned by * this API. The API also supports returning Fee Items. * * * * #### Supported operations * * * Get sales items and fee transactions * * * Search by invoice status * * * Search by fixed date period * * * Search by date range * * * Search by account * * * Search by card * * * Get sales items only * * * Search by transaction Id or location * * * Search by transaction posting date * * * Search by invoice number or date * * * Search by driver name or vehicle registration number * * * Search by card group * * * Search by fuel only transactions * * * Search by product * * * * This API fetches transactions for a period based on the below parameters and priority order: * * 1. InvoiceNumber * * 2. InvoiceDate * * 3. FromDate, ToDate * * 4. PostingFromDate, PostingToDate (Can be used only when IncludeFees = false) * * 5. InvoiceDateFrom, InvoiceDateTo * * 6. Period * * * * This API considers only one of the above set of parameters at a time. For example, if InvoiceNumber * and Period are provided in the input then Period is ignored and transactions associated to the given * invoice number are returned. * * * * If none of the above parameters are provided then last 7 days transactions will be fetched. * * * * This operation can fetch transactions that are old up to 24 (configurable) months. However, the date * range between any of the ‘From’ and ‘To’ dates in the above combination cannot be more than 210 * (configurable) days. * * * * @param requestId Mandatory UUID (according to RFC 4122 standards) for requests * and responses. This will be played back in the response from the * request. * @param body Priced Transaction Request Body * @return Response from the API call */ async pricedTransactions( requestId: string, body?: PriceTransactionReq, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest( 'POST', '/transaction-data/v1/pricedtransaction' ); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(priceTransactionReqSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Pricedtransaction400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Pricedtransaction401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn(403, TransactionDataV1Pricedtransaction403Error, 'Forbidden'); req.throwOn( 404, TransactionDataV1Pricedtransaction404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Pricedtransaction500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(pricedTransactionResSchema, requestOptions); } /** * This API returns the transaction summary data (i.e. Priced, Billed and Unbilled sales items). It * provides a flexible search criteria. * * The API also supports returning Fee Items. Transactions posted for fee items that are in error are * not included in the summary. * * * * The endpoint supports the exact same search criteria as the endpoint * *transaction/prciedtransactions*. * * * * #### Supported operations * * * Get sales items and fee transactions * * * Search by invoice status * * * Search by fixed date period * * * Search by date range * * * Search by account * * * Search by card * * * Get sales items only * * * Search by transaction Id or location * * * Search by transaction posting date * * * Search by invoice number or date * * * Search by driver name or vehicle registration number * * * Search by card group * * * Search by fuel only transactions * * * Search by product * * * * This API fetches transactions for a period based on the below parameters and priority order: * * 1. InvoiceNumber * * 2. InvoiceDate * * 3. FromDate, ToDate * * 4. PostingFromDate, PostingToDate (Can be used only when IncludeFees = false) * * 5. InvoiceDateFrom, InvoiceDateTo * * 6. Period * * * * This API considers only one of the above set of parameters at a time. For example, if InvoiceNumber * and Period are provided in the input then Period is ignored and transactions associated to the given * invoice number are returned. * * * * If none of the above parameters are provided then last 7 days transactions will be fetched. * * @param requestId Mandatory UUID (according to RFC 4122 standards) for requests * and responses. This will be played back in the response from * the request. * @param body PricedSummary RequestBody * @return Response from the API call */ async pricedTransactionsSummary( requestId: string, body?: PriceTransSummaryReq, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest( 'POST', '/transaction-data/v1/pricedtransactionssummary' ); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(priceTransSummaryReqSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Pricedtransactionssummary400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Pricedtransactionssummary401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn( 403, TransactionDataV1Pricedtransactionssummary403Error, 'Forbidden' ); req.throwOn( 404, TransactionDataV1Pricedtransactionssummary404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Pricedtransactionssummary500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(pricedTransSummaryRespSchema, requestOptions); } /** * This API allows querying transaction data (i.e. Priced, Billed and Unbilled sales items) for * multiple payers. It provides a flexible search criteria and supports paging. * * * * Transactions that are posted but not yet priced, billed or that are in error will not be returned by * this API. The API also supports returning Fee Items. * * * * At least one payer should be provided. Multiple payers must belong to the same payer group. * * * * #### Supported operations * * * Get sales items and fee transactions for multiple payers * * * Search by invoice status * * * Search by fixed date period * * * Search by date range * * * Get sales items only for multiple payers * * * Search by transaction location * * * Search by transaction posting date * * * Search by invoice number or date * * * Search by fuel only transactions * * * * This API fetches transactions for a period based on the below parameters and priority order: * * 1. InvoiceNumber * * 2. InvoiceDate * * 3. FromDate, ToDate * * 4. PostingFromDate, PostingToDate (Can be used only when IncludeFees = false) * * 5. InvoiceDateFrom, InvoiceDateTo * * 6. Period * * * * This API considers only one of the above set of parameters at a time. For example, if InvoiceNumber * and Period are provided in the input then Period is ignored and transactions associated to the given * invoice number are returned. * * * * If none of the above parameters are provided then last 7 days transactions will be fetched. * * @param requestId Mandatory UUID (according to RFC 4122 standards) for * requests and responses. This will be played back in the * response from the request. * @param body MultiPayer RequestBody * @return Response from the API call */ async multipricedTransactions( requestId: string, body?: MultiPricedTransactionReq, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest( 'POST', '/transaction-data/v1/multipayerspricedtransactions' ); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(multiPricedTransactionReqSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Multipayerspricedtransactions400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Multipayerspricedtransactions401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn( 403, TransactionDataV1Multipayerspricedtransactions403Error, 'Forbidden' ); req.throwOn( 404, TransactionDataV1Multipayerspricedtransactions404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Multipayerspricedtransactions500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(multiPricedTransactionResSchema, requestOptions); } /** * This operation is to provide the expenditure analysis for a card for the past 7 months. * The response contains a daily summary of the transactions (billed & unbilled) from 1st of the last 7 * months for the requested card grouped by card, site-group and product. * * @param requestId Mandatory UUID (according to RFC 4122 standards) for requests * and responses. This will be played back in the response from the * request. * @param body Card Usage Summary RequestBody * @return Response from the API call */ async cardUsageSummary( requestId: string, body?: CardUsageSummaryReq, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest( 'POST', '/transaction-data/v1/cardusagesummary' ); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(cardUsageSummaryReqSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Cardusagesummary400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Cardusagesummary401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn(403, TransactionDataV1Cardusagesummary403Error, 'Forbidden'); req.throwOn( 404, TransactionDataV1Cardusagesummary404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Cardusagesummary500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(cardUsageSummaryResSchema, requestOptions); } /** * - This API provides the details of the bonus and/or association bonus rules setup for the given * payer and that are active on the current date. * - This API also returns the details of the monthly breakup of current period consumption as well as * the details of the previously calculated bonus and consumption of the applicable payers. * * * * @param requestId Mandatory UUID (according to RFC 4122 standards) for requests * and responses. This will be played back in the response from the * request. * @param body VolumeBasedBonus RequestBody * @return Response from the API call */ async volumeBasedBonus( requestId: string, body?: VolumeBasedBonusReq, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest( 'POST', '/transaction-data/v1/volumebasedbonus' ); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(volumeBasedBonusReqSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Volumebasedbonus400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Volumebasedbonus401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn(403, TransactionDataV1Volumebasedbonus403Error, 'Forbidden'); req.throwOn( 404, TransactionDataV1Volumebasedbonus404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Volumebasedbonus500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(volumeBasedBonusResSchema, requestOptions); } /** * - This API will return the details of the in arrear fee rule applied to the payer along with details * of locations, products, tiers as applied. * * - It will also show historical and current volume consumption and related tier applied for the * following month. * * * * @param requestId Mandatory UUID (according to RFC 4122 standards) for requests * and responses. This will be played back in the response from * the request. * @param body VolumeBasedPricing RequestBody * @return Response from the API call */ async volumeBasedPricing( requestId: string, body?: VolumeBasedPricingReq, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest( 'POST', '/transaction-data/v1/volumebasedpricing' ); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(volumeBasedPricingReqSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Volumebasedpricing400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Volumebasedpricing401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn(403, TransactionDataV1Volumebasedpricing403Error, 'Forbidden'); req.throwOn( 404, TransactionDataV1Volumebasedpricing404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Volumebasedpricing500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(volumeBasedPricingResSchema, requestOptions); } /** * This API returns the fee/charges levied from a customer's account in a billing period or date range. * The API returns both billed and unbilled fee items. * * * * To get the summary of charges, the endpoint *transaction/feessummary* should be called with the same * input criteria. * * * * #### Supported operations * * * Get fees by invoice status * * * Get fees by date period * * * Get fees by account * * * Get fees by card Id or PAN * * * Get fees by fee type charges * * * Get fees including cancelled items * * * Get fees by line item description * * * Get fees by product * * @param requestId Mandatory UUID (according to RFC 4122 standards) for requests * and responses. This will be played back in the response from the * request. * @param body Transaction Fees RequestBody * @return Response from the API call */ async fees( requestId: string, body?: TransactionFeesReq, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('POST', '/transaction-data/v1/fees'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(transactionFeesReqSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Fees400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Fees401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn(403, TransactionDataV1Fees403Error, 'Forbidden'); req.throwOn( 404, TransactionDataV1Fees404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Fees500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(transactionFeesResSchema, requestOptions); } /** * This API returns the summary data of the fee/charges levied from a customer's account in a billing * period or date range. The API returns both billed and unbilled fee items. * * * * The endpoint supports the exact same search criteria as the endpoint *transaction/feessummary*. * * * * #### Supported operations * * * Get fees by invoice status * * * Get fees by date period * * * Get fees by account * * * Get fees by card Id or PAN * * * Get fees by fee type charges * * * Get fees including cancelled items * * * Get fees by line item description * * * Get fees by product * * @param requestId Mandatory UUID (according to RFC 4122 standards) for * requests and responses. This will be played back in the * response from the request. * @param body FeeSummary RequestBody * @return Response from the API call */ async feeSummaryResponse( requestId: string, body?: TransactionFeesSummaryReq, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('POST', '/transaction-data/v1/feessummary'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(transactionFeesSummaryReqSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Feessummary400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Feessummary401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn(403, TransactionDataV1Feessummary403Error, 'Forbidden'); req.throwOn( 404, TransactionDataV1Feessummary404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Feessummary500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(feeSummaryResponseSchema, requestOptions); } /** * - This API returns the customer an overview of how many transactions, how much fuel volume used over * a given period and the total volume used by a card * * - This operation response will contains card & transaction details for given period aggregated by * payer, account, cardGroup, PAN, DriverName and VRN * * * * @param requestId Mandatory UUID (according to RFC 4122 standards) for requests * and responses. This will be played back in the response from the * request. * @param body FuelConsumption RequestBody * @return Response from the API call */ async fuelConsumption( requestId: string, body?: FuelConsumptionReq, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest( 'POST', '/transaction-data/v1/fuelconsumption' ); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(fuelConsumptionReqSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Fuelconsumption400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Fuelconsumption401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn(403, TransactionDataV1Fuelconsumption403Error, 'Forbidden'); req.throwOn( 404, TransactionDataV1Fuelconsumption404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Fuelconsumption500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(fuelConsumptionResponseSchema, requestOptions); } /** * - This API allows the users to update the odometer readings on the sales items (transaction data) * * - This is an asynchronous operation. If opted, the user will be notified on completion of processing. * * @param requestId Mandatory UUID (according to RFC 4122 standards) for requests * and responses. This will be played back in the response from * the request. * @param body updateOdometer RequestBody * @return Response from the API call */ async updateOdometer( requestId: string, body?: UpdateOdometerRequest, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest( 'POST', '/transaction-data/v1/updateodometer' ); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(updateOdometerRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Updateodometer400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Updateodometer401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn(403, TransactionDataV1Updateodometer403Error, 'Forbidden'); req.throwOn( 404, TransactionDataV1Updateodometer404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Updateodometer500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(updateOdometerRespSchema, requestOptions); } /** * - This API provides the details of the Cards or Transaction related exceptions based on the given * conditions for the Requested period. * - This API will return the Transactions related exceptions when the OutputType input parameter is * passed as ‘Transaction’ else will return the Cards related exceptions. * * * * @param requestId Mandatory UUID (according to RFC 4122 standards) for * requests and responses. This will be played back in the * response from the request. * @param body Transaction Exceptions RequestBody * @return Response from the API call */ async transactionExceptions( requestId: string, body?: TransactionExceptionsReq, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('POST', '/transaction-data/v1/exceptions'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(transactionExceptionsReqSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Exceptions400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Exceptions401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn(403, TransactionDataV1Exceptions403Error, 'Forbidden'); req.throwOn( 404, TransactionDataV1Exceptions404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Exceptions500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(transactionExceptionsResSchema, requestOptions); } /** * This endpoint allows querying last 48 hours of transaction data of Shell Card (i.e. Priced, Billed, * Unbilled etc. sales items). It provides a flexible search criteria and supports pagination. E.g., if * the request is made at 08:30 AM on 18 Aug 2022 then transactions until 16 Aug 2022 08:30 AM * (including) can be retrieved. * * * #### Supported operations * * * Search by Date and Time range (within the last 48 hours only) * * * Search by Payer and/or Account number * * * Search by Card * * * Search by Purchased Country * * * Search by Transaction posting date * * * Search by Driver Name or Vehicle registration number * * * Search by Fuel only transactions * * * Search by Product and/or Product group * * @param requestId Mandatory UUID (according to RFC 4122 standards) for * requests and responses. This will be played back in the * response from the request. * @param body New Recent Transaction RequestBody * @return Response from the API call */ async recentTransactionsNew( requestId: string, body?: RecentTransactionRequest, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('POST', '/transaction-data/v1/recent'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(recentTransactionRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Recent400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Recent401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn(403, TransactionDataV1Recent403Error, 'Forbidden'); req.throwOn( 404, TransactionDataV1Recent404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Recent500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(recentTransactionsResponseSchema, requestOptions); } /** * This API allows querying transaction data (i.e. Priced, Billed and Unbilled sales items). It * provides a flexible search criteria and supports paging. * * The version 2 is an enhancement to the version 1 where EV transactions and their details are added * in the response. * * * * Transactions that are posted but not yet priced, billed or that are in error will not be returned by * this API. The API also supports returning Fee Items. * * * * #### Supported operations * * * Get sales items and fee transactions * * * Search by invoice status * * * Search by fixed date period * * * Search by date range * * * Search by account * * * Search by card * * * Get sales items only * * * Search by transaction Id or location * * * Search by transaction posting date * * * Search by invoice number or date * * * Search by driver name or vehicle registration number * * * Search by card group * * * Search by fuel only transactions * * * Search by product * * * EV transaction details - Below are EV specific parameters * * * EVOperator * * * EVSerialId * * * EVChargePointSerial * * * EVChargePointConnectorType * * * EVChargePointConnectorTypeDescription * * * EVChargeDuration * * * EVChargeStartDate * * * EVChargeStartTime * * * EVChargeEndDate * * * EVChargeEndTime * * @param requestId Mandatory UUID (according to RFC 4122 standards) for * requests and responses. This will be played back in the * response from the request. * @param body Priced TransactionV2 RequestBody * @return Response from the API call */ async pricedTransactionsV2( requestId: string, body?: PricedTransactionRequestV2, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('POST', '/transaction-data/v1/priced'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(pricedTransactionRequestV2Schema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn( 400, TransactionDataV1Priced400Error, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).' ); req.throwOn( 401, TransactionDataV1Priced401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.' ); req.throwOn(403, TransactionDataV1Priced403Error, 'Forbidden'); req.throwOn( 404, TransactionDataV1Priced404Error, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.' ); req.throwOn( 500, TransactionDataV1Priced500Error, 'The server encountered an unexpected condition that prevented it from fulfilling the request.' ); req.authenticate([{ bearerToken: true }]); return req.callAsJson(pricedTransactionResponseV2Schema, requestOptions); } }