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

340 lines 20.9 kB
/** * Shell Data & Reporting APIsLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { eIDDocumentResponseSchema, } from '../models/eIDDocumentResponse.js'; import { eIDDownloadRequestSchema, } from '../models/eIDDownloadRequest.js'; import { eIDSearchRequestSchema, } from '../models/eIDSearchRequest.js'; import { invoiceDatesRequestSchema, } from '../models/invoiceDatesRequest.js'; import { invoiceDatesResponseDataSchema, } from '../models/invoiceDatesResponseData.js'; import { invoiceDownloadRequestSchema, } from '../models/invoiceDownloadRequest.js'; import { invoiceSearchRequestSchema, } from '../models/invoiceSearchRequest.js'; import { invoiceSearchResponseSchema, } from '../models/invoiceSearchResponse.js'; import { invoiceSummaryRequestSchema, } from '../models/invoiceSummaryRequest.js'; import { invoiceSummaryResponseSchema, } from '../models/invoiceSummaryResponse.js'; import { searchDocumentsRequestSchema, } from '../models/searchDocumentsRequest.js'; import { searchDocumentsResponseSchema, } from '../models/searchDocumentsResponse.js'; import { searchStatementOfAccountRequestSchema, } from '../models/searchStatementOfAccountRequest.js'; import { searchStatementOfAccountResponseSchema, } from '../models/searchStatementOfAccountResponse.js'; import { statementOfAccountRequestSchema, } from '../models/statementOfAccountRequest.js'; import { statementOfAccountResponseSchema, } from '../models/statementOfAccountResponse.js'; import { optional, string } from '../schema.js'; import { BaseController } from './baseController.js'; import { ErrorObjectError } from '../errors/errorObjectError.js'; export class InvoiceController extends BaseController { /** * 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 */ async invoiceSearch(requestId, body, requestOptions) { const req = this.createRequest('POST', '/invoice-management/v1/search'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(invoiceSearchRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, 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, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, ErrorObjectError, 'Forbidden'); req.throwOn(404, 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, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return req.callAsJson(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 */ async invoiceSummary(requestId, body, requestOptions) { const req = this.createRequest('POST', '/invoice-management/v1/summary'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(invoiceSummaryRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, 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, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, ErrorObjectError, 'Forbidden'); req.throwOn(404, 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, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return req.callAsJson(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 */ async statementOfAccount(requestId, body, requestOptions) { const req = this.createRequest('POST', '/invoice-management/v1/statementofaccount'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(statementOfAccountRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, 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, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, ErrorObjectError, 'Forbidden'); req.throwOn(404, 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, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return req.callAsJson(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 */ async dates(requestId, body, requestOptions) { const req = this.createRequest('POST', '/invoice-management/v1/dates'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(invoiceDatesRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, 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, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, ErrorObjectError, 'Forbidden'); req.throwOn(404, 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, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return req.callAsJson(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 */ async searchStatementOfAccount(requestId, body, requestOptions) { const req = this.createRequest('POST', '/invoice-management/v1/searchstatementofaccount'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(searchStatementOfAccountRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, 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, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, ErrorObjectError, 'Forbidden'); req.throwOn(404, 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, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return req.callAsJson(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 */ async searchDocuments(requestId, body, requestOptions) { const req = this.createRequest('POST', '/invoice-management/v1/searchdocuments'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(searchDocumentsRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, 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, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, ErrorObjectError, 'Forbidden'); req.throwOn(404, 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, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return req.callAsJson(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 */ async eidSearch(requestId, body, requestOptions) { const req = this.createRequest('POST', '/invoice-management/v1/eidsearch'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(eIDSearchRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, 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, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, ErrorObjectError, 'Forbidden'); req.throwOn(404, 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, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return req.callAsJson(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 */ async download(requestId, body, requestOptions) { const req = this.createRequest('POST', '/invoice-management/v1/download'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(invoiceDownloadRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, 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, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, ErrorObjectError, 'Forbidden'); req.throwOn(404, 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, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); 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 */ async eidDownload(requestId, body, requestOptions) { const req = this.createRequest('POST', '/invoice-management/v1/eiddownload'); const mapped = req.prepareArgs({ requestId: [requestId, string()], body: [body, optional(eIDDownloadRequestSchema)], }); req.header('RequestId', mapped.requestId); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, 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, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, ErrorObjectError, 'Forbidden'); req.throwOn(404, 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, 'The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ bearerToken: true }]); return req.callAsStream(requestOptions); } } //# sourceMappingURL=invoiceController.js.map