/* tslint:disable */ /* eslint-disable */ /** * Credify API doc version 1 * API documentations version 1. * * The version of the OpenAPI document: 1.0.0-oas3 * Contact: dev@credify.one * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore import { CampaignActor } from '../model'; // @ts-ignore import { CampaignCreateRequest } from '../model'; // @ts-ignore import { CampaignDetailResponse } from '../model'; // @ts-ignore import { CampaignStatusQueryParam } from '../model'; // @ts-ignore import { CampaignUpdateRequest } from '../model'; // @ts-ignore import { CampaignsListResponse } from '../model'; // @ts-ignore import { CommonResponse } from '../model'; // @ts-ignore import { EvaluatedOffersListResponse } from '../model'; // @ts-ignore import { OfferDetailResponse } from '../model'; // @ts-ignore import { OfferEvaluateRequestData } from '../model'; // @ts-ignore import { OfferLevelResponse } from '../model'; // @ts-ignore import { OfferRedeemRequest } from '../model'; // @ts-ignore import { OfferRedeemResponse } from '../model'; // @ts-ignore import { OfferStatus } from '../model'; // @ts-ignore import { OfferTransactionStatusUpdateRequest } from '../model'; // @ts-ignore import { OfferTransactionsListResponse } from '../model'; // @ts-ignore import { OffersListRequest } from '../model'; // @ts-ignore import { UserCountsRequestDto } from '../model'; // @ts-ignore import { UserCountsResponse } from '../model'; /** * OffersApi - axios parameter creator * @export */ export const OffersApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This operation approves a campaign by admin. * @summary Approves campaign by Admin * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ approveCampaignByAdmin: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('approveCampaignByAdmin', 'id', id) const localVarPath = `/v1/offers/campaigns/{id}/approve` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This operation approves an organization\'s offer by claim provider. This can be executed multiple times. If the Service provider wants to show the offer (Activate), then it will call this API. * @summary Approves offer by claim provider * @param {string} id offer id * @param {*} [options] Override http request option. * @throws {RequiredError} */ approveOfferByClaimProvider: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('approveOfferByClaimProvider', 'id', id) const localVarPath = `/v1/offers/{id}/approve` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This operation archives a campaign. Archived campaigns will not be available for end users. * @summary Archive a campaign * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ archiveCampaign: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('archiveCampaign', 'id', id) const localVarPath = `/v1/offers/campaigns/{id}/archive` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This generates a new campaign. * @summary Campaign creation * @param {CampaignCreateRequest} campaignCreateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createCampaign: async (campaignCreateRequest: CampaignCreateRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'campaignCreateRequest' is not null or undefined assertParamExists('createCampaign', 'campaignCreateRequest', campaignCreateRequest) const localVarPath = `/v1/offers/campaigns`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = campaignCreateRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This retrieves a detail of a specified campaign. * @summary Campaign detail * @param {string} id Campaign ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCampaignDetail: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('getCampaignDetail', 'id', id) const localVarPath = `/v1/offers/campaigns/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This will return all the campaigns. `status` represents review status. * @summary Campaigns List for Admin * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCampaignListForAdmin: async (page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/offers/campaigns/admin`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (page !== undefined) { localVarQueryParameter['page'] = page; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (campaignStatus !== undefined) { localVarQueryParameter['campaign_status'] = campaignStatus; } if (offerStatus !== undefined) { localVarQueryParameter['offer_status'] = offerStatus; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This fetches a list of campaigns. Upon a specified `actor`, this response will change the list contents. If the `actor` is `CONSUMER`, which is default, it will return campaigns list generated by this API calling organization. If the `actor` is `PROVIDER`, it will return campaigns that are using API requester\'s scope data. Technically, campaigns that contain this organization inside their offer conditions will be returned, so the response structure will be same as the case of `actor=CONSUMER`. All the campaigns\' statuses are `APPROVED`. `status` represents review status. * @summary Campaigns List for Organization * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {OfferStatus} [offerStatus] Approval status of offers * @param {CampaignActor} [actor] Provider or consumer * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCampaignListForOrg: async (page?: number, limit?: number, offerStatus?: OfferStatus, actor?: CampaignActor, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/offers/campaigns/organization`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (page !== undefined) { localVarQueryParameter['page'] = page; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offerStatus !== undefined) { localVarQueryParameter['offer_status'] = offerStatus; } if (actor !== undefined) { localVarQueryParameter['actor'] = actor; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This fetches a detail data of a specified offer. This is to be called by a Login page. * @summary Offer Detail * @param {string} offerCode Offer Code * @param {boolean} [redeemable] If this is true (default is false) server will validate redeemable or not and return evaluation result and return error if that offer is not redeemable or can\'t evaluate * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferDetail: async (offerCode: string, redeemable?: boolean, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'offerCode' is not null or undefined assertParamExists('getOfferDetail', 'offerCode', offerCode) const localVarPath = `/v1/offers/{offer_code}` .replace(`{${"offer_code"}}`, encodeURIComponent(String(offerCode))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (redeemable !== undefined) { localVarQueryParameter['redeemable'] = redeemable; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Offers list for claim provider * @param {string} [localId] ID in the claim provider * @param {string} [credifyId] ID in Credify * @param {string} [phone] Hashed phone number (`sha256(\"84123456789\")`). This is used to exclude offers that are not available to this user. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferListForClaimProvider: async (localId?: string, credifyId?: string, phone?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/offers`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (localId !== undefined) { localVarQueryParameter['local_id'] = localId; } if (credifyId !== undefined) { localVarQueryParameter['credify_id'] = credifyId; } if (phone !== undefined) { localVarQueryParameter['phone'] = phone; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This returns a list of offer redemption related to this calling individual. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. This API will not return `CANCELED` offer transactions * @summary Offer transactions - Individual * @param {number} [page] * @param {number} [limit] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferTransactionList: async (page?: number, limit?: number, offerCode?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/offers/transactions/individual`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (page !== undefined) { localVarQueryParameter['page'] = page; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offerCode !== undefined) { localVarQueryParameter['offer_code'] = offerCode; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This returns a list of offer redemption related to this calling OIDC client. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Ecosystem * @param {number} [page] * @param {number} [limit] * @param {string} [entityId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferTransactionListForAdmin: async (page?: number, limit?: number, entityId?: string, offerCode?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/offers/transactions/admin`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (page !== undefined) { localVarQueryParameter['page'] = page; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (entityId !== undefined) { localVarQueryParameter['entity_id'] = entityId; } if (offerCode !== undefined) { localVarQueryParameter['offer_code'] = offerCode; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This returns a list of offer redemption related to this calling Market. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Market * @param {number} [page] * @param {number} [limit] * @param {string} [credifyId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferTransactionListForMP: async (page?: number, limit?: number, credifyId?: string, offerCode?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/offers/transactions/market`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (page !== undefined) { localVarQueryParameter['page'] = page; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (credifyId !== undefined) { localVarQueryParameter['credify_id'] = credifyId; } if (offerCode !== undefined) { localVarQueryParameter['offer_code'] = offerCode; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This returns a list of offer redemption related to this calling Service Provider. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Service Provider * @param {number} [page] * @param {number} [limit] * @param {string} [credifyId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferTransactionListForSP: async (page?: number, limit?: number, credifyId?: string, offerCode?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/offers/transactions/service-provider`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (page !== undefined) { localVarQueryParameter['page'] = page; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (credifyId !== undefined) { localVarQueryParameter['credify_id'] = credifyId; } if (offerCode !== undefined) { localVarQueryParameter['offer_code'] = offerCode; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This operation updates the campaign\'s status to draft mode. `published_at` will be null when this API is called. If `published_at` is null, the campaign is recognized as draft status. If Service provider wants to edit a campaign, they have to call this API first. * @summary Makes a campaign draft * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ markCampaignAsDraft: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('markCampaignAsDraft', 'id', id) const localVarPath = `/v1/offers/campaigns/{id}/mark-as-draft` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This operation makes the campaign status `Waiting for approval`. * @summary Marks a campaign ready * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ markCampaignAsReady: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('markCampaignAsReady', 'id', id) const localVarPath = `/v1/offers/campaigns/{id}/mark-as-ready` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This redeems a specified offer. This is to be called by a mobile idPass app. `approval_token` contains `scopes`, which is a list of scopes that users are going to share with the OIDC client. This `scopes` might contain some custom scopes provided by claim providers, and in that case Credify will fetch the custom claim values from the claim provider. `values` has standard claim values in a plain text. * @summary Offer redeem * @param {string} offerCode Offer Code * @param {OfferRedeemRequest} offerRedeemRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ redeemOffer: async (offerCode: string, offerRedeemRequest: OfferRedeemRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'offerCode' is not null or undefined assertParamExists('redeemOffer', 'offerCode', offerCode) // verify required parameter 'offerRedeemRequest' is not null or undefined assertParamExists('redeemOffer', 'offerRedeemRequest', offerRedeemRequest) const localVarPath = `/v1/offers/{offer_code}/redeem` .replace(`{${"offer_code"}}`, encodeURIComponent(String(offerCode))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = offerRedeemRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This operation rejects a campaign by admin. * @summary Rejects campaign by Admin * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ rejectCampaignByAdmin: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('rejectCampaignByAdmin', 'id', id) const localVarPath = `/v1/offers/campaigns/{id}/reject` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This operation rejects an offer by Service provider. This can be executed multiple times. If the Service provider wants to hide the offer, then it will call this API. * @summary Rejects offer by claim provider * @param {string} id offer id * @param {*} [options] Override http request option. * @throws {RequiredError} */ rejectOfferByClaimProvider: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('rejectOfferByClaimProvider', 'id', id) const localVarPath = `/v1/offers/{id}/reject` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This fetches active offers for a requesting individual entity. This requires claims value. The backend will return offers that are qualified to this user based on the connected providers\' data. * @summary Offers list for each user * @param {OffersListRequest} offersListRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestEvaluatedOfferList: async (offersListRequest: OffersListRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'offersListRequest' is not null or undefined assertParamExists('requestEvaluatedOfferList', 'offersListRequest', offersListRequest) const localVarPath = `/v1/offers/me`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = offersListRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This calculates what level of the specified offer is to be unlocked. This is supposed to be called by Credify Login page. If the offer is using an active claim provider\'s data, then `values` will not contain the active claim provider\'s claim values because the actual data sit in the claim provider\'s DB, instead the specified active scope names are to be contained in `scopes` property in the request body. If the offer is using a passive claim provider\'s data, then `values` needs to have actual values. In this docs, `values` in the request body is standard claim values, but it is dynamic upon the user\'s consent. If the user is not going to share `phone`, then the request body should not contain `phone` values. Also, if the user wants to share passive claims (e.g. FinScore score), `finscore` claims should be included in `values`. * @summary Offer Evaluation * @param {OfferEvaluateRequestData} offerEvaluateRequestData * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestOfferEvaluation: async (offerEvaluateRequestData: OfferEvaluateRequestData, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'offerEvaluateRequestData' is not null or undefined assertParamExists('requestOfferEvaluation', 'offerEvaluateRequestData', offerEvaluateRequestData) const localVarPath = `/v1/offers/evaluate`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = offerEvaluateRequestData return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This returns the number of qualified users with specified conditions. * @summary Qualified users count for Service Provider * @param {UserCountsRequestDto} userCountsRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestUserCount: async (userCountsRequestDto: UserCountsRequestDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'userCountsRequestDto' is not null or undefined assertParamExists('requestUserCount', 'userCountsRequestDto', userCountsRequestDto) const localVarPath = `/v1/offers/user-counts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = userCountsRequestDto return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This returns the number of qualified users with specified conditions. This API calls Market\'s API internally. * @summary Qualified users count for Market * @param {UserCountsRequestDto} userCountsRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestUserCountForMarket: async (userCountsRequestDto: UserCountsRequestDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'userCountsRequestDto' is not null or undefined assertParamExists('requestUserCountForMarket', 'userCountsRequestDto', userCountsRequestDto) const localVarPath = `/v1/offers/user-counts/provider`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = userCountsRequestDto return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This updates a campaign. The campaign\'s status needs to be draft mode (`published_at` is null). * @summary Campaign update * @param {string} id Campaign ID * @param {CampaignUpdateRequest} campaignUpdateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateCampaign: async (id: string, campaignUpdateRequest: CampaignUpdateRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('updateCampaign', 'id', id) // verify required parameter 'campaignUpdateRequest' is not null or undefined assertParamExists('updateCampaign', 'campaignUpdateRequest', campaignUpdateRequest) const localVarPath = `/v1/offers/campaigns/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = campaignUpdateRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This operation updates onboarding status of an offer approval. Either the individual user or the service provider can update this status. If this offer redemption is not the first time (a user can redeem the offer many times), the previous pending offer transactions\' status will be `CANCELED` automatically. * @summary Updates an offer redemption for individual * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOfferTransactionStatus: async (id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('updateOfferTransactionStatus', 'id', id) const localVarPath = `/v1/offers/transactions/{id}/status` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = offerTransactionStatusUpdateRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This operation updates onboarding status of an offer approval. Either the individual user or the service provider can update this status. If this offer redemption is not the first time (a user can redeem the offer many times), the previous pending offer transactions\' status will be `CANCELED` automatically. * @summary Updates an offer redemption for oidc client * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOfferTxStatusForOidcClient: async (id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('updateOfferTxStatusForOidcClient', 'id', id) const localVarPath = `/v1/offers/transactions/{id}/status/oidc-client` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = offerTransactionStatusUpdateRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This fetches a list of campaigns. Upon a specified `actor`, this response will change the list contents. If the `actor` is `CONSUMER`, which is default, it will return campaigns list generated by this API calling organization. If the `actor` is `PROVIDER`, it will return campaigns that are using API requester\'s scope data. Technically, campaigns that contain this organization inside their offer conditions will be returned, so the response structure will be same as the case of `actor=CONSUMER`. If the `actor` is `ADMIN`, it will return all the campaigns. `status` represents review status. * @summary Campaigns List * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {CampaignActor} [actor] Provider, consumer, or admin * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ v1OffersCampaignsGet: async (page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, actor?: CampaignActor, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/offers/campaigns`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (page !== undefined) { localVarQueryParameter['page'] = page; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (campaignStatus !== undefined) { localVarQueryParameter['campaign_status'] = campaignStatus; } if (offerStatus !== undefined) { localVarQueryParameter['offer_status'] = offerStatus; } if (actor !== undefined) { localVarQueryParameter['actor'] = actor; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * OffersApi - functional programming interface * @export */ export const OffersApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = OffersApiAxiosParamCreator(configuration) return { /** * This operation approves a campaign by admin. * @summary Approves campaign by Admin * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async approveCampaignByAdmin(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.approveCampaignByAdmin(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This operation approves an organization\'s offer by claim provider. This can be executed multiple times. If the Service provider wants to show the offer (Activate), then it will call this API. * @summary Approves offer by claim provider * @param {string} id offer id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async approveOfferByClaimProvider(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.approveOfferByClaimProvider(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This operation archives a campaign. Archived campaigns will not be available for end users. * @summary Archive a campaign * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async archiveCampaign(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.archiveCampaign(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This generates a new campaign. * @summary Campaign creation * @param {CampaignCreateRequest} campaignCreateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createCampaign(campaignCreateRequest: CampaignCreateRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createCampaign(campaignCreateRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This retrieves a detail of a specified campaign. * @summary Campaign detail * @param {string} id Campaign ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getCampaignDetail(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getCampaignDetail(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This will return all the campaigns. `status` represents review status. * @summary Campaigns List for Admin * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getCampaignListForAdmin(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getCampaignListForAdmin(page, limit, campaignStatus, offerStatus, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This fetches a list of campaigns. Upon a specified `actor`, this response will change the list contents. If the `actor` is `CONSUMER`, which is default, it will return campaigns list generated by this API calling organization. If the `actor` is `PROVIDER`, it will return campaigns that are using API requester\'s scope data. Technically, campaigns that contain this organization inside their offer conditions will be returned, so the response structure will be same as the case of `actor=CONSUMER`. All the campaigns\' statuses are `APPROVED`. `status` represents review status. * @summary Campaigns List for Organization * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {OfferStatus} [offerStatus] Approval status of offers * @param {CampaignActor} [actor] Provider or consumer * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getCampaignListForOrg(page?: number, limit?: number, offerStatus?: OfferStatus, actor?: CampaignActor, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getCampaignListForOrg(page, limit, offerStatus, actor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This fetches a detail data of a specified offer. This is to be called by a Login page. * @summary Offer Detail * @param {string} offerCode Offer Code * @param {boolean} [redeemable] If this is true (default is false) server will validate redeemable or not and return evaluation result and return error if that offer is not redeemable or can\'t evaluate * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOfferDetail(offerCode: string, redeemable?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOfferDetail(offerCode, redeemable, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Offers list for claim provider * @param {string} [localId] ID in the claim provider * @param {string} [credifyId] ID in Credify * @param {string} [phone] Hashed phone number (`sha256(\"84123456789\")`). This is used to exclude offers that are not available to this user. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOfferListForClaimProvider(localId?: string, credifyId?: string, phone?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOfferListForClaimProvider(localId, credifyId, phone, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This returns a list of offer redemption related to this calling individual. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. This API will not return `CANCELED` offer transactions * @summary Offer transactions - Individual * @param {number} [page] * @param {number} [limit] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOfferTransactionList(page?: number, limit?: number, offerCode?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOfferTransactionList(page, limit, offerCode, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This returns a list of offer redemption related to this calling OIDC client. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Ecosystem * @param {number} [page] * @param {number} [limit] * @param {string} [entityId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOfferTransactionListForAdmin(page?: number, limit?: number, entityId?: string, offerCode?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOfferTransactionListForAdmin(page, limit, entityId, offerCode, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This returns a list of offer redemption related to this calling Market. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Market * @param {number} [page] * @param {number} [limit] * @param {string} [credifyId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOfferTransactionListForMP(page?: number, limit?: number, credifyId?: string, offerCode?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOfferTransactionListForMP(page, limit, credifyId, offerCode, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This returns a list of offer redemption related to this calling Service Provider. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Service Provider * @param {number} [page] * @param {number} [limit] * @param {string} [credifyId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOfferTransactionListForSP(page?: number, limit?: number, credifyId?: string, offerCode?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOfferTransactionListForSP(page, limit, credifyId, offerCode, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This operation updates the campaign\'s status to draft mode. `published_at` will be null when this API is called. If `published_at` is null, the campaign is recognized as draft status. If Service provider wants to edit a campaign, they have to call this API first. * @summary Makes a campaign draft * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async markCampaignAsDraft(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.markCampaignAsDraft(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This operation makes the campaign status `Waiting for approval`. * @summary Marks a campaign ready * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async markCampaignAsReady(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.markCampaignAsReady(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This redeems a specified offer. This is to be called by a mobile idPass app. `approval_token` contains `scopes`, which is a list of scopes that users are going to share with the OIDC client. This `scopes` might contain some custom scopes provided by claim providers, and in that case Credify will fetch the custom claim values from the claim provider. `values` has standard claim values in a plain text. * @summary Offer redeem * @param {string} offerCode Offer Code * @param {OfferRedeemRequest} offerRedeemRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async redeemOffer(offerCode: string, offerRedeemRequest: OfferRedeemRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.redeemOffer(offerCode, offerRedeemRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This operation rejects a campaign by admin. * @summary Rejects campaign by Admin * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rejectCampaignByAdmin(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.rejectCampaignByAdmin(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This operation rejects an offer by Service provider. This can be executed multiple times. If the Service provider wants to hide the offer, then it will call this API. * @summary Rejects offer by claim provider * @param {string} id offer id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async rejectOfferByClaimProvider(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.rejectOfferByClaimProvider(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This fetches active offers for a requesting individual entity. This requires claims value. The backend will return offers that are qualified to this user based on the connected providers\' data. * @summary Offers list for each user * @param {OffersListRequest} offersListRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async requestEvaluatedOfferList(offersListRequest: OffersListRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.requestEvaluatedOfferList(offersListRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This calculates what level of the specified offer is to be unlocked. This is supposed to be called by Credify Login page. If the offer is using an active claim provider\'s data, then `values` will not contain the active claim provider\'s claim values because the actual data sit in the claim provider\'s DB, instead the specified active scope names are to be contained in `scopes` property in the request body. If the offer is using a passive claim provider\'s data, then `values` needs to have actual values. In this docs, `values` in the request body is standard claim values, but it is dynamic upon the user\'s consent. If the user is not going to share `phone`, then the request body should not contain `phone` values. Also, if the user wants to share passive claims (e.g. FinScore score), `finscore` claims should be included in `values`. * @summary Offer Evaluation * @param {OfferEvaluateRequestData} offerEvaluateRequestData * @param {*} [options] Override http request option. * @throws {RequiredError} */ async requestOfferEvaluation(offerEvaluateRequestData: OfferEvaluateRequestData, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.requestOfferEvaluation(offerEvaluateRequestData, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This returns the number of qualified users with specified conditions. * @summary Qualified users count for Service Provider * @param {UserCountsRequestDto} userCountsRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ async requestUserCount(userCountsRequestDto: UserCountsRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.requestUserCount(userCountsRequestDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This returns the number of qualified users with specified conditions. This API calls Market\'s API internally. * @summary Qualified users count for Market * @param {UserCountsRequestDto} userCountsRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ async requestUserCountForMarket(userCountsRequestDto: UserCountsRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.requestUserCountForMarket(userCountsRequestDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This updates a campaign. The campaign\'s status needs to be draft mode (`published_at` is null). * @summary Campaign update * @param {string} id Campaign ID * @param {CampaignUpdateRequest} campaignUpdateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateCampaign(id: string, campaignUpdateRequest: CampaignUpdateRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateCampaign(id, campaignUpdateRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This operation updates onboarding status of an offer approval. Either the individual user or the service provider can update this status. If this offer redemption is not the first time (a user can redeem the offer many times), the previous pending offer transactions\' status will be `CANCELED` automatically. * @summary Updates an offer redemption for individual * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateOfferTransactionStatus(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateOfferTransactionStatus(id, offerTransactionStatusUpdateRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This operation updates onboarding status of an offer approval. Either the individual user or the service provider can update this status. If this offer redemption is not the first time (a user can redeem the offer many times), the previous pending offer transactions\' status will be `CANCELED` automatically. * @summary Updates an offer redemption for oidc client * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateOfferTxStatusForOidcClient(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateOfferTxStatusForOidcClient(id, offerTransactionStatusUpdateRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This fetches a list of campaigns. Upon a specified `actor`, this response will change the list contents. If the `actor` is `CONSUMER`, which is default, it will return campaigns list generated by this API calling organization. If the `actor` is `PROVIDER`, it will return campaigns that are using API requester\'s scope data. Technically, campaigns that contain this organization inside their offer conditions will be returned, so the response structure will be same as the case of `actor=CONSUMER`. If the `actor` is `ADMIN`, it will return all the campaigns. `status` represents review status. * @summary Campaigns List * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {CampaignActor} [actor] Provider, consumer, or admin * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ async v1OffersCampaignsGet(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, actor?: CampaignActor, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.v1OffersCampaignsGet(page, limit, campaignStatus, offerStatus, actor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * OffersApi - factory interface * @export */ export const OffersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = OffersApiFp(configuration) return { /** * This operation approves a campaign by admin. * @summary Approves campaign by Admin * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ approveCampaignByAdmin(id: string, options?: any): AxiosPromise { return localVarFp.approveCampaignByAdmin(id, options).then((request) => request(axios, basePath)); }, /** * This operation approves an organization\'s offer by claim provider. This can be executed multiple times. If the Service provider wants to show the offer (Activate), then it will call this API. * @summary Approves offer by claim provider * @param {string} id offer id * @param {*} [options] Override http request option. * @throws {RequiredError} */ approveOfferByClaimProvider(id: string, options?: any): AxiosPromise { return localVarFp.approveOfferByClaimProvider(id, options).then((request) => request(axios, basePath)); }, /** * This operation archives a campaign. Archived campaigns will not be available for end users. * @summary Archive a campaign * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ archiveCampaign(id: string, options?: any): AxiosPromise { return localVarFp.archiveCampaign(id, options).then((request) => request(axios, basePath)); }, /** * This generates a new campaign. * @summary Campaign creation * @param {CampaignCreateRequest} campaignCreateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createCampaign(campaignCreateRequest: CampaignCreateRequest, options?: any): AxiosPromise { return localVarFp.createCampaign(campaignCreateRequest, options).then((request) => request(axios, basePath)); }, /** * This retrieves a detail of a specified campaign. * @summary Campaign detail * @param {string} id Campaign ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCampaignDetail(id: string, options?: any): AxiosPromise { return localVarFp.getCampaignDetail(id, options).then((request) => request(axios, basePath)); }, /** * This will return all the campaigns. `status` represents review status. * @summary Campaigns List for Admin * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCampaignListForAdmin(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, options?: any): AxiosPromise { return localVarFp.getCampaignListForAdmin(page, limit, campaignStatus, offerStatus, options).then((request) => request(axios, basePath)); }, /** * This fetches a list of campaigns. Upon a specified `actor`, this response will change the list contents. If the `actor` is `CONSUMER`, which is default, it will return campaigns list generated by this API calling organization. If the `actor` is `PROVIDER`, it will return campaigns that are using API requester\'s scope data. Technically, campaigns that contain this organization inside their offer conditions will be returned, so the response structure will be same as the case of `actor=CONSUMER`. All the campaigns\' statuses are `APPROVED`. `status` represents review status. * @summary Campaigns List for Organization * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {OfferStatus} [offerStatus] Approval status of offers * @param {CampaignActor} [actor] Provider or consumer * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCampaignListForOrg(page?: number, limit?: number, offerStatus?: OfferStatus, actor?: CampaignActor, options?: any): AxiosPromise { return localVarFp.getCampaignListForOrg(page, limit, offerStatus, actor, options).then((request) => request(axios, basePath)); }, /** * This fetches a detail data of a specified offer. This is to be called by a Login page. * @summary Offer Detail * @param {string} offerCode Offer Code * @param {boolean} [redeemable] If this is true (default is false) server will validate redeemable or not and return evaluation result and return error if that offer is not redeemable or can\'t evaluate * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferDetail(offerCode: string, redeemable?: boolean, options?: any): AxiosPromise { return localVarFp.getOfferDetail(offerCode, redeemable, options).then((request) => request(axios, basePath)); }, /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Offers list for claim provider * @param {string} [localId] ID in the claim provider * @param {string} [credifyId] ID in Credify * @param {string} [phone] Hashed phone number (`sha256(\"84123456789\")`). This is used to exclude offers that are not available to this user. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferListForClaimProvider(localId?: string, credifyId?: string, phone?: string, options?: any): AxiosPromise { return localVarFp.getOfferListForClaimProvider(localId, credifyId, phone, options).then((request) => request(axios, basePath)); }, /** * This returns a list of offer redemption related to this calling individual. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. This API will not return `CANCELED` offer transactions * @summary Offer transactions - Individual * @param {number} [page] * @param {number} [limit] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferTransactionList(page?: number, limit?: number, offerCode?: string, options?: any): AxiosPromise { return localVarFp.getOfferTransactionList(page, limit, offerCode, options).then((request) => request(axios, basePath)); }, /** * This returns a list of offer redemption related to this calling OIDC client. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Ecosystem * @param {number} [page] * @param {number} [limit] * @param {string} [entityId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferTransactionListForAdmin(page?: number, limit?: number, entityId?: string, offerCode?: string, options?: any): AxiosPromise { return localVarFp.getOfferTransactionListForAdmin(page, limit, entityId, offerCode, options).then((request) => request(axios, basePath)); }, /** * This returns a list of offer redemption related to this calling Market. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Market * @param {number} [page] * @param {number} [limit] * @param {string} [credifyId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferTransactionListForMP(page?: number, limit?: number, credifyId?: string, offerCode?: string, options?: any): AxiosPromise { return localVarFp.getOfferTransactionListForMP(page, limit, credifyId, offerCode, options).then((request) => request(axios, basePath)); }, /** * This returns a list of offer redemption related to this calling Service Provider. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Service Provider * @param {number} [page] * @param {number} [limit] * @param {string} [credifyId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOfferTransactionListForSP(page?: number, limit?: number, credifyId?: string, offerCode?: string, options?: any): AxiosPromise { return localVarFp.getOfferTransactionListForSP(page, limit, credifyId, offerCode, options).then((request) => request(axios, basePath)); }, /** * This operation updates the campaign\'s status to draft mode. `published_at` will be null when this API is called. If `published_at` is null, the campaign is recognized as draft status. If Service provider wants to edit a campaign, they have to call this API first. * @summary Makes a campaign draft * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ markCampaignAsDraft(id: string, options?: any): AxiosPromise { return localVarFp.markCampaignAsDraft(id, options).then((request) => request(axios, basePath)); }, /** * This operation makes the campaign status `Waiting for approval`. * @summary Marks a campaign ready * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ markCampaignAsReady(id: string, options?: any): AxiosPromise { return localVarFp.markCampaignAsReady(id, options).then((request) => request(axios, basePath)); }, /** * This redeems a specified offer. This is to be called by a mobile idPass app. `approval_token` contains `scopes`, which is a list of scopes that users are going to share with the OIDC client. This `scopes` might contain some custom scopes provided by claim providers, and in that case Credify will fetch the custom claim values from the claim provider. `values` has standard claim values in a plain text. * @summary Offer redeem * @param {string} offerCode Offer Code * @param {OfferRedeemRequest} offerRedeemRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ redeemOffer(offerCode: string, offerRedeemRequest: OfferRedeemRequest, options?: any): AxiosPromise { return localVarFp.redeemOffer(offerCode, offerRedeemRequest, options).then((request) => request(axios, basePath)); }, /** * This operation rejects a campaign by admin. * @summary Rejects campaign by Admin * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} */ rejectCampaignByAdmin(id: string, options?: any): AxiosPromise { return localVarFp.rejectCampaignByAdmin(id, options).then((request) => request(axios, basePath)); }, /** * This operation rejects an offer by Service provider. This can be executed multiple times. If the Service provider wants to hide the offer, then it will call this API. * @summary Rejects offer by claim provider * @param {string} id offer id * @param {*} [options] Override http request option. * @throws {RequiredError} */ rejectOfferByClaimProvider(id: string, options?: any): AxiosPromise { return localVarFp.rejectOfferByClaimProvider(id, options).then((request) => request(axios, basePath)); }, /** * This fetches active offers for a requesting individual entity. This requires claims value. The backend will return offers that are qualified to this user based on the connected providers\' data. * @summary Offers list for each user * @param {OffersListRequest} offersListRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestEvaluatedOfferList(offersListRequest: OffersListRequest, options?: any): AxiosPromise { return localVarFp.requestEvaluatedOfferList(offersListRequest, options).then((request) => request(axios, basePath)); }, /** * This calculates what level of the specified offer is to be unlocked. This is supposed to be called by Credify Login page. If the offer is using an active claim provider\'s data, then `values` will not contain the active claim provider\'s claim values because the actual data sit in the claim provider\'s DB, instead the specified active scope names are to be contained in `scopes` property in the request body. If the offer is using a passive claim provider\'s data, then `values` needs to have actual values. In this docs, `values` in the request body is standard claim values, but it is dynamic upon the user\'s consent. If the user is not going to share `phone`, then the request body should not contain `phone` values. Also, if the user wants to share passive claims (e.g. FinScore score), `finscore` claims should be included in `values`. * @summary Offer Evaluation * @param {OfferEvaluateRequestData} offerEvaluateRequestData * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestOfferEvaluation(offerEvaluateRequestData: OfferEvaluateRequestData, options?: any): AxiosPromise { return localVarFp.requestOfferEvaluation(offerEvaluateRequestData, options).then((request) => request(axios, basePath)); }, /** * This returns the number of qualified users with specified conditions. * @summary Qualified users count for Service Provider * @param {UserCountsRequestDto} userCountsRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestUserCount(userCountsRequestDto: UserCountsRequestDto, options?: any): AxiosPromise { return localVarFp.requestUserCount(userCountsRequestDto, options).then((request) => request(axios, basePath)); }, /** * This returns the number of qualified users with specified conditions. This API calls Market\'s API internally. * @summary Qualified users count for Market * @param {UserCountsRequestDto} userCountsRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestUserCountForMarket(userCountsRequestDto: UserCountsRequestDto, options?: any): AxiosPromise { return localVarFp.requestUserCountForMarket(userCountsRequestDto, options).then((request) => request(axios, basePath)); }, /** * This updates a campaign. The campaign\'s status needs to be draft mode (`published_at` is null). * @summary Campaign update * @param {string} id Campaign ID * @param {CampaignUpdateRequest} campaignUpdateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateCampaign(id: string, campaignUpdateRequest: CampaignUpdateRequest, options?: any): AxiosPromise { return localVarFp.updateCampaign(id, campaignUpdateRequest, options).then((request) => request(axios, basePath)); }, /** * This operation updates onboarding status of an offer approval. Either the individual user or the service provider can update this status. If this offer redemption is not the first time (a user can redeem the offer many times), the previous pending offer transactions\' status will be `CANCELED` automatically. * @summary Updates an offer redemption for individual * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOfferTransactionStatus(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: any): AxiosPromise { return localVarFp.updateOfferTransactionStatus(id, offerTransactionStatusUpdateRequest, options).then((request) => request(axios, basePath)); }, /** * This operation updates onboarding status of an offer approval. Either the individual user or the service provider can update this status. If this offer redemption is not the first time (a user can redeem the offer many times), the previous pending offer transactions\' status will be `CANCELED` automatically. * @summary Updates an offer redemption for oidc client * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOfferTxStatusForOidcClient(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: any): AxiosPromise { return localVarFp.updateOfferTxStatusForOidcClient(id, offerTransactionStatusUpdateRequest, options).then((request) => request(axios, basePath)); }, /** * This fetches a list of campaigns. Upon a specified `actor`, this response will change the list contents. If the `actor` is `CONSUMER`, which is default, it will return campaigns list generated by this API calling organization. If the `actor` is `PROVIDER`, it will return campaigns that are using API requester\'s scope data. Technically, campaigns that contain this organization inside their offer conditions will be returned, so the response structure will be same as the case of `actor=CONSUMER`. If the `actor` is `ADMIN`, it will return all the campaigns. `status` represents review status. * @summary Campaigns List * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {CampaignActor} [actor] Provider, consumer, or admin * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ v1OffersCampaignsGet(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, actor?: CampaignActor, options?: any): AxiosPromise { return localVarFp.v1OffersCampaignsGet(page, limit, campaignStatus, offerStatus, actor, options).then((request) => request(axios, basePath)); }, }; }; /** * OffersApi - interface * @export * @interface OffersApi */ export interface OffersApiInterface { /** * This operation approves a campaign by admin. * @summary Approves campaign by Admin * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ approveCampaignByAdmin(id: string, options?: AxiosRequestConfig): AxiosPromise; /** * This operation approves an organization\'s offer by claim provider. This can be executed multiple times. If the Service provider wants to show the offer (Activate), then it will call this API. * @summary Approves offer by claim provider * @param {string} id offer id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ approveOfferByClaimProvider(id: string, options?: AxiosRequestConfig): AxiosPromise; /** * This operation archives a campaign. Archived campaigns will not be available for end users. * @summary Archive a campaign * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ archiveCampaign(id: string, options?: AxiosRequestConfig): AxiosPromise; /** * This generates a new campaign. * @summary Campaign creation * @param {CampaignCreateRequest} campaignCreateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ createCampaign(campaignCreateRequest: CampaignCreateRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This retrieves a detail of a specified campaign. * @summary Campaign detail * @param {string} id Campaign ID * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ getCampaignDetail(id: string, options?: AxiosRequestConfig): AxiosPromise; /** * This will return all the campaigns. `status` represents review status. * @summary Campaigns List for Admin * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ getCampaignListForAdmin(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, options?: AxiosRequestConfig): AxiosPromise; /** * This fetches a list of campaigns. Upon a specified `actor`, this response will change the list contents. If the `actor` is `CONSUMER`, which is default, it will return campaigns list generated by this API calling organization. If the `actor` is `PROVIDER`, it will return campaigns that are using API requester\'s scope data. Technically, campaigns that contain this organization inside their offer conditions will be returned, so the response structure will be same as the case of `actor=CONSUMER`. All the campaigns\' statuses are `APPROVED`. `status` represents review status. * @summary Campaigns List for Organization * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {OfferStatus} [offerStatus] Approval status of offers * @param {CampaignActor} [actor] Provider or consumer * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ getCampaignListForOrg(page?: number, limit?: number, offerStatus?: OfferStatus, actor?: CampaignActor, options?: AxiosRequestConfig): AxiosPromise; /** * This fetches a detail data of a specified offer. This is to be called by a Login page. * @summary Offer Detail * @param {string} offerCode Offer Code * @param {boolean} [redeemable] If this is true (default is false) server will validate redeemable or not and return evaluation result and return error if that offer is not redeemable or can\'t evaluate * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ getOfferDetail(offerCode: string, redeemable?: boolean, options?: AxiosRequestConfig): AxiosPromise; /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Offers list for claim provider * @param {string} [localId] ID in the claim provider * @param {string} [credifyId] ID in Credify * @param {string} [phone] Hashed phone number (`sha256(\"84123456789\")`). This is used to exclude offers that are not available to this user. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ getOfferListForClaimProvider(localId?: string, credifyId?: string, phone?: string, options?: AxiosRequestConfig): AxiosPromise; /** * This returns a list of offer redemption related to this calling individual. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. This API will not return `CANCELED` offer transactions * @summary Offer transactions - Individual * @param {number} [page] * @param {number} [limit] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ getOfferTransactionList(page?: number, limit?: number, offerCode?: string, options?: AxiosRequestConfig): AxiosPromise; /** * This returns a list of offer redemption related to this calling OIDC client. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Ecosystem * @param {number} [page] * @param {number} [limit] * @param {string} [entityId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ getOfferTransactionListForAdmin(page?: number, limit?: number, entityId?: string, offerCode?: string, options?: AxiosRequestConfig): AxiosPromise; /** * This returns a list of offer redemption related to this calling Market. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Market * @param {number} [page] * @param {number} [limit] * @param {string} [credifyId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ getOfferTransactionListForMP(page?: number, limit?: number, credifyId?: string, offerCode?: string, options?: AxiosRequestConfig): AxiosPromise; /** * This returns a list of offer redemption related to this calling Service Provider. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Service Provider * @param {number} [page] * @param {number} [limit] * @param {string} [credifyId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ getOfferTransactionListForSP(page?: number, limit?: number, credifyId?: string, offerCode?: string, options?: AxiosRequestConfig): AxiosPromise; /** * This operation updates the campaign\'s status to draft mode. `published_at` will be null when this API is called. If `published_at` is null, the campaign is recognized as draft status. If Service provider wants to edit a campaign, they have to call this API first. * @summary Makes a campaign draft * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ markCampaignAsDraft(id: string, options?: AxiosRequestConfig): AxiosPromise; /** * This operation makes the campaign status `Waiting for approval`. * @summary Marks a campaign ready * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ markCampaignAsReady(id: string, options?: AxiosRequestConfig): AxiosPromise; /** * This redeems a specified offer. This is to be called by a mobile idPass app. `approval_token` contains `scopes`, which is a list of scopes that users are going to share with the OIDC client. This `scopes` might contain some custom scopes provided by claim providers, and in that case Credify will fetch the custom claim values from the claim provider. `values` has standard claim values in a plain text. * @summary Offer redeem * @param {string} offerCode Offer Code * @param {OfferRedeemRequest} offerRedeemRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ redeemOffer(offerCode: string, offerRedeemRequest: OfferRedeemRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This operation rejects a campaign by admin. * @summary Rejects campaign by Admin * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ rejectCampaignByAdmin(id: string, options?: AxiosRequestConfig): AxiosPromise; /** * This operation rejects an offer by Service provider. This can be executed multiple times. If the Service provider wants to hide the offer, then it will call this API. * @summary Rejects offer by claim provider * @param {string} id offer id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ rejectOfferByClaimProvider(id: string, options?: AxiosRequestConfig): AxiosPromise; /** * This fetches active offers for a requesting individual entity. This requires claims value. The backend will return offers that are qualified to this user based on the connected providers\' data. * @summary Offers list for each user * @param {OffersListRequest} offersListRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ requestEvaluatedOfferList(offersListRequest: OffersListRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This calculates what level of the specified offer is to be unlocked. This is supposed to be called by Credify Login page. If the offer is using an active claim provider\'s data, then `values` will not contain the active claim provider\'s claim values because the actual data sit in the claim provider\'s DB, instead the specified active scope names are to be contained in `scopes` property in the request body. If the offer is using a passive claim provider\'s data, then `values` needs to have actual values. In this docs, `values` in the request body is standard claim values, but it is dynamic upon the user\'s consent. If the user is not going to share `phone`, then the request body should not contain `phone` values. Also, if the user wants to share passive claims (e.g. FinScore score), `finscore` claims should be included in `values`. * @summary Offer Evaluation * @param {OfferEvaluateRequestData} offerEvaluateRequestData * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ requestOfferEvaluation(offerEvaluateRequestData: OfferEvaluateRequestData, options?: AxiosRequestConfig): AxiosPromise; /** * This returns the number of qualified users with specified conditions. * @summary Qualified users count for Service Provider * @param {UserCountsRequestDto} userCountsRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ requestUserCount(userCountsRequestDto: UserCountsRequestDto, options?: AxiosRequestConfig): AxiosPromise; /** * This returns the number of qualified users with specified conditions. This API calls Market\'s API internally. * @summary Qualified users count for Market * @param {UserCountsRequestDto} userCountsRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ requestUserCountForMarket(userCountsRequestDto: UserCountsRequestDto, options?: AxiosRequestConfig): AxiosPromise; /** * This updates a campaign. The campaign\'s status needs to be draft mode (`published_at` is null). * @summary Campaign update * @param {string} id Campaign ID * @param {CampaignUpdateRequest} campaignUpdateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ updateCampaign(id: string, campaignUpdateRequest: CampaignUpdateRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This operation updates onboarding status of an offer approval. Either the individual user or the service provider can update this status. If this offer redemption is not the first time (a user can redeem the offer many times), the previous pending offer transactions\' status will be `CANCELED` automatically. * @summary Updates an offer redemption for individual * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ updateOfferTransactionStatus(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This operation updates onboarding status of an offer approval. Either the individual user or the service provider can update this status. If this offer redemption is not the first time (a user can redeem the offer many times), the previous pending offer transactions\' status will be `CANCELED` automatically. * @summary Updates an offer redemption for oidc client * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApiInterface */ updateOfferTxStatusForOidcClient(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This fetches a list of campaigns. Upon a specified `actor`, this response will change the list contents. If the `actor` is `CONSUMER`, which is default, it will return campaigns list generated by this API calling organization. If the `actor` is `PROVIDER`, it will return campaigns that are using API requester\'s scope data. Technically, campaigns that contain this organization inside their offer conditions will be returned, so the response structure will be same as the case of `actor=CONSUMER`. If the `actor` is `ADMIN`, it will return all the campaigns. `status` represents review status. * @summary Campaigns List * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {CampaignActor} [actor] Provider, consumer, or admin * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof OffersApiInterface */ v1OffersCampaignsGet(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, actor?: CampaignActor, options?: AxiosRequestConfig): AxiosPromise; } /** * OffersApi - object-oriented interface * @export * @class OffersApi * @extends {BaseAPI} */ export class OffersApi extends BaseAPI implements OffersApiInterface { /** * This operation approves a campaign by admin. * @summary Approves campaign by Admin * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public approveCampaignByAdmin(id: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).approveCampaignByAdmin(id, options).then((request) => request(this.axios, this.basePath)); } /** * This operation approves an organization\'s offer by claim provider. This can be executed multiple times. If the Service provider wants to show the offer (Activate), then it will call this API. * @summary Approves offer by claim provider * @param {string} id offer id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public approveOfferByClaimProvider(id: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).approveOfferByClaimProvider(id, options).then((request) => request(this.axios, this.basePath)); } /** * This operation archives a campaign. Archived campaigns will not be available for end users. * @summary Archive a campaign * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public archiveCampaign(id: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).archiveCampaign(id, options).then((request) => request(this.axios, this.basePath)); } /** * This generates a new campaign. * @summary Campaign creation * @param {CampaignCreateRequest} campaignCreateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public createCampaign(campaignCreateRequest: CampaignCreateRequest, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).createCampaign(campaignCreateRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This retrieves a detail of a specified campaign. * @summary Campaign detail * @param {string} id Campaign ID * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public getCampaignDetail(id: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).getCampaignDetail(id, options).then((request) => request(this.axios, this.basePath)); } /** * This will return all the campaigns. `status` represents review status. * @summary Campaigns List for Admin * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public getCampaignListForAdmin(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).getCampaignListForAdmin(page, limit, campaignStatus, offerStatus, options).then((request) => request(this.axios, this.basePath)); } /** * This fetches a list of campaigns. Upon a specified `actor`, this response will change the list contents. If the `actor` is `CONSUMER`, which is default, it will return campaigns list generated by this API calling organization. If the `actor` is `PROVIDER`, it will return campaigns that are using API requester\'s scope data. Technically, campaigns that contain this organization inside their offer conditions will be returned, so the response structure will be same as the case of `actor=CONSUMER`. All the campaigns\' statuses are `APPROVED`. `status` represents review status. * @summary Campaigns List for Organization * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {OfferStatus} [offerStatus] Approval status of offers * @param {CampaignActor} [actor] Provider or consumer * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public getCampaignListForOrg(page?: number, limit?: number, offerStatus?: OfferStatus, actor?: CampaignActor, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).getCampaignListForOrg(page, limit, offerStatus, actor, options).then((request) => request(this.axios, this.basePath)); } /** * This fetches a detail data of a specified offer. This is to be called by a Login page. * @summary Offer Detail * @param {string} offerCode Offer Code * @param {boolean} [redeemable] If this is true (default is false) server will validate redeemable or not and return evaluation result and return error if that offer is not redeemable or can\'t evaluate * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public getOfferDetail(offerCode: string, redeemable?: boolean, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).getOfferDetail(offerCode, redeemable, options).then((request) => request(this.axios, this.basePath)); } /** * This fetches active offers for a requesting claim provider. This list is filtered with data receiver\'s DB. * @summary Offers list for claim provider * @param {string} [localId] ID in the claim provider * @param {string} [credifyId] ID in Credify * @param {string} [phone] Hashed phone number (`sha256(\"84123456789\")`). This is used to exclude offers that are not available to this user. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public getOfferListForClaimProvider(localId?: string, credifyId?: string, phone?: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).getOfferListForClaimProvider(localId, credifyId, phone, options).then((request) => request(this.axios, this.basePath)); } /** * This returns a list of offer redemption related to this calling individual. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. This API will not return `CANCELED` offer transactions * @summary Offer transactions - Individual * @param {number} [page] * @param {number} [limit] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public getOfferTransactionList(page?: number, limit?: number, offerCode?: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).getOfferTransactionList(page, limit, offerCode, options).then((request) => request(this.axios, this.basePath)); } /** * This returns a list of offer redemption related to this calling OIDC client. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Ecosystem * @param {number} [page] * @param {number} [limit] * @param {string} [entityId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public getOfferTransactionListForAdmin(page?: number, limit?: number, entityId?: string, offerCode?: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).getOfferTransactionListForAdmin(page, limit, entityId, offerCode, options).then((request) => request(this.axios, this.basePath)); } /** * This returns a list of offer redemption related to this calling Market. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Market * @param {number} [page] * @param {number} [limit] * @param {string} [credifyId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public getOfferTransactionListForMP(page?: number, limit?: number, credifyId?: string, offerCode?: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).getOfferTransactionListForMP(page, limit, credifyId, offerCode, options).then((request) => request(this.axios, this.basePath)); } /** * This returns a list of offer redemption related to this calling Service Provider. Unless there is any dispute (`dispute` is optional), the status will follow `onboarding_status`. If an item has `dispute` and dispute\'s status is `APPROVED`/`REJECTED`, the status of the offer transaction item will be `Disputed`. If an item has `dispute` and dispute\'s status is `IN_PROCESS`, the status of the offer transaction item will be `In dispute`. If an item has `dispute` and dispute\'s status is `NEW`, the status of the offer transaction item will be `Waiting for review`. * @summary Offer transactions - Service Provider * @param {number} [page] * @param {number} [limit] * @param {string} [credifyId] * @param {string} [offerCode] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public getOfferTransactionListForSP(page?: number, limit?: number, credifyId?: string, offerCode?: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).getOfferTransactionListForSP(page, limit, credifyId, offerCode, options).then((request) => request(this.axios, this.basePath)); } /** * This operation updates the campaign\'s status to draft mode. `published_at` will be null when this API is called. If `published_at` is null, the campaign is recognized as draft status. If Service provider wants to edit a campaign, they have to call this API first. * @summary Makes a campaign draft * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public markCampaignAsDraft(id: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).markCampaignAsDraft(id, options).then((request) => request(this.axios, this.basePath)); } /** * This operation makes the campaign status `Waiting for approval`. * @summary Marks a campaign ready * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public markCampaignAsReady(id: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).markCampaignAsReady(id, options).then((request) => request(this.axios, this.basePath)); } /** * This redeems a specified offer. This is to be called by a mobile idPass app. `approval_token` contains `scopes`, which is a list of scopes that users are going to share with the OIDC client. This `scopes` might contain some custom scopes provided by claim providers, and in that case Credify will fetch the custom claim values from the claim provider. `values` has standard claim values in a plain text. * @summary Offer redeem * @param {string} offerCode Offer Code * @param {OfferRedeemRequest} offerRedeemRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public redeemOffer(offerCode: string, offerRedeemRequest: OfferRedeemRequest, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).redeemOffer(offerCode, offerRedeemRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This operation rejects a campaign by admin. * @summary Rejects campaign by Admin * @param {string} id campaign id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public rejectCampaignByAdmin(id: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).rejectCampaignByAdmin(id, options).then((request) => request(this.axios, this.basePath)); } /** * This operation rejects an offer by Service provider. This can be executed multiple times. If the Service provider wants to hide the offer, then it will call this API. * @summary Rejects offer by claim provider * @param {string} id offer id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public rejectOfferByClaimProvider(id: string, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).rejectOfferByClaimProvider(id, options).then((request) => request(this.axios, this.basePath)); } /** * This fetches active offers for a requesting individual entity. This requires claims value. The backend will return offers that are qualified to this user based on the connected providers\' data. * @summary Offers list for each user * @param {OffersListRequest} offersListRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public requestEvaluatedOfferList(offersListRequest: OffersListRequest, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).requestEvaluatedOfferList(offersListRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This calculates what level of the specified offer is to be unlocked. This is supposed to be called by Credify Login page. If the offer is using an active claim provider\'s data, then `values` will not contain the active claim provider\'s claim values because the actual data sit in the claim provider\'s DB, instead the specified active scope names are to be contained in `scopes` property in the request body. If the offer is using a passive claim provider\'s data, then `values` needs to have actual values. In this docs, `values` in the request body is standard claim values, but it is dynamic upon the user\'s consent. If the user is not going to share `phone`, then the request body should not contain `phone` values. Also, if the user wants to share passive claims (e.g. FinScore score), `finscore` claims should be included in `values`. * @summary Offer Evaluation * @param {OfferEvaluateRequestData} offerEvaluateRequestData * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public requestOfferEvaluation(offerEvaluateRequestData: OfferEvaluateRequestData, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).requestOfferEvaluation(offerEvaluateRequestData, options).then((request) => request(this.axios, this.basePath)); } /** * This returns the number of qualified users with specified conditions. * @summary Qualified users count for Service Provider * @param {UserCountsRequestDto} userCountsRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public requestUserCount(userCountsRequestDto: UserCountsRequestDto, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).requestUserCount(userCountsRequestDto, options).then((request) => request(this.axios, this.basePath)); } /** * This returns the number of qualified users with specified conditions. This API calls Market\'s API internally. * @summary Qualified users count for Market * @param {UserCountsRequestDto} userCountsRequestDto * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public requestUserCountForMarket(userCountsRequestDto: UserCountsRequestDto, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).requestUserCountForMarket(userCountsRequestDto, options).then((request) => request(this.axios, this.basePath)); } /** * This updates a campaign. The campaign\'s status needs to be draft mode (`published_at` is null). * @summary Campaign update * @param {string} id Campaign ID * @param {CampaignUpdateRequest} campaignUpdateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public updateCampaign(id: string, campaignUpdateRequest: CampaignUpdateRequest, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).updateCampaign(id, campaignUpdateRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This operation updates onboarding status of an offer approval. Either the individual user or the service provider can update this status. If this offer redemption is not the first time (a user can redeem the offer many times), the previous pending offer transactions\' status will be `CANCELED` automatically. * @summary Updates an offer redemption for individual * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public updateOfferTransactionStatus(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).updateOfferTransactionStatus(id, offerTransactionStatusUpdateRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This operation updates onboarding status of an offer approval. Either the individual user or the service provider can update this status. If this offer redemption is not the first time (a user can redeem the offer many times), the previous pending offer transactions\' status will be `CANCELED` automatically. * @summary Updates an offer redemption for oidc client * @param {string} id Approval ID * @param {OfferTransactionStatusUpdateRequest} [offerTransactionStatusUpdateRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OffersApi */ public updateOfferTxStatusForOidcClient(id: string, offerTransactionStatusUpdateRequest?: OfferTransactionStatusUpdateRequest, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).updateOfferTxStatusForOidcClient(id, offerTransactionStatusUpdateRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This fetches a list of campaigns. Upon a specified `actor`, this response will change the list contents. If the `actor` is `CONSUMER`, which is default, it will return campaigns list generated by this API calling organization. If the `actor` is `PROVIDER`, it will return campaigns that are using API requester\'s scope data. Technically, campaigns that contain this organization inside their offer conditions will be returned, so the response structure will be same as the case of `actor=CONSUMER`. If the `actor` is `ADMIN`, it will return all the campaigns. `status` represents review status. * @summary Campaigns List * @param {number} [page] Page number. default is 1. * @param {number} [limit] Page size. default is 50 * @param {CampaignStatusQueryParam} [campaignStatus] Approval status of campaigns * @param {OfferStatus} [offerStatus] Approval status of offers * @param {CampaignActor} [actor] Provider, consumer, or admin * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof OffersApi */ public v1OffersCampaignsGet(page?: number, limit?: number, campaignStatus?: CampaignStatusQueryParam, offerStatus?: OfferStatus, actor?: CampaignActor, options?: AxiosRequestConfig) { return OffersApiFp(this.configuration).v1OffersCampaignsGet(page, limit, campaignStatus, offerStatus, actor, options).then((request) => request(this.axios, this.basePath)); } }