data-and-reporting-sdk
Version:
Data And Reporting product consists of API's which provides details of transaction and invoice informations about shell cards. The Shell Card Transaction and Invoice API is REST-based and employs Basic authentication in Version 1 and Oauth authentication
854 lines • 48.4 kB
JavaScript
"use strict";
/**
* Shell Data & Reporting APIsLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
exports.__esModule = true;
exports.TransactionController = void 0;
var tslib_1 = require("tslib");
var cardUsageSummaryRequest_1 = require("../models/cardUsageSummaryRequest");
var cardUsageSummaryResponse_1 = require("../models/cardUsageSummaryResponse");
var feeSummaryResponse_1 = require("../models/feeSummaryResponse");
var fuelConsumptionRequest_1 = require("../models/fuelConsumptionRequest");
var fuelConsumptionResponse_1 = require("../models/fuelConsumptionResponse");
var multiPricedTransactionRequest_1 = require("../models/multiPricedTransactionRequest");
var multiPricedTransactionResponse_1 = require("../models/multiPricedTransactionResponse");
var pricedTransactionRequestV2_1 = require("../models/pricedTransactionRequestV2");
var pricedTransactionResponse_1 = require("../models/pricedTransactionResponse");
var pricedTransactionResponseV2_1 = require("../models/pricedTransactionResponseV2");
var pricedTransSummaryResponse_1 = require("../models/pricedTransSummaryResponse");
var priceTransactionRequest_1 = require("../models/priceTransactionRequest");
var priceTransSummaryRequest_1 = require("../models/priceTransSummaryRequest");
var recentTransactionRequest_1 = require("../models/recentTransactionRequest");
var recentTransactionsResponse_1 = require("../models/recentTransactionsResponse");
var transactionExceptionsRequest_1 = require("../models/transactionExceptionsRequest");
var transactionExceptionsResponse_1 = require("../models/transactionExceptionsResponse");
var transactionFeesRequest_1 = require("../models/transactionFeesRequest");
var transactionFeesResponse_1 = require("../models/transactionFeesResponse");
var updateOdometerRequest_1 = require("../models/updateOdometerRequest");
var updateOdometerResponse_1 = require("../models/updateOdometerResponse");
var volumeBasedBonusRequest_1 = require("../models/volumeBasedBonusRequest");
var volumeBasedBonusResponse_1 = require("../models/volumeBasedBonusResponse");
var volumeBasedPricingRequest_1 = require("../models/volumeBasedPricingRequest");
var volumeBasedPricingResponse_1 = require("../models/volumeBasedPricingResponse");
var schema_1 = require("../schema");
var baseController_1 = require("./baseController");
var defaultError_1 = require("../errors/defaultError");
var errorObjectError_1 = require("../errors/errorObjectError");
var errorUserAccessError1Error_1 = require("../errors/errorUserAccessError1Error");
var TransactionController = /** @class */ (function (_super) {
tslib_1.__extends(TransactionController, _super);
function TransactionController() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* 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 apikey This is the API key of the specific environment which needs
* to be passed by the client.
* @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
*/
TransactionController.prototype.pricedTransactions = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/transaction/pricedtransactions');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(priceTransactionRequest_1.priceTransactionRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, defaultError_1.DefaultError, 'The server cannot or will not process the request due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).');
req.throwOn(401, defaultError_1.DefaultError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorUserAccessError1Error_1.ErrorUserAccessError1Error, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, defaultError_1.DefaultError, '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, defaultError_1.DefaultError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(pricedTransactionResponse_1.pricedTransactionResponseSchema, 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 apikey This is the API key of the specific environment which
* needs to be passed by the client.
* @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
*/
TransactionController.prototype.pricedTransactionsSummary = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/transaction/pricedtransactionssummary');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(priceTransSummaryRequest_1.priceTransSummaryRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, defaultError_1.DefaultError, 'The server cannot or will not process the request due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).');
req.throwOn(401, defaultError_1.DefaultError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorUserAccessError1Error_1.ErrorUserAccessError1Error, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, defaultError_1.DefaultError, '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, defaultError_1.DefaultError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(pricedTransSummaryResponse_1.pricedTransSummaryResponseSchema, 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 apikey This is the API key of the specific environment which
* needs to be passed by the client.
* @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
*/
TransactionController.prototype.multipricedTransactions = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/transaction/multipayerspricedtransactions');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(multiPricedTransactionRequest_1.multiPricedTransactionRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, defaultError_1.DefaultError, 'The server cannot or will not process the request due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).');
req.throwOn(401, defaultError_1.DefaultError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorUserAccessError1Error_1.ErrorUserAccessError1Error, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, defaultError_1.DefaultError, '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, defaultError_1.DefaultError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(multiPricedTransactionResponse_1.multiPricedTransactionResponseSchema, 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 apikey This is the API key of the specific environment which needs
* to be passed by the client.
* @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
*/
TransactionController.prototype.cardUsageSummary = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/transaction/cardusagesummary');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(cardUsageSummaryRequest_1.cardUsageSummaryRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, defaultError_1.DefaultError, 'The server cannot or will not process the request due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).');
req.throwOn(401, defaultError_1.DefaultError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorUserAccessError1Error_1.ErrorUserAccessError1Error, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, defaultError_1.DefaultError, '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, defaultError_1.DefaultError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(cardUsageSummaryResponse_1.cardUsageSummaryResponseSchema, 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 apikey This is the API key of the specific environment which needs
* to be passed by the client.
* @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
*/
TransactionController.prototype.volumeBasedBonus = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/transaction/volumebasedbonus');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(volumeBasedBonusRequest_1.volumeBasedBonusRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, defaultError_1.DefaultError, 'The server cannot or will not process the request due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).');
req.throwOn(401, defaultError_1.DefaultError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorUserAccessError1Error_1.ErrorUserAccessError1Error, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, defaultError_1.DefaultError, '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, defaultError_1.DefaultError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(volumeBasedBonusResponse_1.volumeBasedBonusResponseSchema, 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 apikey This is the API key of the specific environment which
* needs to be passed by the client.
* @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
*/
TransactionController.prototype.volumeBasedPricing = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/transaction/volumebasedpricing');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(volumeBasedPricingRequest_1.volumeBasedPricingRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, defaultError_1.DefaultError, 'The server cannot or will not process the request due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).');
req.throwOn(401, defaultError_1.DefaultError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorUserAccessError1Error_1.ErrorUserAccessError1Error, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, defaultError_1.DefaultError, '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, defaultError_1.DefaultError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(volumeBasedPricingResponse_1.volumeBasedPricingResponseSchema, 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 apikey This is the API key of the specific environment which needs
* to be passed by the client.
* @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
*/
TransactionController.prototype.fees = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/transaction/fees');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(transactionFeesRequest_1.transactionFeesRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, defaultError_1.DefaultError, 'The server cannot or will not process the request due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).');
req.throwOn(401, defaultError_1.DefaultError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorUserAccessError1Error_1.ErrorUserAccessError1Error, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, defaultError_1.DefaultError, '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, defaultError_1.DefaultError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(transactionFeesResponse_1.transactionFeesResponseSchema, 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 apikey This is the API key of the specific environment which needs
* to be passed by the client.
* @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
*/
TransactionController.prototype.feeSummaryResponse = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/transaction/feessummary');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(transactionFeesRequest_1.transactionFeesRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, defaultError_1.DefaultError, 'The server cannot or will not process the request due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).');
req.throwOn(401, defaultError_1.DefaultError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorUserAccessError1Error_1.ErrorUserAccessError1Error, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, defaultError_1.DefaultError, '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, defaultError_1.DefaultError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(feeSummaryResponse_1.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 apikey This is the API key of the specific environment which needs
* to be passed by the client.
* @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
*/
TransactionController.prototype.fuelConsumption = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/transaction/fuelconsumption');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(fuelConsumptionRequest_1.fuelConsumptionRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, defaultError_1.DefaultError, 'The server cannot or will not process the request due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).');
req.throwOn(401, defaultError_1.DefaultError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorUserAccessError1Error_1.ErrorUserAccessError1Error, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, defaultError_1.DefaultError, '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, defaultError_1.DefaultError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(fuelConsumptionResponse_1.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 apikey This is the API key of the specific environment which needs
* to be passed by the client.
* @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
*/
TransactionController.prototype.updateOdometer = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/transaction/updateodometer');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(updateOdometerRequest_1.updateOdometerRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, defaultError_1.DefaultError, 'The server cannot or will not process the request due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).');
req.throwOn(401, defaultError_1.DefaultError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorUserAccessError1Error_1.ErrorUserAccessError1Error, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, defaultError_1.DefaultError, '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, defaultError_1.DefaultError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(updateOdometerResponse_1.updateOdometerResponseSchema, 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 apikey This is the API key of the specific environment which
* needs to be passed by the client.
* @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
*/
TransactionController.prototype.transactionExceptions = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/transaction/exceptions');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(transactionExceptionsRequest_1.transactionExceptionsRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, defaultError_1.DefaultError, 'The server cannot or will not process the request due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).');
req.throwOn(401, defaultError_1.DefaultError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorUserAccessError1Error_1.ErrorUserAccessError1Error, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, defaultError_1.DefaultError, '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, defaultError_1.DefaultError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(transactionExceptionsResponse_1.transactionExceptionsResponseSchema, 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
*/
TransactionController.prototype.recentTransactionsNew = function (requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/transaction-data/v1/recent');
mapped = req.prepareArgs({
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(recentTransactionRequest_1.recentTransactionRequestSchema)]
});
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, errorObjectError_1.ErrorObjectError, '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, errorObjectError_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorObjectError_1.ErrorObjectError, 'Forbidden');
req.throwOn(404, errorObjectError_1.ErrorObjectError, '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, errorObjectError_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(recentTransactionsResponse_1.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
*/
TransactionController.prototype.pricedTransactionsV2 = function (requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/transaction-data/v1/priced');
mapped = req.prepareArgs({
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(pricedTransactionRequestV2_1.pricedTransactionRequestV2Schema)]
});
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, errorObjectError_1.ErrorObjectError, '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, errorObjectError_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorObjectError_1.ErrorObjectError, 'Forbidden');
req.throwOn(404, errorObjectError_1.ErrorObjectError, '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, errorObjectError_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(pricedTransactionResponseV2_1.pricedTransactionResponseV2Schema, requestOptions)];
});
});
};
return TransactionController;
}(baseController_1.BaseController));
exports.TransactionController = TransactionController;
//# sourceMappingURL=transactionController.js.map