UNPKG

card-management-sdk

Version:

The Shell Card Management API is REST-based and employs OAUTH 2.0,Basic and ApiKey authentication. The API endpoints accept JSON-encoded request bodies, return JSON-encoded responses and use standard HTTP response codes. All resources are located in the S

327 lines (326 loc) 18.1 kB
/** * Shell Card Management APIsLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { ApiResponse, RequestOptions } from '../core'; import { AccountRestrictionRequest } from '../models/accountRestrictionRequest'; import { AccountRestrictionResponse } from '../models/accountRestrictionResponse'; import { BudleDetailsRequest } from '../models/budleDetailsRequest'; import { BundleDetailsResponse } from '../models/bundleDetailsResponse'; import { CardRestrictionReq } from '../models/cardRestrictionReq'; import { CardRestrictionResponse } from '../models/cardRestrictionResponse'; import { CreateBundleRequest } from '../models/createBundleRequest'; import { CreateBundleResponse } from '../models/createBundleResponse'; import { DeleteBundleRequest } from '../models/deleteBundleRequest'; import { DeleteBundleResponse } from '../models/deleteBundleResponse'; import { SearchAccountLimitRequest } from '../models/searchAccountLimitRequest'; import { SearchAccountLimitResponse } from '../models/searchAccountLimitResponse'; import { SearchCardRestrictionReq } from '../models/searchCardRestrictionReq'; import { SearchCardRestrictionRes } from '../models/searchCardRestrictionRes'; import { SummaryofbundleResponse } from '../models/summaryofbundleResponse'; import { SummaryofbundlerRequest } from '../models/summaryofbundlerRequest'; import { UpdateBundleRequest } from '../models/updateBundleRequest'; import { UpdateBundleResponse } from '../models/updateBundleResponse'; import { BaseController } from './baseController'; export declare class RestrictionController extends BaseController { /** * This API will allows querying card details including the day/time and product restrictions. * #### Supported operations * * * Search by list of cards or bundle * * * Include card bundle details (optional) * * * * @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 Restriction search card request body * @return Response from the API call */ searchCardRestriction(apikey: string, requestId: string, body?: SearchCardRestrictionReq, requestOptions?: RequestOptions): Promise<ApiResponse<SearchCardRestrictionRes>>; /** * The Card Limit and Restriction API is REST-based and employs Basic and ApiKey authentication. The * API endpoints accept JSON-encoded request bodies, return JSON-encoded responses and use standard * HTTP response codes. * * * * All resources are located in the Shell Card Platform. The Shell Card Platform is the overall * platform that encompasses all the internal Shell systems used to manage resources. The internal * workings of the platform are not important when interacting with the API. However, it is worth * noting that the platform uses a microservice architecture to communicate with various backend * systems and some API calls are processed asynchronously. * * * * All endpoints use the `POST` verb for retrieving, updating, creating and deleting resources in the * Shell Card Platform. The endpoints that retrieve resources from the Shell Card Platform allow * flexible search parameters in the API request body. * * * * **Important Note** - This operation allows setting or updating the restrictions on existing cards. * (For up to 3 cards in a single call). * * * * All restrictions of the cards are submitted and executed after successful below condition. * * • The card exists. * * • Day time restriction cannot be set to restrict the use of a card on all days of the week i.e., * the values for all the days in the restriction cannot be set to false. * * • Either of the usage, daytime, location or product restriction ‘Reset’ is set to ‘True’ or * applied on the card. * * • All the limits in the usage restriction profile for a card is not set to ‘0’/null. * * • If IsVelocityCeiling is ‘true’, API will validate below condition: * * Usage restrictions for a card are lower than Customer Card Type level limits, if there are no * customer level overrides available then lower than OU card type limits. * * • In usage restrictions, the limits per transaction should be less than or equal to Daily, Daily * should be less than or equal to Weekly, Weekly should be less than or equal to Monthly, Monthly * should be less than or equal to Yearly (Annually). Exception being null/blank will be skipped. i.e., * Daily value should be less than equal to Monthly value if Weekly value is null/blank. Lifetime limit * is not considered for usage restrictions limits validation. * * • Apply the card type limit to Gateway when a value is NULL in the input. However, if the card * type limit is NULL for the same field, then no limit will be applied in Gateway. * * • If ‘SetDefaultOnVelocityUpdate’ is ‘true’ then the operation will apply customer cardtype or OU * level velocity limits on existing cards when restrictions are modified without providing custom * values for all fields. * * * * @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 Restriction request body * @return Response from the API call */ applyRestriction(apikey: string, requestId: string, body?: CardRestrictionReq, requestOptions?: RequestOptions): Promise<ApiResponse<CardRestrictionResponse>>; /** * This API enables clients to create a new card bundle and apply restrictions. * * #### Supported operations * * * Create bundle and include mandatory - * * * Usage, day/time, product and location restrictions * * * List of cards to add to bundle * * * Create bundle and include optional identifier of bundle in external system * * #### Validation rules * * The following are the key validation rules with the associated error codes for failed validation- * * * `7012` - At least one card must be added to the bundle * * * `7011` - The total number of cards passed in the input must be 500 or less. * * * `7014` - All the cards passed in the input are part of the selected account. * * * `7013` - At least one restriction must be applied to the bundle i.e. either of usage, day/time, * location or product restriction. * * * `7005` - Day time restriction cannot be set to restrict the use of a card on all days of the * week. * * * `7000` - Usage restriction of the bundle is not open ended i.e. all the limits within the usage * restriction must not be set to 0/null. * * * `7004` - In the usage restrictions, the limits per transaction should be less than or equal to * Daily, Daily should be less than or equal to Weekly, Weekly should be less than or equal to Monthly. * Exception being 0/blank will be skipped, i.e. Daily value should be less than equal to Monthly value * if Weekly value is 0/blank. * * * `0007` - Error returned if request parameters fail validation e.g. mandatory check. * * @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 CreateBundle request body * @return Response from the API call */ createBundle(apikey: string, requestId: string, body?: CreateBundleRequest, requestOptions?: RequestOptions): Promise<ApiResponse<CreateBundleResponse>>; /** * This API enables clients to update an existing card bundle and its associated restrictions. * * #### Supported operations * * * Add new cards to an existing bundle * * * Remove cards from existing bundle * * * Update restrictions applied to existing bundle * * * * The following are the key validation rules with the associated error codes for failed validation- * * * #### Validation rules * * * `9007` - The cards must exist in the cards platform for adding or removing cards. * * * `7014` - All the cards passed in the input are part of the selected account. * * * `7018` - All the cards passed in the input are part of the selected bundle. * * * `7011` - The total number of cards passed in the input must be 500 or less. * * * `7012` - The action to remove cards should not result in removing all the cards from the bundle. * * * `7016` - At least one restriction must be modified for “Update†request action. * * * `7013` - All restrictions cannot be marked for “Reset†for “Update†request action. * * * `7005` - Day time restriction cannot be set to restrict the use of a card on all days of the * week. This validation is applicable for Update request action. * * * `7000` - Usage restriction of the bundle is not open ended i.e., all the limits within the * usage restriction must not be set to 0/null. This validation is applicable for Update request action. * * * `7004` - In the usage restrictions, the limits per transaction should be less than or equal to * Daily, Daily should be less than or equal to Weekly, Weekly should be less than or equal to Monthly. * Exception being 0/blank will be skipped, i.e., Daily value should be less than equal to Monthly * value if Weekly value is 0/blank. This validation is applicable for Update request action. * * * `0007` - Error returned if request parameters fail validation e.g. at least one card must be * provided in the input. * * @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 Update Bundle request body * @return Response from the API call */ updateBundle(apikey: string, requestId: string, body?: UpdateBundleRequest, requestOptions?: RequestOptions): Promise<ApiResponse<UpdateBundleResponse>>; /** * This API enables clients to delete an existing card bundle in the Shell Card Platform. Once the card * bundle is deleted the usage and product restrictions of the cards that were present in the bundle * will be reset based on the request. * * #### Supported operations * * * Delete card bundle by bundle Id * * #### Validation rules * * The following are the key validation rules with the associated error codes for failed validation- * * * `7019` - The given card bundle is not available in the Shell Card Platform. * * * `0007` - Error returned if request parameters fail validation e.g. mandatory check. * * @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 Update Bundle request body * @return Response from the API call */ deleteBundle(apikey: string, requestId: string, body?: DeleteBundleRequest, requestOptions?: RequestOptions): Promise<ApiResponse<DeleteBundleResponse>>; /** * This API allows clients to get a summary of card bundles associated with Payer/Account. This API * will return the basic bundle details including card and restriction details. Optionally the API will * also include a count of cards that are not associated with the bundle but returned by the search * criteria. * * * Note - to include count of cards of an account that are not associated with any bundles, in the * input parameter SearchCardBundles either pass all the bundles of the account in the list or pass * only account with bundle id left blank/null. * * * #### Supported operations * * * Get summary of bundles by list of bundle Ids * * @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 Summary of Bundle request body * @return Response from the API call */ summaryOfBundles(apikey: string, requestId: string, body?: SummaryofbundlerRequest, requestOptions?: RequestOptions): Promise<ApiResponse<SummaryofbundleResponse>>; /** * This API allows setting or updating the usage restrictions of an existing account. * * * * Then validation rules applied for this API. * * * * • The account exists. * * • Day time restriction cannot be set to restrict the use of a card, under the account, on all * days of the week. * * • Either of the usage, daytime or location is either marked for reset or new restriction values * provided for the account. * * • In usage restrictions, the limits per transaction should be less than or equal to Daily, Daily * should be less than or equal to Weekly, Weekly should be less than or equal to Monthly. Exception * being 0/blank will be skipped, i.e., Daily value should be less than equal to Monthly value if * Weekly value is 0/blank. * * * * @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 Account Restriction request body * @return Response from the API call */ restrictionAccount(apikey: string, requestId: string, body?: AccountRestrictionRequest, requestOptions?: RequestOptions): Promise<ApiResponse<AccountRestrictionResponse>>; /** * This API will allow user to get account level limits for the given account. It returns the velocity * limits if its overridden at the account else the values will be null/empty. * * @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 Search Account Limit RequestBody * @return Response from the API call */ searchAccountLimit(apikey: string, requestId: string, body?: SearchAccountLimitRequest, requestOptions?: RequestOptions): Promise<ApiResponse<SearchAccountLimitResponse>>; /** * This API allows to get the details of a specific card bundle. It returns the bundle basic details * along with the cards in the bundle and restrictions applied on them. * * @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 Bundle Details Request body * @return Response from the API call */ bundleDetails(apikey: string, requestId: string, body?: BudleDetailsRequest, requestOptions?: RequestOptions): Promise<ApiResponse<BundleDetailsResponse>>; }