UNPKG

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

395 lines 26.2 kB
"use strict"; /** * Shell Data & Reporting APIsLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ Object.defineProperty(exports, "__esModule", { value: true }); exports.InvoiceController = void 0; var tslib_1 = require("tslib"); var eIDDocumentResponse_js_1 = require("../models/eIDDocumentResponse.js"); var eIDDownloadRequest_js_1 = require("../models/eIDDownloadRequest.js"); var eIDSearchRequest_js_1 = require("../models/eIDSearchRequest.js"); var invoiceDatesRequest_js_1 = require("../models/invoiceDatesRequest.js"); var invoiceDatesResponseData_js_1 = require("../models/invoiceDatesResponseData.js"); var invoiceDownloadRequest_js_1 = require("../models/invoiceDownloadRequest.js"); var invoiceSearchRequest_js_1 = require("../models/invoiceSearchRequest.js"); var invoiceSearchResponse_js_1 = require("../models/invoiceSearchResponse.js"); var invoiceSummaryRequest_js_1 = require("../models/invoiceSummaryRequest.js"); var invoiceSummaryResponse_js_1 = require("../models/invoiceSummaryResponse.js"); var searchDocumentsRequest_js_1 = require("../models/searchDocumentsRequest.js"); var searchDocumentsResponse_js_1 = require("../models/searchDocumentsResponse.js"); var searchStatementOfAccountRequest_js_1 = require("../models/searchStatementOfAccountRequest.js"); var searchStatementOfAccountResponse_js_1 = require("../models/searchStatementOfAccountResponse.js"); var statementOfAccountRequest_js_1 = require("../models/statementOfAccountRequest.js"); var statementOfAccountResponse_js_1 = require("../models/statementOfAccountResponse.js"); var schema_js_1 = require("../schema.js"); var baseController_js_1 = require("./baseController.js"); var errorObjectError_js_1 = require("../errors/errorObjectError.js"); var InvoiceController = /** @class */ (function (_super) { tslib_1.__extends(InvoiceController, _super); function InvoiceController() { return _super !== null && _super.apply(this, arguments) || this; } /** * This API allows to search invoice data in the Shell Card Platform. It provides flexible search * criteria in the request body and supports paging. * * * * This API will also query the relevant invoice documents list and return a reference number that can * be used to download invoice documents (PDF and Proofing elements in a zip file). * * * * #### Supported operations * * * Search invoices by account * * * Search invoices by invoice type or invoice status * * * Search invoices by invoice id or number * * * Search invoices by invoiced country * * * Search invoices including einvoices * * * Search invoices by summary document * * * Search invoices by statement of account * * * Search invoices by fixed and custom date periods * * @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 Invoice Search RequestBody * @return Response from the API call */ InvoiceController.prototype.invoiceSearch = 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', '/invoice-management/v1/search'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_js_1.string)()], body: [body, (0, schema_js_1.optional)(invoiceSearchRequest_js_1.invoiceSearchRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, errorObjectError_js_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_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden'); req.throwOn(404, errorObjectError_js_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_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return [2 /*return*/, req.callAsJson(invoiceSearchResponse_js_1.invoiceSearchResponseSchema, requestOptions)]; }); }); }; /** * This API returns the high level summary of invoices that match the given search criteria. The same * search criteria as the endpoint `/v1/invoice/search` is supported with the exception of paging * related parameters. * * * * * * #### Supported operations * * * Search invoices by account * * * Search invoices by invoice type or invoice status * * * Search invoices by invoice id or number * * * Search invoices by invoiced country * * * Search invoices including einvoices * * * Search invoices by summary document * * * Search invoices by statement of account * * * Search invoices by fixed and custom date periods * * @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 Invoice Search RequestBody * @return Response from the API call */ InvoiceController.prototype.invoiceSummary = 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', '/invoice-management/v1/summary'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_js_1.string)()], body: [body, (0, schema_js_1.optional)(invoiceSummaryRequest_js_1.invoiceSummaryRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, errorObjectError_js_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_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden'); req.throwOn(404, errorObjectError_js_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_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return [2 /*return*/, req.callAsJson(invoiceSummaryResponse_js_1.invoiceSummaryResponseSchema, requestOptions)]; }); }); }; /** * This API allows querying the details of the latest statement of account (SOA) generated for a given * Payer. * * * * The endpoint supports querying SOA documents by various input parameters specified in the request * body. * * * * #### Supported operations * * * Search invoice SOA by payer and account * * * Search invoice SOA including monthly trend (last 13 months invocie trend summary) * * * Search invoice SOA including past SOAs * * * Search invoice SOA including due/overdue documents * * * Search invoice SOA including invoice summary * * @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 StatementOfAccount RequestBody * @return Response from the API call */ InvoiceController.prototype.statementOfAccount = 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', '/invoice-management/v1/statementofaccount'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_js_1.string)()], body: [body, (0, schema_js_1.optional)(statementOfAccountRequest_js_1.statementOfAccountRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, errorObjectError_js_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_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden'); req.throwOn(404, errorObjectError_js_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_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return [2 /*return*/, req.callAsJson(statementOfAccountResponse_js_1.statementOfAccountResponseSchema, requestOptions)]; }); }); }; /** * - This API will return the list of Invoice Dates and Numbers for the given date range. If the dates * are not provided then it will fetch the data for past 13 months. * * @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 StatementOfAccount RequestBody * @return Response from the API call */ InvoiceController.prototype.dates = 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', '/invoice-management/v1/dates'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_js_1.string)()], body: [body, (0, schema_js_1.optional)(invoiceDatesRequest_js_1.invoiceDatesRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, errorObjectError_js_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_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden'); req.throwOn(404, errorObjectError_js_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_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return [2 /*return*/, req.callAsJson(invoiceDatesResponseData_js_1.invoiceDatesResponseDataSchema, requestOptions)]; }); }); }; /** * - This API will allow querying of SOA from different systems * * @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 searchstatementofaccount RequestBody * @return Response from the API call */ InvoiceController.prototype.searchStatementOfAccount = 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', '/invoice-management/v1/searchstatementofaccount'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_js_1.string)()], body: [body, (0, schema_js_1.optional)(searchStatementOfAccountRequest_js_1.searchStatementOfAccountRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, errorObjectError_js_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_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden'); req.throwOn(404, errorObjectError_js_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_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return [2 /*return*/, req.callAsJson(searchStatementOfAccountResponse_js_1.searchStatementOfAccountResponseSchema, requestOptions)]; }); }); }; /** * - This API allows querying the details of all invoices successfully uploaded to the Worldline * invoice repository and file reference numbers for downloading. * * @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 SearchDocuments RequestBody * @return Response from the API call */ InvoiceController.prototype.searchDocuments = 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', '/invoice-management/v1/searchdocuments'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_js_1.string)()], body: [body, (0, schema_js_1.optional)(searchDocumentsRequest_js_1.searchDocumentsRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, errorObjectError_js_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_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden'); req.throwOn(404, errorObjectError_js_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_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return [2 /*return*/, req.callAsJson(searchDocumentsResponse_js_1.searchDocumentsResponseSchema, requestOptions)]; }); }); }; /** * - This API provides the functionality needed for the screen “EID FILES” in the web interface. It * allows retrieving a list of EIDs based on search criteria. * * @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 EIDSearch RequestBody * @return Response from the API call */ InvoiceController.prototype.eidSearch = 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', '/invoice-management/v1/eidsearch'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_js_1.string)()], body: [body, (0, schema_js_1.optional)(eIDSearchRequest_js_1.eIDSearchRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, errorObjectError_js_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_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden'); req.throwOn(404, errorObjectError_js_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_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return [2 /*return*/, req.callAsJson(eIDDocumentResponse_js_1.eIDDocumentResponseSchema, requestOptions)]; }); }); }; /** * - This API downloads Invoice Documents i.e., ZIP file with Invoice PDF file and Proofing Elements in * XML format from invoice repository. * * @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 Invoice Download RequestBody * @return Response from the API call */ InvoiceController.prototype.download = 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', '/invoice-management/v1/download'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_js_1.string)()], body: [body, (0, schema_js_1.optional)(invoiceDownloadRequest_js_1.invoiceDownloadRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, errorObjectError_js_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_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden'); req.throwOn(404, errorObjectError_js_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_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return [2 /*return*/, req.callAsStream(requestOptions)]; }); }); }; /** * - This service allows downloading one or more EID documents and the corresponding signature material * (where applicable) in one single request * * - The number of EID that can be downloaded at once is limited to 100 documents. * * * * @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 EIDInvoice Download RequestBody * @return Response from the API call */ InvoiceController.prototype.eidDownload = 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', '/invoice-management/v1/eiddownload'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_js_1.string)()], body: [body, (0, schema_js_1.optional)(eIDDownloadRequest_js_1.eIDDownloadRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, errorObjectError_js_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_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden'); req.throwOn(404, errorObjectError_js_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_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return [2 /*return*/, req.callAsStream(requestOptions)]; }); }); }; return InvoiceController; }(baseController_js_1.BaseController)); exports.InvoiceController = InvoiceController; //# sourceMappingURL=invoiceController.js.map