/** * LV2Programs service. * @module api/LV2ProgramsApi */ export default class LV2ProgramsApi { /** * Constructs a new LV2ProgramsApi. * @alias LV2ProgramsApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient?: any); apiClient: any; /** * Callback function to receive the result of the activateCardPendingPointsBucket operation. * @callback activateCardPendingPointsBucketCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersCardsPendingPointsActivateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Activate pending point bucket * Activates a pending points bucket and creates a PENDING_POINTS_ACTIVATED card transaction. The transaction is created with status PENDING and processed asynchronously. No request body. The bucket must be PENDING, and its date must be after the current project day. The program and the member must be ACTIVE, and the program must be inside its validity window. Otherwise the response is 423. Returns 404 when the program or the member doesnt exist, when the card isnt assigned to that member, or when the bucket isnt on that card. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {String} cardId Identifies the loyalty card. Format lcrd_[a-f0-9]+. * @param {String} bucketId Identifies the pending points bucket. Format lcppb_[a-f0-9]+. * @param {activateCardPendingPointsBucketCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersCardsPendingPointsActivateResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersCardsPendingPointsActivateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersCardsPendingPointsActivateResponseBody` object or with `undefined`. */ activateCardPendingPointsBucket(programId: string, memberId: string, cardId: string, bucketId: string, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersCardsPendingPointsActivateResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersCardsPendingPointsActivateResponseBody | undefined)>; /** * Callback function to receive the result of the activateProgramMember operation. * @callback activateProgramMemberCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersActivateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Activate program member * Moves an INACTIVE member to ACTIVE and sets updated_at. Records a vl.member.activated activity. No request body. Returns the member without a cards array. Returns 404 when the program doesnt exist, or when the member doesnt exist in that program. The program is checked first. A DELETED member returns 404. Returns 400 with key invalid_state_transition when the member is already ACTIVE. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {activateProgramMemberCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersActivateResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersActivateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersActivateResponseBody` object or with `undefined`. */ activateProgramMember(programId: string, memberId: string, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersActivateResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersActivateResponseBody | undefined)>; /** * Callback function to receive the result of the adjustCardPoints operation. * @callback adjustCardPointsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersCardsPointsAdjustResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Adjust card points * Manually adjusts the points balance of the members card. A positive points value creates an ADMIN_CREDIT card transaction. The expiration date comes from the member tier when that tier defines its own points expiration. Otherwise the date comes from the card definition. expiration_date is null when points dont expire. A negative points value creates an ADMIN_DEBIT card transaction. When points is 0, no transaction is created and status is NO_CHANGE. The transaction is created with status PENDING and processed asynchronously. The program and the member must be ACTIVE. The program must also be inside its validity window. Otherwise the response is 423. The response is 404 when the program or the member doesnt exist, or when the card isnt assigned to that member. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {String} cardId Identifies the loyalty card. Format lcrd_[a-f0-9]+. * @param {V2LoyaltiesProgramsMembersCardsPointsAdjustRequestBody} v2LoyaltiesProgramsMembersCardsPointsAdjustRequestBody * @param {adjustCardPointsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersCardsPointsAdjustResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersCardsPointsAdjustResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersCardsPointsAdjustResponseBody` object or with `undefined`. */ adjustCardPoints(programId: string, memberId: string, cardId: string, v2LoyaltiesProgramsMembersCardsPointsAdjustRequestBody: V2LoyaltiesProgramsMembersCardsPointsAdjustRequestBody, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersCardsPointsAdjustResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersCardsPointsAdjustResponseBody | undefined)>; /** * Callback function to receive the result of the batchCreateProgramMembers operation. * @callback batchCreateProgramMembersCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersCreateInBulkResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Batch create program members * Schedules creation of program members from a JSON array and returns 202 with async_action_id. The program must exist, be ACTIVE, and be inside its validity window. The body isnt checked before that response. Entries are processed in batches of 100. The raw body must be at most 10 MB. Each entry uses the same fields as [Create program member](/api-reference/programs/create-program-member). A failed entry is skipped. Its report row sets created to false and explains the failure in error. Skipped cases include an invalid customer_identification, an unknown customer, an invalid status, a duplicate customer in the batch (Duplicate customer ID), a customer who is already a member (Member already exists), metadata that doesnt match the vl_member schema, and entries past the loyalty members plan limit. Successful entries enroll the customer and create a loyalty card for each card definition on the program. Report columns are identification_type, customer_id, customer_source_id, program_id, member_id, created, and error. An empty array or a null entry fails the async action with invalid_request_payload. A body that isnt a JSON array fails it with top_level_object_should_be_an_array. Use [Get async action](/api-reference/async-actions/get-async-action) to read the status and the report. You can also open the result from Audit log, [Background tasks](/analyze/audit-logs#background-tasks). * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {Array.} memberCreate * @param {batchCreateProgramMembersCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersCreateInBulkResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersCreateInBulkResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersCreateInBulkResponseBody` object or with `undefined`. */ batchCreateProgramMembers(programId: string, memberCreate: Array, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersCreateInBulkResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersCreateInBulkResponseBody | undefined)>; /** * Callback function to receive the result of the cancelCardPendingPointsBucket operation. * @callback cancelCardPendingPointsBucketCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersCardsPendingPointsCancelResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Cancel pending point bucket * Cancels a pending points bucket so its points arent activated. Creates a PENDING_POINTS_CANCELED card transaction. The transaction is created with status PENDING and processed asynchronously. No request body. The bucket must be PENDING, and its date must be after the current project day. The program and the member must be ACTIVE, and the program must be inside its validity window. Otherwise the response is 423. Returns 404 when the program or the member doesnt exist, when the card isnt assigned to that member, or when the bucket isnt on that card. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {String} cardId Identifies the loyalty card. Format lcrd_[a-f0-9]+. * @param {String} bucketId Identifies the pending points bucket. Format lcppb_[a-f0-9]+. * @param {cancelCardPendingPointsBucketCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersCardsPendingPointsCancelResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersCardsPendingPointsCancelResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersCardsPendingPointsCancelResponseBody` object or with `undefined`. */ cancelCardPendingPointsBucket(programId: string, memberId: string, cardId: string, bucketId: string, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersCardsPendingPointsCancelResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersCardsPendingPointsCancelResponseBody | undefined)>; /** * Callback function to receive the result of the createMemberOrderPayment operation. * @callback createMemberOrderPaymentCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {LoyaltiesProgramsMembersOrdersPaymentsCreateCombinedResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Pay for order with points * Pays for an order with points from the members card. The amount and points come from the card definitions pay-with-points exchange ratio, limited by the order total, the card balance, card spending caps, and the optional payment_limit. The binding cap is returned as details.spending_cap. The program and member must be ACTIVE, and the program must be inside its validity window. The card must belong to the member. The card definition must have pay-with-points enabled and an exchange-ratio formula. The order must already exist, identified by id or source_id. Modes: - TRANSACTION (default): creates a PENDING order transaction and a PENDING card transaction. Returns 202. The same order can be paid again; each call creates a new transaction. - DRY_RUN: simulates the payment and doesnt create a transaction. Returns 200 with status SIMULATED. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {V2LoyaltiesProgramsMembersOrdersPaymentsCreateRequestBody} v2LoyaltiesProgramsMembersOrdersPaymentsCreateRequestBody * @param {createMemberOrderPaymentCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link LoyaltiesProgramsMembersOrdersPaymentsCreateCombinedResponseBody} * @returns {Promise<(LoyaltiesProgramsMembersOrdersPaymentsCreateCombinedResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `LoyaltiesProgramsMembersOrdersPaymentsCreateCombinedResponseBody` object or with `undefined`. */ createMemberOrderPayment(programId: string, memberId: string, v2LoyaltiesProgramsMembersOrdersPaymentsCreateRequestBody: V2LoyaltiesProgramsMembersOrdersPaymentsCreateRequestBody, callback?: (error: Error | null, data?: LoyaltiesProgramsMembersOrdersPaymentsCreateCombinedResponseBody, response?: any) => any): Promise<(LoyaltiesProgramsMembersOrdersPaymentsCreateCombinedResponseBody | undefined)>; /** * Callback function to receive the result of the createProgramMember operation. * @callback createProgramMemberCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersCreateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Create program member * Enrolls an existing customer as a member of the loyalty program and creates a loyalty card for each card definition assigned to the program. Card code generation is asynchronous, so code can be null right after creation. The program must be ACTIVE and inside its validity window, and the customer must already exist. A customer can be a member of a program only once. Identify the customer with customer_identification. status defaults to ACTIVE. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {V2LoyaltiesProgramsMembersCreateRequestBody} v2LoyaltiesProgramsMembersCreateRequestBody * @param {createProgramMemberCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersCreateResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersCreateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersCreateResponseBody` object or with `undefined`. */ createProgramMember(programId: string, v2LoyaltiesProgramsMembersCreateRequestBody: V2LoyaltiesProgramsMembersCreateRequestBody, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersCreateResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersCreateResponseBody | undefined)>; /** * Callback function to receive the result of the deactivateProgramMember operation. * @callback deactivateProgramMemberCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersDeactivateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Deactivate program member * Moves an ACTIVE member to INACTIVE and sets updated_at. Records a vl.member.deactivated activity. An INACTIVE member cant earn or spend points. No request body. Returns the member without a cards array. Returns 404 when the program doesnt exist, or when the member doesnt exist in that program. The program is checked first. A DELETED member returns 404. Returns 400 with key invalid_state_transition when the member is already INACTIVE. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {deactivateProgramMemberCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersDeactivateResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersDeactivateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersDeactivateResponseBody` object or with `undefined`. */ deactivateProgramMember(programId: string, memberId: string, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersDeactivateResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersDeactivateResponseBody | undefined)>; /** * Callback function to receive the result of the deleteProgramMember operation. * @callback deleteProgramMemberCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersDeleteResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Delete program member * Deletes the member and sets status to DELETED. Removes the members card assignments in this program. Returns the member without a cards array. Delete doesnt change updated_at. Records a vl.member.deleted activity. Each unassigned card also records vl.member.card.unassigned and vl.card.unassigned. When an assignment has a tier, the delete records a LEFT tier transaction with origin member_card_deleted. The same customer can join the program again. The new member gets a new ID. Returns 404 when the program doesnt exist, or when the member doesnt exist in that program. The program is checked first. Deleting a member that is already DELETED returns 404. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {deleteProgramMemberCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersDeleteResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersDeleteResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersDeleteResponseBody` object or with `undefined`. */ deleteProgramMember(programId: string, memberId: string, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersDeleteResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersDeleteResponseBody | undefined)>; /** * Callback function to receive the result of the expireCardPointsBucket operation. * @callback expireCardPointsBucketCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersCardsExpiringPointsExpireResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Expire point bucket * Expires an ACTIVE points bucket. Creates an ADMIN_POINTS_EXPIRATION card transaction. The transaction is created with status PENDING and processed asynchronously. No request body. The bucket must be ACTIVE, and its expiration_date must be on or after the current project day. The program and the member must be ACTIVE, and the program must be inside its validity window. Otherwise the response is 423. Returns 404 when the program, the member, or the card definition doesnt exist, when the card isnt assigned to that member, or when the bucket isnt on that card. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {String} cardId Identifies the loyalty card. Format lcrd_[a-f0-9]+. * @param {String} bucketId Identifies the points expiration bucket. Format lcpeb_[a-f0-9]+. * @param {expireCardPointsBucketCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersCardsExpiringPointsExpireResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersCardsExpiringPointsExpireResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersCardsExpiringPointsExpireResponseBody` object or with `undefined`. */ expireCardPointsBucket(programId: string, memberId: string, cardId: string, bucketId: string, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersCardsExpiringPointsExpireResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersCardsExpiringPointsExpireResponseBody | undefined)>; /** * Callback function to receive the result of the getMemberEarningRuleDailyReport operation. * @callback getMemberEarningRuleDailyReportCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersEarningRulesReportsDailyListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List member earning-rule daily reports * Returns aggregated daily usage statistics for a specific earning rule and member over the given date range and resolution. Each entry sums successful earning-rule triggers recorded in one period. Periods without recorded activity are omitted. The date range is limited per resolution: - 90 days for day, - 12 weeks for week, - 12 months for month, - 4 quarters for quarter, - start_date must be before end_date, - start_date and end_date are inclusive. Returns 400 when query validation fails. Returns 404 when the program or member does not exist, or when the earning rule does not exist or is not assigned to the program. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {String} earningRuleId Identifies the earning rule. Format lern_[a-f0-9]+. * @param {Date} startDate Sets the inclusive start of the report date range. Format YYYY-MM-DD. * @param {Date} endDate Sets the inclusive end of the report date range. Format YYYY-MM-DD. Must be after start_date. * @param {String} resolution Sets the aggregation resolution. day allows at most 90 days, week at most 12 weeks, month at most 12 months, and quarter at most 4 quarters. * @param {getMemberEarningRuleDailyReportCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersEarningRulesReportsDailyListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersEarningRulesReportsDailyListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersEarningRulesReportsDailyListResponseBody` object or with `undefined`. */ getMemberEarningRuleDailyReport(programId: string, memberId: string, earningRuleId: string, startDate: Date, endDate: Date, resolution: string, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersEarningRulesReportsDailyListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersEarningRulesReportsDailyListResponseBody | undefined)>; /** * Callback function to receive the result of the getProgramMember operation. * @callback getProgramMemberCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersGetResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Get program member * Returns one member of the program together with that members loyalty cards. Each card includes balance, lifetime_bucket, next_expiration, and next_activation. tier_progress is not included. Use [Get program membership](/api-reference/programs/get-program-membership) when you need tier progress. card.code can be null shortly after member creation, while code generation is still running. Returns 404 when the program doesnt exist, or when the member doesnt exist in that program. The program is checked first. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {getProgramMemberCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersGetResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersGetResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersGetResponseBody` object or with `undefined`. */ getProgramMember(programId: string, memberId: string, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersGetResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersGetResponseBody | undefined)>; /** * Callback function to receive the result of the getProgramMembership operation. * @callback getProgramMembershipCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembershipsGetResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Get program membership * Returns the membership for one customer in the program: the member, the program, and the members loyalty cards. A card includes tier_progress when its card definition has a tier structure and the member has a tier on that card. Otherwise tier_progress is omitted. identification_type chooses how customerId is read. It defaults to customer_id. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} customerId Identifies the customer or member. identification_type selects the value: a Voucherify customer ID (cust_...), a customer source_id, or a loyalty member ID (lmbr_...). * @param {{ identificationType?: String, }} [opts] Optional parameters * @param {getProgramMembershipCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembershipsGetResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembershipsGetResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembershipsGetResponseBody` object or with `undefined`. */ getProgramMembership(programId: string, customerId: string, opts?: { identificationType?: string; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembershipsGetResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembershipsGetResponseBody | undefined)>; /** * Callback function to receive the result of the getProgramPointsEarningsDailyReport operation. * @callback getProgramPointsEarningsDailyReportCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsReportsPointsEarningsDailyListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program points-earnings daily reports * Returns aggregated daily points-earnings statistics for the program over the given date range and resolution, optionally filtered by earning rule and card definition. Each entry sums earning operations recorded for one period, earning rule, earning item, and card definition. Periods without recorded activity are omitted. A filter that matches no rows returns an empty data array. The date range is limited per resolution: - 90 days for day, - 12 weeks for week, - 12 months for month, - 4 quarters for quarter, - start_date must be before end_date, - start_date and end_date are inclusive. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {Date} startDate Sets the inclusive start of the report date range. Format YYYY-MM-DD. * @param {Date} endDate Sets the inclusive end of the report date range. Format YYYY-MM-DD. Must be after start_date. * @param {String} resolution Sets the aggregation resolution. day allows at most 90 days, week at most 12 weeks, month at most 12 months, and quarter at most 4 quarters. * @param {{ filters?: PointsEarningsReportListFilters, }} [opts] Optional parameters * @param {getProgramPointsEarningsDailyReportCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsReportsPointsEarningsDailyListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsReportsPointsEarningsDailyListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsReportsPointsEarningsDailyListResponseBody` object or with `undefined`. */ getProgramPointsEarningsDailyReport(programId: string, startDate: Date, endDate: Date, resolution: string, opts?: { filters?: PointsEarningsReportListFilters; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsReportsPointsEarningsDailyListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsReportsPointsEarningsDailyListResponseBody | undefined)>; /** * Callback function to receive the result of the getProgramPointsEarningsSummaryReport operation. * @callback getProgramPointsEarningsSummaryReportCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsReportsPointsEarningsSummaryListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program points-earnings summary reports * Returns total points-earnings statistics for the program (all time), optionally filtered by earning rule or card definition. Each entry sums earning operations for one earning rule, earning item, and card definition. Returns at most 100 rows, ordered by id descending. limit and order are not query parameters. A filter that matches no rows returns an empty data array. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {{ filters?: PointsEarningsReportListFilters, }} [opts] Optional parameters * @param {getProgramPointsEarningsSummaryReportCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsReportsPointsEarningsSummaryListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsReportsPointsEarningsSummaryListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsReportsPointsEarningsSummaryListResponseBody` object or with `undefined`. */ getProgramPointsEarningsSummaryReport(programId: string, opts?: { filters?: PointsEarningsReportListFilters; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsReportsPointsEarningsSummaryListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsReportsPointsEarningsSummaryListResponseBody | undefined)>; /** * Callback function to receive the result of the listCardActivities operation. * @callback listCardActivitiesCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersCardsActivitiesListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List card activities * Returns a cursor-paginated list of activities recorded for the members card. The card must still be assigned to that member. Filters are id, type, and created_at. Default order is -created_at, then id ascending. Returns 404 when the program doesnt exist, when the member doesnt exist in that program, or when the card isnt currently assigned to that member. The program is checked first, then the member. A DELETED member returns 404 with resource_type member. A missing assignment and a missing or deleted card both return 404 with resource_type card. Returns 400 with key invalid_query_params when the query fails validation. That check runs before the program, member, and card lookup. A cursor that doesnt match ^lcrsacrd_[a-f0-9]+$, a limit outside 1 to 100, an order other than created_at or -created_at, or an array that orders by both directions fails here. After the program, member, and card are found, an unknown or expired cursor returns invalid_or_expired_cursor. A cursor recorded for different filters or order returns cursor_and_query_mismatch. The cursor stays valid when only limit changes. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {String} cardId Identifies the loyalty card. Format lcrd_[a-f0-9]+. * @param {{ limit?: Number, order?: String, cursor?: String, filters?: V2LoyaltiesProgramsMembersCardsActivitiesListRequestQueryFilters, }} [opts] Optional parameters * @param {listCardActivitiesCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersCardsActivitiesListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersCardsActivitiesListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersCardsActivitiesListResponseBody` object or with `undefined`. */ listCardActivities(programId: string, memberId: string, cardId: string, opts?: { limit?: number; order?: string; cursor?: string; filters?: V2LoyaltiesProgramsMembersCardsActivitiesListRequestQueryFilters; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersCardsActivitiesListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersCardsActivitiesListResponseBody | undefined)>; /** * Callback function to receive the result of the listCardExpiringPoints operation. * @callback listCardExpiringPointsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersCardsExpiringPointsListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List card expiring points buckets * Returns a cursor-paginated list of ACTIVE point expiration buckets for the members card. Each bucket groups points that share an expiration date and expiration type, including points from separate transactions. The list starts on the current project day. Earlier buckets are omitted. Results can be filtered by card definition ID and expiration date, and ordered by expiration_date. Returns an empty list when the card has no matching buckets. Returns 400 when the query is invalid or the cursor is invalid, expired, or doesnt match the query. Returns 404 when the program or the member doesnt exist, or when the card isnt assigned to that member. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {String} cardId Identifies the loyalty card. Format lcrd_[a-f0-9]+. * @param {{ limit?: Number, order?: String, cursor?: String, filters?: V2LoyaltiesProgramsMembersCardsExpiringPointsListRequestQuery, }} [opts] Optional parameters * @param {listCardExpiringPointsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersCardsExpiringPointsListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersCardsExpiringPointsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersCardsExpiringPointsListResponseBody` object or with `undefined`. */ listCardExpiringPoints(programId: string, memberId: string, cardId: string, opts?: { limit?: number; order?: string; cursor?: string; filters?: V2LoyaltiesProgramsMembersCardsExpiringPointsListRequestQuery; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersCardsExpiringPointsListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersCardsExpiringPointsListResponseBody | undefined)>; /** * Callback function to receive the result of the listCardPendingPoints operation. * @callback listCardPendingPointsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersCardsPendingPointsListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List card pending point buckets * Returns a cursor-paginated list of pending point buckets for the members card. Every bucket has status PENDING. Pending points wait for activation (PERIOD_BASED, FIXED_DATES, or EVENT_BASED), following the card definition. The list starts on the next project day. The current days bucket is omitted because its still accumulating. Results can be filtered by card definition ID and ordered by date. Returns 404 when the program or the member doesnt exist, or when the card isnt assigned to that member. Bucket IDs from this list are the bucketId for [Activate pending point bucket](/api-reference/programs/activate-pending-point-bucket) and [Cancel pending point bucket](/api-reference/programs/cancel-pending-point-bucket). * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {String} cardId Identifies the loyalty card. Format lcrd_[a-f0-9]+. * @param {{ limit?: Number, order?: String, cursor?: String, filters?: V2LoyaltiesProgramsMembersCardsPendingPointsListRequestQuery, }} [opts] Optional parameters * @param {listCardPendingPointsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersCardsPendingPointsListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersCardsPendingPointsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersCardsPendingPointsListResponseBody` object or with `undefined`. */ listCardPendingPoints(programId: string, memberId: string, cardId: string, opts?: { limit?: number; order?: string; cursor?: string; filters?: V2LoyaltiesProgramsMembersCardsPendingPointsListRequestQuery; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersCardsPendingPointsListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersCardsPendingPointsListResponseBody | undefined)>; /** * Callback function to receive the result of the listCardTransactions operation. * @callback listCardTransactionsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersCardsTransactionsListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List card transactions * Returns a cursor-paginated list of transactions on the members card. Filter by id, card_definition_id, and created_at. Order by id (default -id, newest first). Returns 404 when the program, member, or card doesnt exist. The program is checked first, then the member, then the card. A member of another program, or a card that isnt assigned to this member, is not found. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {String} cardId Identifies the loyalty card. Format lcrd_[a-f0-9]+. * @param {{ limit?: Number, order?: String, cursor?: String, filters?: V2LoyaltiesProgramsMembersCardsTransactionsListRequestQuery, }} [opts] Optional parameters * @param {listCardTransactionsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersCardsTransactionsListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersCardsTransactionsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersCardsTransactionsListResponseBody` object or with `undefined`. */ listCardTransactions(programId: string, memberId: string, cardId: string, opts?: { limit?: number; order?: string; cursor?: string; filters?: V2LoyaltiesProgramsMembersCardsTransactionsListRequestQuery; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersCardsTransactionsListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersCardsTransactionsListResponseBody | undefined)>; /** * Callback function to receive the result of the listMemberBenefitTransactions operation. * @callback listMemberBenefitTransactionsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersBenefitsTransactionsListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List member benefit transactions * Lists benefit transactions (benefit fulfillments) for a given program member, with cursor-based pagination. Supports filtering by benefit ID and creation date. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {{ limit?: Number, order?: String, cursor?: String, filters?: V2LoyaltiesProgramsMembersBenefitsTransactionsListRequestQuery, }} [opts] Optional parameters * @param {listMemberBenefitTransactionsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersBenefitsTransactionsListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersBenefitsTransactionsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersBenefitsTransactionsListResponseBody` object or with `undefined`. */ listMemberBenefitTransactions(programId: string, memberId: string, opts?: { limit?: number; order?: string; cursor?: string; filters?: V2LoyaltiesProgramsMembersBenefitsTransactionsListRequestQuery; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersBenefitsTransactionsListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersBenefitsTransactionsListResponseBody | undefined)>; /** * Callback function to receive the result of the listMemberCardDailyReports operation. * @callback listMemberCardDailyReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {LoyaltiesProgramsMembersCardsReportsDailyListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List card daily points reports * Returns aggregated points statistics for a members loyalty card over the given date range and resolution. Each entry sums the point operations recorded in one period. Periods without recorded activity are omitted. The date range is limited per resolution: - 90 days for day, - 12 weeks for week, - 12 months for month, - 4 quarters for quarter, - start_date must be before end_date, - start_date and end_date are inclusive. Returns 400 when query validation fails. Returns 404 when the program or member does not exist, or when the card does not exist or is not assigned to the member in the program. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {String} cardId Identifies the loyalty card. Format lcrd_[a-f0-9]+. * @param {Date} startDate Sets the inclusive start of the report date range. Format YYYY-MM-DD. * @param {Date} endDate Sets the inclusive end of the report date range. Format YYYY-MM-DD. Must be after start_date. * @param {String} resolution Sets the aggregation resolution. day allows at most 90 days, week at most 12 weeks, month at most 12 months, and quarter at most 4 quarters. * @param {listMemberCardDailyReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link LoyaltiesProgramsMembersCardsReportsDailyListResponseBody} * @returns {Promise<(LoyaltiesProgramsMembersCardsReportsDailyListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `LoyaltiesProgramsMembersCardsReportsDailyListResponseBody` object or with `undefined`. */ listMemberCardDailyReports(programId: string, memberId: string, cardId: string, startDate: Date, endDate: Date, resolution: string, callback?: (error: Error | null, data?: LoyaltiesProgramsMembersCardsReportsDailyListResponseBody, response?: any) => any): Promise<(LoyaltiesProgramsMembersCardsReportsDailyListResponseBody | undefined)>; /** * Callback function to receive the result of the listMemberOrderPayments operation. * @callback listMemberOrderPaymentsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersOrdersPaymentsListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List member order payments * Lists stored PAY_WITH_POINTS order transactions for the program member, with cursor pagination. Filter by id, card_definition_id, and created_at. Order by id (default -id, newest first). Dry-run (SIMULATED) results arent stored and dont appear. Returns 404 when the program or the member doesnt exist. The program is checked first. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {{ limit?: Number, order?: String, cursor?: String, filters?: V2LoyaltiesProgramsMembersOrdersPaymentsListRequestQuery, }} [opts] Optional parameters * @param {listMemberOrderPaymentsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersOrdersPaymentsListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersOrdersPaymentsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersOrdersPaymentsListResponseBody` object or with `undefined`. */ listMemberOrderPayments(programId: string, memberId: string, opts?: { limit?: number; order?: string; cursor?: string; filters?: V2LoyaltiesProgramsMembersOrdersPaymentsListRequestQuery; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersOrdersPaymentsListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersOrdersPaymentsListResponseBody | undefined)>; /** * Callback function to receive the result of the listMemberRewardPurchases operation. * @callback listMemberRewardPurchasesCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersRewardsPurchasesListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List member reward purchases * Lists stored PURCHASE reward transactions for the program member, with cursor pagination. Filter by id, reward_id, card_definition_id, and created_at. Order by id (default -id, newest first). Purchases rejected before a transaction is stored dont appear. A purchase accepted with 202 that later fails is stored as REJECTED with details.rejection. Returns 404 when the program or the member doesnt exist. The program is checked first. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {{ limit?: Number, order?: String, cursor?: String, filters?: V2LoyaltiesProgramsMembersRewardsPurchasesListRequestQuery, }} [opts] Optional parameters * @param {listMemberRewardPurchasesCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersRewardsPurchasesListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersRewardsPurchasesListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersRewardsPurchasesListResponseBody` object or with `undefined`. */ listMemberRewardPurchases(programId: string, memberId: string, opts?: { limit?: number; order?: string; cursor?: string; filters?: V2LoyaltiesProgramsMembersRewardsPurchasesListRequestQuery; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersRewardsPurchasesListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersRewardsPurchasesListResponseBody | undefined)>; /** * Callback function to receive the result of the listMemberTierTransactions operation. * @callback listMemberTierTransactionsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersTiersTransactionsListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List member tier transactions * Lists tier transactions for the member: joins, leaves, upgrades, downgrades, expiration changes, and evaluation refreshes. Results use cursor pagination. Default order is -id, newest first. Filters are card_id, card_definition_id, and created_at. Returns 404 when the program doesnt exist, or when the member doesnt exist in that program. The program is checked first. A DELETED member returns 404. Returns 400 with key invalid_query_params when the query fails validation. That check runs before the program and member lookup. order must be id or -id. An array that orders by both directions is rejected. A cursor that doesnt match ^lcrsttx_[a-f0-9]+$ fails here. After the program and member are found, an unknown or expired cursor returns invalid_or_expired_cursor. A cursor recorded for different filters or order returns cursor_and_query_mismatch. The cursor stays valid when only limit changes. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {{ limit?: Number, order?: String, cursor?: String, filters?: V2LoyaltiesProgramsMembersTiersTransactionsListRequestQuery, }} [opts] Optional parameters * @param {listMemberTierTransactionsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersTiersTransactionsListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersTiersTransactionsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersTiersTransactionsListResponseBody` object or with `undefined`. */ listMemberTierTransactions(programId: string, memberId: string, opts?: { limit?: number; order?: string; cursor?: string; filters?: V2LoyaltiesProgramsMembersTiersTransactionsListRequestQuery; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersTiersTransactionsListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersTiersTransactionsListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramEarningRuleAssignments operation. * @callback listProgramEarningRuleAssignmentsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsEarningRulesListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program earning rule assignments * Returns a cursor-paginated list of earning rules assigned to the program. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {{ limit?: String, order?: String, cursor?: String, }} [opts] Optional parameters * @param {listProgramEarningRuleAssignmentsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsEarningRulesListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsEarningRulesListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsEarningRulesListResponseBody` object or with `undefined`. */ listProgramEarningRuleAssignments(programId: string, opts?: { limit?: string; order?: string; cursor?: string; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsEarningRulesListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsEarningRulesListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramEarningRulesDailyReports operation. * @callback listProgramEarningRulesDailyReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsReportsEarningRulesDailyListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program earning-rules daily reports * Returns aggregated daily earning-rule evaluation statistics for the program over the given date range and resolution, optionally filtered by earning rule. Each entry counts eligibility checks for one period and earning rule. Periods without recorded activity are omitted. failures_breakdown is always an empty object. A filter that matches no rows returns an empty data array. The date range is limited per resolution: - 90 days for day, - 12 weeks for week, - 12 months for month, - 4 quarters for quarter, - start_date must be before end_date, - start_date and end_date are inclusive. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {Date} startDate Sets the inclusive start of the report date range. Format YYYY-MM-DD. * @param {Date} endDate Sets the inclusive end of the report date range. Format YYYY-MM-DD. Must be after start_date. * @param {String} resolution Sets the aggregation resolution. day allows at most 90 days, week at most 12 weeks, month at most 12 months, and quarter at most 4 quarters. * @param {{ filters?: EarningRulesReportListFilters, }} [opts] Optional parameters * @param {listProgramEarningRulesDailyReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsReportsEarningRulesDailyListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsReportsEarningRulesDailyListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsReportsEarningRulesDailyListResponseBody` object or with `undefined`. */ listProgramEarningRulesDailyReports(programId: string, startDate: Date, endDate: Date, resolution: string, opts?: { filters?: EarningRulesReportListFilters; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsReportsEarningRulesDailyListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsReportsEarningRulesDailyListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramEarningRulesSummaryReports operation. * @callback listProgramEarningRulesSummaryReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsReportsEarningRulesSummaryListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program earning-rules summary reports * Returns total earning-rule evaluation statistics for the program (all time), optionally filtered by earning rule. Includes success and failure counts with a failures breakdown. Each entry counts eligibility checks for one earning rule. Returns at most 100 rows, ordered by id descending. limit and order are not query parameters. A filter that matches no rows returns an empty data array. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {{ filters?: EarningRulesReportListFilters, }} [opts] Optional parameters * @param {listProgramEarningRulesSummaryReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsReportsEarningRulesSummaryListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsReportsEarningRulesSummaryListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsReportsEarningRulesSummaryListResponseBody` object or with `undefined`. */ listProgramEarningRulesSummaryReports(programId: string, opts?: { filters?: EarningRulesReportListFilters; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsReportsEarningRulesSummaryListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsReportsEarningRulesSummaryListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramMemberActivities operation. * @callback listProgramMemberActivitiesCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersActivitiesListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program member activities * Returns a cursor-paginated list of lifecycle and card-assignment activities recorded for the member. Filters are id, type, and created_at. Default order is -created_at, then id ascending. Returns 404 when the program doesnt exist, or when the member doesnt exist in that program. The program is checked first. A DELETED member returns 404. Returns 400 with key invalid_query_params when the query fails validation. That check runs before the program and member lookup. A cursor that doesnt match ^lcrsambr_[a-f0-9]+$, a limit outside 1 to 100, an order other than created_at or -created_at, or an array that orders by both directions fails here. After the program and member are found, an unknown or expired cursor returns invalid_or_expired_cursor. A cursor recorded for different filters or order returns cursor_and_query_mismatch. The cursor stays valid when only limit changes. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {{ limit?: Number, order?: String, cursor?: String, filters?: V2LoyaltiesProgramsMembersActivitiesListRequestQueryFilters, }} [opts] Optional parameters * @param {listProgramMemberActivitiesCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersActivitiesListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersActivitiesListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersActivitiesListResponseBody` object or with `undefined`. */ listProgramMemberActivities(programId: string, memberId: string, opts?: { limit?: number; order?: string; cursor?: string; filters?: V2LoyaltiesProgramsMembersActivitiesListRequestQueryFilters; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersActivitiesListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersActivitiesListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramMembers operation. * @callback listProgramMembersCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program members * Returns a cursor-paginated list of members of the program. Deleted members are omitted. Results can be filtered by ID, status, customer ID and creation date. Results can be ordered by creation date, status, or customer ID (ascending or descending). The same field cannot be ordered both ascending and descending at the same time. Returns 404 when the program does not exist. List items do not include the cards array. Use the following endpoints to retrieve cards for a given member: - [Get customer memberships](/api-reference/programs/get-customer-memberships), - [Get program member](/api-reference/programs/get-program-member), - [Get program membership](/api-reference/programs/get-program-membership). * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {{ limit?: Number, order?: String, cursor?: String, filters?: V2LoyaltiesProgramsMembersListRequestQuery, }} [opts] Optional parameters * @param {listProgramMembersCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersListResponseBody` object or with `undefined`. */ listProgramMembers(programId: string, opts?: { limit?: number; order?: string; cursor?: string; filters?: V2LoyaltiesProgramsMembersListRequestQuery; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramMembersDailyReports operation. * @callback listProgramMembersDailyReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {LoyaltiesProgramsReportsMembersDailyListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program members daily reports * Returns member and card changes for the program over the given date range and resolution. Each row covers one period with recorded activity. Periods without activity are omitted. The date range is limited per resolution: - 90 days for day, - 12 weeks for week, - 12 months for month, - 4 quarters for quarter, - start_date must be before end_date, - start_date and end_date are inclusive. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {Date} startDate Sets the inclusive start of the report date range. Format YYYY-MM-DD. * @param {Date} endDate Sets the inclusive end of the report date range. Format YYYY-MM-DD. Must be after start_date. * @param {String} resolution Sets the aggregation resolution. day allows at most 90 days, week at most 12 weeks, month at most 12 months, and quarter at most 4 quarters. * @param {listProgramMembersDailyReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link LoyaltiesProgramsReportsMembersDailyListResponseBody} * @returns {Promise<(LoyaltiesProgramsReportsMembersDailyListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `LoyaltiesProgramsReportsMembersDailyListResponseBody` object or with `undefined`. */ listProgramMembersDailyReports(programId: string, startDate: Date, endDate: Date, resolution: string, callback?: (error: Error | null, data?: LoyaltiesProgramsReportsMembersDailyListResponseBody, response?: any) => any): Promise<(LoyaltiesProgramsReportsMembersDailyListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramMembersSummaryReports operation. * @callback listProgramMembersSummaryReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {LoyaltiesProgramsReportsMembersSummaryListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program members summary reports * Returns all-time member and card totals for the program. The response contains one row when activity was recorded, and an empty data array otherwise. limit and order are not query parameters. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {listProgramMembersSummaryReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link LoyaltiesProgramsReportsMembersSummaryListResponseBody} * @returns {Promise<(LoyaltiesProgramsReportsMembersSummaryListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `LoyaltiesProgramsReportsMembersSummaryListResponseBody` object or with `undefined`. */ listProgramMembersSummaryReports(programId: string, callback?: (error: Error | null, data?: LoyaltiesProgramsReportsMembersSummaryListResponseBody, response?: any) => any): Promise<(LoyaltiesProgramsReportsMembersSummaryListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramRewardAssignments operation. * @callback listProgramRewardAssignmentsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsRewardsListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program reward assignments * Returns a cursor-paginated list of rewards assigned to the program, including their stock configuration and redemption counters. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {{ limit?: String, order?: String, cursor?: String, }} [opts] Optional parameters * @param {listProgramRewardAssignmentsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsRewardsListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsRewardsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsRewardsListResponseBody` object or with `undefined`. */ listProgramRewardAssignments(programId: string, opts?: { limit?: string; order?: string; cursor?: string; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsRewardsListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsRewardsListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramRewardsDailyReports operation. * @callback listProgramRewardsDailyReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {LoyaltiesProgramsReportsRewardsDailyListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program rewards daily reports * Returns aggregated reward-purchase statistics for the program over the given date range and resolution, optionally filtered by reward. Each row covers one reward and one period with recorded purchases. Periods without recorded purchases are omitted. failures_breakdown is always an empty object. A filter that matches no rows returns an empty data array. The date range is limited per resolution: - 90 days for day, - 12 weeks for week, - 12 months for month, - 4 quarters for quarter, - start_date must be before end_date, - start_date and end_date are inclusive. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {Date} startDate Sets the inclusive start of the report date range. Format YYYY-MM-DD. * @param {Date} endDate Sets the inclusive end of the report date range. Format YYYY-MM-DD. Must be after start_date. * @param {String} resolution Sets the aggregation resolution. day allows at most 90 days, week at most 12 weeks, month at most 12 months, and quarter at most 4 quarters. * @param {{ filters?: RewardsReportListFilters, }} [opts] Optional parameters * @param {listProgramRewardsDailyReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link LoyaltiesProgramsReportsRewardsDailyListResponseBody} * @returns {Promise<(LoyaltiesProgramsReportsRewardsDailyListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `LoyaltiesProgramsReportsRewardsDailyListResponseBody` object or with `undefined`. */ listProgramRewardsDailyReports(programId: string, startDate: Date, endDate: Date, resolution: string, opts?: { filters?: RewardsReportListFilters; }, callback?: (error: Error | null, data?: LoyaltiesProgramsReportsRewardsDailyListResponseBody, response?: any) => any): Promise<(LoyaltiesProgramsReportsRewardsDailyListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramRewardsSpendingsDailyReports operation. * @callback listProgramRewardsSpendingsDailyReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {LoyaltiesProgramsReportsRewardsSpendingsDailyListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program rewards spendings daily reports * Returns aggregated points spent on reward purchases for the program over the given date range and resolution. Each row covers one reward, reward cost, reward spending, card definition, and period with an approved point spend. Periods without an approved point spend are omitted. Optionally filters by reward, cost, spending, and card definition. A filter that matches no rows returns an empty data array. The date range is limited per resolution: - 90 days for day, - 12 weeks for week, - 12 months for month, - 4 quarters for quarter, - start_date must be before end_date, - start_date and end_date are inclusive. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {Date} startDate Sets the inclusive start of the report date range. Format YYYY-MM-DD. * @param {Date} endDate Sets the inclusive end of the report date range. Format YYYY-MM-DD. Must be after start_date. * @param {String} resolution Sets the aggregation resolution. day allows at most 90 days, week at most 12 weeks, month at most 12 months, and quarter at most 4 quarters. * @param {{ filters?: RewardsSpendingsReportListFilters, }} [opts] Optional parameters * @param {listProgramRewardsSpendingsDailyReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link LoyaltiesProgramsReportsRewardsSpendingsDailyListResponseBody} * @returns {Promise<(LoyaltiesProgramsReportsRewardsSpendingsDailyListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `LoyaltiesProgramsReportsRewardsSpendingsDailyListResponseBody` object or with `undefined`. */ listProgramRewardsSpendingsDailyReports(programId: string, startDate: Date, endDate: Date, resolution: string, opts?: { filters?: RewardsSpendingsReportListFilters; }, callback?: (error: Error | null, data?: LoyaltiesProgramsReportsRewardsSpendingsDailyListResponseBody, response?: any) => any): Promise<(LoyaltiesProgramsReportsRewardsSpendingsDailyListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramRewardsSpendingsSummaryReports operation. * @callback listProgramRewardsSpendingsSummaryReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {LoyaltiesProgramsReportsRewardsSpendingsSummaryListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program rewards spendings summary reports * Returns all-time points spent on reward purchases for the program. Each row covers one reward, reward cost, reward spending, and card definition with an approved point spend. Filters rows by reward, cost, spending, and card definition. Returns at most 100 rows, ordered by id descending. limit and order are not query parameters. A filter that matches no rows returns an empty data array. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {{ filters?: RewardsSpendingsReportListFilters, }} [opts] Optional parameters * @param {listProgramRewardsSpendingsSummaryReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link LoyaltiesProgramsReportsRewardsSpendingsSummaryListResponseBody} * @returns {Promise<(LoyaltiesProgramsReportsRewardsSpendingsSummaryListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `LoyaltiesProgramsReportsRewardsSpendingsSummaryListResponseBody` object or with `undefined`. */ listProgramRewardsSpendingsSummaryReports(programId: string, opts?: { filters?: RewardsSpendingsReportListFilters; }, callback?: (error: Error | null, data?: LoyaltiesProgramsReportsRewardsSpendingsSummaryListResponseBody, response?: any) => any): Promise<(LoyaltiesProgramsReportsRewardsSpendingsSummaryListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramRewardsSummaryReports operation. * @callback listProgramRewardsSummaryReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {LoyaltiesProgramsReportsRewardsSummaryListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program rewards summary reports * Returns all-time reward-purchase totals for the program, one row per reward with a recorded purchase attempt. Filters rows with filters[reward_id]. Returns at most 100 rows, ordered by id descending. limit and order are not query parameters. A filter that matches no rows returns an empty data array. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {{ filters?: RewardsReportListFilters, }} [opts] Optional parameters * @param {listProgramRewardsSummaryReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link LoyaltiesProgramsReportsRewardsSummaryListResponseBody} * @returns {Promise<(LoyaltiesProgramsReportsRewardsSummaryListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `LoyaltiesProgramsReportsRewardsSummaryListResponseBody` object or with `undefined`. */ listProgramRewardsSummaryReports(programId: string, opts?: { filters?: RewardsReportListFilters; }, callback?: (error: Error | null, data?: LoyaltiesProgramsReportsRewardsSummaryListResponseBody, response?: any) => any): Promise<(LoyaltiesProgramsReportsRewardsSummaryListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramSpendingDailyReports operation. * @callback listProgramSpendingDailyReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {LoyaltiesProgramsReportsSpendingDailyListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program spending daily reports * Returns aggregated points-spending statistics for the program over the given date range and resolution. Each row covers one card definition and one period with recorded spending. Periods without recorded spending are omitted. Optionally filters by card definition. The date range is limited per resolution: - 90 days for day, - 12 weeks for week, - 12 months for month, - 4 quarters for quarter, - start_date must be before end_date, - start_date and end_date are inclusive. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {Date} startDate Sets the inclusive start of the report date range. Format YYYY-MM-DD. * @param {Date} endDate Sets the inclusive end of the report date range. Format YYYY-MM-DD. Must be after start_date. * @param {String} resolution Sets the aggregation resolution. day allows at most 90 days, week at most 12 weeks, month at most 12 months, and quarter at most 4 quarters. * @param {{ filters?: SpendingReportListFilters, }} [opts] Optional parameters * @param {listProgramSpendingDailyReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link LoyaltiesProgramsReportsSpendingDailyListResponseBody} * @returns {Promise<(LoyaltiesProgramsReportsSpendingDailyListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `LoyaltiesProgramsReportsSpendingDailyListResponseBody` object or with `undefined`. */ listProgramSpendingDailyReports(programId: string, startDate: Date, endDate: Date, resolution: string, opts?: { filters?: SpendingReportListFilters; }, callback?: (error: Error | null, data?: LoyaltiesProgramsReportsSpendingDailyListResponseBody, response?: any) => any): Promise<(LoyaltiesProgramsReportsSpendingDailyListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramSpendingSummaryReports operation. * @callback listProgramSpendingSummaryReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {LoyaltiesProgramsReportsSpendingSummaryListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program spending summary reports * Returns all-time point-spending totals for the program, one row per card definition that has recorded spending. Filters rows with filters[card_definition_id]. Returns at most 10 rows (max number of card definitions per program), ordered by id descending. limit and order are not query parameters. Returns 200 with an empty data array when no spending is recorded. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {{ filters?: SpendingReportListFilters, }} [opts] Optional parameters * @param {listProgramSpendingSummaryReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link LoyaltiesProgramsReportsSpendingSummaryListResponseBody} * @returns {Promise<(LoyaltiesProgramsReportsSpendingSummaryListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `LoyaltiesProgramsReportsSpendingSummaryListResponseBody` object or with `undefined`. */ listProgramSpendingSummaryReports(programId: string, opts?: { filters?: SpendingReportListFilters; }, callback?: (error: Error | null, data?: LoyaltiesProgramsReportsSpendingSummaryListResponseBody, response?: any) => any): Promise<(LoyaltiesProgramsReportsSpendingSummaryListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramTierStructureAssignments operation. * @callback listProgramTierStructureAssignmentsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsTierStructuresListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program tier structure assignments * Returns a cursor-paginated list of tier structures assigned to the program. Currently, a program can have only one tier structure assigned. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {{ limit?: String, order?: String, cursor?: String, }} [opts] Optional parameters * @param {listProgramTierStructureAssignmentsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsTierStructuresListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsTierStructuresListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsTierStructuresListResponseBody` object or with `undefined`. */ listProgramTierStructureAssignments(programId: string, opts?: { limit?: string; order?: string; cursor?: string; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsTierStructuresListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsTierStructuresListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramTiersDailyReports operation. * @callback listProgramTiersDailyReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsReportsTiersDailyListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program tiers daily reports * Returns aggregated tier-movement statistics for the program over the given date range and resolution, optionally filtered by tier structure and tier. Each row covers one tier structure, one tier, and one period with recorded movement. Periods without recorded movement are omitted. A filter that matches no rows returns an empty data array. The date range is limited per resolution: - 90 days for day, - 12 weeks for week, - 12 months for month, - 4 quarters for quarter, - start_date must be before end_date, - start_date and end_date are inclusive. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {Date} startDate Sets the inclusive start of the report date range. Format YYYY-MM-DD. * @param {Date} endDate Sets the inclusive end of the report date range. Format YYYY-MM-DD. Must be after start_date. * @param {String} resolution Sets the aggregation resolution. day allows at most 90 days, week at most 12 weeks, month at most 12 months, and quarter at most 4 quarters. * @param {{ filters?: TiersReportListFilters, }} [opts] Optional parameters * @param {listProgramTiersDailyReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsReportsTiersDailyListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsReportsTiersDailyListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsReportsTiersDailyListResponseBody` object or with `undefined`. */ listProgramTiersDailyReports(programId: string, startDate: Date, endDate: Date, resolution: string, opts?: { filters?: TiersReportListFilters; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsReportsTiersDailyListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsReportsTiersDailyListResponseBody | undefined)>; /** * Callback function to receive the result of the listProgramTiersSummaryReports operation. * @callback listProgramTiersSummaryReportsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsReportsTiersSummaryListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List program tiers summary reports * Returns all-time tier-movement totals for the program, one row per tier structure and tier that has recorded movement. Filters rows with filters[tier_structure_id] and filters[tier_id]. Returns at most 100 rows, ordered by id descending. limit and order are not query parameters. A filter that matches no rows returns an empty data array. Returns 400 when query validation fails. Returns 404 when the program does not exist. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {{ filters?: TiersReportListFilters, }} [opts] Optional parameters * @param {listProgramTiersSummaryReportsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsReportsTiersSummaryListResponseBody} * @returns {Promise<(V2LoyaltiesProgramsReportsTiersSummaryListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsReportsTiersSummaryListResponseBody` object or with `undefined`. */ listProgramTiersSummaryReports(programId: string, opts?: { filters?: TiersReportListFilters; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsReportsTiersSummaryListResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsReportsTiersSummaryListResponseBody | undefined)>; /** * Callback function to receive the result of the purchaseMemberReward operation. * @callback purchaseMemberRewardCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {LoyaltiesProgramsMembersRewardsPurchasesCreateCombinedResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Purchase reward with points * Purchases a reward for the program member by spending points from the members card. The card comes from the matching reward costs card definition. The program, reward, and member must be ACTIVE. The program and reward must be inside their validity windows. The reward must be assigned to the program with stock available, a cost must match the customer, and the purchase must stay inside frequency, cooldown, balance, and spending limits. Modes: - TRANSACTION (default): creates a PENDING reward transaction and a PENDING card transaction. Returns 202. - DRY_RUN: simulates the purchase and doesnt create a transaction. Returns 200 with status SIMULATED. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {V2LoyaltiesProgramsMembersRewardsPurchasesCreateRequestBody} v2LoyaltiesProgramsMembersRewardsPurchasesCreateRequestBody * @param {purchaseMemberRewardCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link LoyaltiesProgramsMembersRewardsPurchasesCreateCombinedResponseBody} * @returns {Promise<(LoyaltiesProgramsMembersRewardsPurchasesCreateCombinedResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `LoyaltiesProgramsMembersRewardsPurchasesCreateCombinedResponseBody` object or with `undefined`. */ purchaseMemberReward(programId: string, memberId: string, v2LoyaltiesProgramsMembersRewardsPurchasesCreateRequestBody: V2LoyaltiesProgramsMembersRewardsPurchasesCreateRequestBody, callback?: (error: Error | null, data?: LoyaltiesProgramsMembersRewardsPurchasesCreateCombinedResponseBody, response?: any) => any): Promise<(LoyaltiesProgramsMembersRewardsPurchasesCreateCombinedResponseBody | undefined)>; /** * Callback function to receive the result of the refundRewardPurchase operation. * @callback refundRewardPurchaseCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsRewardsPurchasesRefundResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Refund reward purchase * Refunds an APPROVED reward purchase made by a program member. The purchase transaction is marked REFUNDED, a new REFUND reward transaction is created with status APPROVED, and the points spent on the purchase are returned to the members card. The request body is optional and an empty payload is allowed. Policies default to refund: DEFAULT and stock: DEFAULT. The endpoint responds with 202 before the card balance changes. A POINTS_RETURNED card transaction is created for the members card and processed shortly after the response. When the members tier or the card definition expires points, returned points receive a new expiration date from that setting. They dont inherit the expiration of the originally spent points. A NO_EXPIRATION setting leaves the returned points without an expiration date. Card earning limits dont block the refund. For a LOYALTY_CARD_POINTS reward, the points credited to the target card are also reversed, with a POINTS_PURCHASE_REVERSED card transaction on that card. That transaction is processed shortly after the response. Its expiration is copied from the original points-purchased transaction. A DISCOUNT_COUPONS refund deletes the issued vouchers. details.result.digital.discount_coupons[].result is DELETED, or SKIPPED when the voucher isnt deleted. A GIFT_VOUCHERS refund subtracts the credited amount. details.result.digital.gift_vouchers[].result is CREDITS_SUBTRACTED, or SKIPPED when the balance update is rejected. The refund reverses that purchase in the rewards purchase limits for the project-local day of the original purchase. A day whose purchases are all refunded no longer counts as the members last purchase. Only rewards whose refunds.type is REFUNDABLE can be refunded. Any other reward is rejected with 423 and key reward_refund_policy_does_not_allow_refunds. policies.refund set to ALLOW refunds it anyway. The program must exist, and the reward transaction must belong to that program. Otherwise the request fails with 404. The program is checked first. The request is rejected with 423 when: - The program isnt ACTIVE (non_active_program) or is outside its validity window (program_outside_validity_window), - The transaction isnt a purchase (non_purchase_reward_transaction) or isnt APPROVED (non_approved_reward_transaction); refunding the same purchase twice fails here, - The reward no longer exists (reward_not_found), isnt assigned to the program (refund_reward_not_assigned_to_program), the members card is gone (refund_card_not_found), or the card definition is gone (refund_card_definition_not_found), - The reward type isnt supported (reward_type_not_supported_for_refunds), - For a LOYALTY_CARD_POINTS reward, the purchase result is missing (loyalty_card_points_purchase_result_not_found), the target card is gone (loyalty_card_points_target_card_not_found), the points-purchased card transaction is missing (loyalty_card_points_purchase_not_found), the target cards available balance is lower than the purchased points (loyalty_card_points_insufficient_balance), or the target card definition is gone (loyalty_card_points_target_card_definition_not_found). * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} rewardTransactionId Identifies the reward transaction of the purchase to refund. Format lrtx_[a-f0-9]+. * @param {{ v2LoyaltiesProgramsRewardsPurchasesRefundRequestBody?: V2LoyaltiesProgramsRewardsPurchasesRefundRequestBody, }} [opts] Optional parameters * @param {refundRewardPurchaseCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsRewardsPurchasesRefundResponseBody} * @returns {Promise<(V2LoyaltiesProgramsRewardsPurchasesRefundResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsRewardsPurchasesRefundResponseBody` object or with `undefined`. */ refundRewardPurchase(programId: string, rewardTransactionId: string, opts?: { v2LoyaltiesProgramsRewardsPurchasesRefundRequestBody?: V2LoyaltiesProgramsRewardsPurchasesRefundRequestBody; }, callback?: (error: Error | null, data?: V2LoyaltiesProgramsRewardsPurchasesRefundResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsRewardsPurchasesRefundResponseBody | undefined)>; /** * Callback function to receive the result of the updateProgramMember operation. * @callback updateProgramMemberCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {V2LoyaltiesProgramsMembersUpdateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Update program member * Updates a program members metadata. Provided object keys are merged into the existing metadata; omitted keys are preserved. Pass metadata: null to clear all metadata (sets it to an empty object). This endpoint cannot change status. Use [Activate program member](/api-reference/programs/activate-program-member) or [Deactivate program member](/api-reference/programs/deactivate-program-member) for status transitions. Records a vl.member.updated activity. Returns the updated member without the cards array. Returns 404 when the program or member does not exist. Returns 400 when the request body fails validation or the project vl_member metadata schema rejects the payload. * @param {String} programId Identifies the loyalty program. Format lprg_[a-f0-9]+. * @param {String} memberId Identifies the member. Format lmbr_[a-f0-9]+. * @param {V2LoyaltiesProgramsMembersUpdateRequestBody} v2LoyaltiesProgramsMembersUpdateRequestBody * @param {updateProgramMemberCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link V2LoyaltiesProgramsMembersUpdateResponseBody} * @returns {Promise<(V2LoyaltiesProgramsMembersUpdateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `V2LoyaltiesProgramsMembersUpdateResponseBody` object or with `undefined`. */ updateProgramMember(programId: string, memberId: string, v2LoyaltiesProgramsMembersUpdateRequestBody: V2LoyaltiesProgramsMembersUpdateRequestBody, callback?: (error: Error | null, data?: V2LoyaltiesProgramsMembersUpdateResponseBody, response?: any) => any): Promise<(V2LoyaltiesProgramsMembersUpdateResponseBody | undefined)>; } import V2LoyaltiesProgramsMembersCardsPendingPointsActivateResponseBody from '../model/V2LoyaltiesProgramsMembersCardsPendingPointsActivateResponseBody'; import V2LoyaltiesProgramsMembersActivateResponseBody from '../model/V2LoyaltiesProgramsMembersActivateResponseBody'; import V2LoyaltiesProgramsMembersCardsPointsAdjustRequestBody from '../model/V2LoyaltiesProgramsMembersCardsPointsAdjustRequestBody'; import V2LoyaltiesProgramsMembersCardsPointsAdjustResponseBody from '../model/V2LoyaltiesProgramsMembersCardsPointsAdjustResponseBody'; import MemberCreate from '../model/MemberCreate'; import V2LoyaltiesProgramsMembersCreateInBulkResponseBody from '../model/V2LoyaltiesProgramsMembersCreateInBulkResponseBody'; import V2LoyaltiesProgramsMembersCardsPendingPointsCancelResponseBody from '../model/V2LoyaltiesProgramsMembersCardsPendingPointsCancelResponseBody'; import V2LoyaltiesProgramsMembersOrdersPaymentsCreateRequestBody from '../model/V2LoyaltiesProgramsMembersOrdersPaymentsCreateRequestBody'; import LoyaltiesProgramsMembersOrdersPaymentsCreateCombinedResponseBody from '../model/LoyaltiesProgramsMembersOrdersPaymentsCreateCombinedResponseBody'; import V2LoyaltiesProgramsMembersCreateRequestBody from '../model/V2LoyaltiesProgramsMembersCreateRequestBody'; import V2LoyaltiesProgramsMembersCreateResponseBody from '../model/V2LoyaltiesProgramsMembersCreateResponseBody'; import V2LoyaltiesProgramsMembersDeactivateResponseBody from '../model/V2LoyaltiesProgramsMembersDeactivateResponseBody'; import V2LoyaltiesProgramsMembersDeleteResponseBody from '../model/V2LoyaltiesProgramsMembersDeleteResponseBody'; import V2LoyaltiesProgramsMembersCardsExpiringPointsExpireResponseBody from '../model/V2LoyaltiesProgramsMembersCardsExpiringPointsExpireResponseBody'; import V2LoyaltiesProgramsMembersEarningRulesReportsDailyListResponseBody from '../model/V2LoyaltiesProgramsMembersEarningRulesReportsDailyListResponseBody'; import V2LoyaltiesProgramsMembersGetResponseBody from '../model/V2LoyaltiesProgramsMembersGetResponseBody'; import V2LoyaltiesProgramsMembershipsGetResponseBody from '../model/V2LoyaltiesProgramsMembershipsGetResponseBody'; import PointsEarningsReportListFilters from '../model/PointsEarningsReportListFilters'; import V2LoyaltiesProgramsReportsPointsEarningsDailyListResponseBody from '../model/V2LoyaltiesProgramsReportsPointsEarningsDailyListResponseBody'; import V2LoyaltiesProgramsReportsPointsEarningsSummaryListResponseBody from '../model/V2LoyaltiesProgramsReportsPointsEarningsSummaryListResponseBody'; import V2LoyaltiesProgramsMembersCardsActivitiesListRequestQueryFilters from '../model/V2LoyaltiesProgramsMembersCardsActivitiesListRequestQueryFilters'; import V2LoyaltiesProgramsMembersCardsActivitiesListResponseBody from '../model/V2LoyaltiesProgramsMembersCardsActivitiesListResponseBody'; import V2LoyaltiesProgramsMembersCardsExpiringPointsListRequestQuery from '../model/V2LoyaltiesProgramsMembersCardsExpiringPointsListRequestQuery'; import V2LoyaltiesProgramsMembersCardsExpiringPointsListResponseBody from '../model/V2LoyaltiesProgramsMembersCardsExpiringPointsListResponseBody'; import V2LoyaltiesProgramsMembersCardsPendingPointsListRequestQuery from '../model/V2LoyaltiesProgramsMembersCardsPendingPointsListRequestQuery'; import V2LoyaltiesProgramsMembersCardsPendingPointsListResponseBody from '../model/V2LoyaltiesProgramsMembersCardsPendingPointsListResponseBody'; import V2LoyaltiesProgramsMembersCardsTransactionsListRequestQuery from '../model/V2LoyaltiesProgramsMembersCardsTransactionsListRequestQuery'; import V2LoyaltiesProgramsMembersCardsTransactionsListResponseBody from '../model/V2LoyaltiesProgramsMembersCardsTransactionsListResponseBody'; import V2LoyaltiesProgramsMembersBenefitsTransactionsListRequestQuery from '../model/V2LoyaltiesProgramsMembersBenefitsTransactionsListRequestQuery'; import V2LoyaltiesProgramsMembersBenefitsTransactionsListResponseBody from '../model/V2LoyaltiesProgramsMembersBenefitsTransactionsListResponseBody'; import LoyaltiesProgramsMembersCardsReportsDailyListResponseBody from '../model/LoyaltiesProgramsMembersCardsReportsDailyListResponseBody'; import V2LoyaltiesProgramsMembersOrdersPaymentsListRequestQuery from '../model/V2LoyaltiesProgramsMembersOrdersPaymentsListRequestQuery'; import V2LoyaltiesProgramsMembersOrdersPaymentsListResponseBody from '../model/V2LoyaltiesProgramsMembersOrdersPaymentsListResponseBody'; import V2LoyaltiesProgramsMembersRewardsPurchasesListRequestQuery from '../model/V2LoyaltiesProgramsMembersRewardsPurchasesListRequestQuery'; import V2LoyaltiesProgramsMembersRewardsPurchasesListResponseBody from '../model/V2LoyaltiesProgramsMembersRewardsPurchasesListResponseBody'; import V2LoyaltiesProgramsMembersTiersTransactionsListRequestQuery from '../model/V2LoyaltiesProgramsMembersTiersTransactionsListRequestQuery'; import V2LoyaltiesProgramsMembersTiersTransactionsListResponseBody from '../model/V2LoyaltiesProgramsMembersTiersTransactionsListResponseBody'; import V2LoyaltiesProgramsEarningRulesListResponseBody from '../model/V2LoyaltiesProgramsEarningRulesListResponseBody'; import EarningRulesReportListFilters from '../model/EarningRulesReportListFilters'; import V2LoyaltiesProgramsReportsEarningRulesDailyListResponseBody from '../model/V2LoyaltiesProgramsReportsEarningRulesDailyListResponseBody'; import V2LoyaltiesProgramsReportsEarningRulesSummaryListResponseBody from '../model/V2LoyaltiesProgramsReportsEarningRulesSummaryListResponseBody'; import V2LoyaltiesProgramsMembersActivitiesListRequestQueryFilters from '../model/V2LoyaltiesProgramsMembersActivitiesListRequestQueryFilters'; import V2LoyaltiesProgramsMembersActivitiesListResponseBody from '../model/V2LoyaltiesProgramsMembersActivitiesListResponseBody'; import V2LoyaltiesProgramsMembersListRequestQuery from '../model/V2LoyaltiesProgramsMembersListRequestQuery'; import V2LoyaltiesProgramsMembersListResponseBody from '../model/V2LoyaltiesProgramsMembersListResponseBody'; import LoyaltiesProgramsReportsMembersDailyListResponseBody from '../model/LoyaltiesProgramsReportsMembersDailyListResponseBody'; import LoyaltiesProgramsReportsMembersSummaryListResponseBody from '../model/LoyaltiesProgramsReportsMembersSummaryListResponseBody'; import V2LoyaltiesProgramsRewardsListResponseBody from '../model/V2LoyaltiesProgramsRewardsListResponseBody'; import RewardsReportListFilters from '../model/RewardsReportListFilters'; import LoyaltiesProgramsReportsRewardsDailyListResponseBody from '../model/LoyaltiesProgramsReportsRewardsDailyListResponseBody'; import RewardsSpendingsReportListFilters from '../model/RewardsSpendingsReportListFilters'; import LoyaltiesProgramsReportsRewardsSpendingsDailyListResponseBody from '../model/LoyaltiesProgramsReportsRewardsSpendingsDailyListResponseBody'; import LoyaltiesProgramsReportsRewardsSpendingsSummaryListResponseBody from '../model/LoyaltiesProgramsReportsRewardsSpendingsSummaryListResponseBody'; import LoyaltiesProgramsReportsRewardsSummaryListResponseBody from '../model/LoyaltiesProgramsReportsRewardsSummaryListResponseBody'; import SpendingReportListFilters from '../model/SpendingReportListFilters'; import LoyaltiesProgramsReportsSpendingDailyListResponseBody from '../model/LoyaltiesProgramsReportsSpendingDailyListResponseBody'; import LoyaltiesProgramsReportsSpendingSummaryListResponseBody from '../model/LoyaltiesProgramsReportsSpendingSummaryListResponseBody'; import V2LoyaltiesProgramsTierStructuresListResponseBody from '../model/V2LoyaltiesProgramsTierStructuresListResponseBody'; import TiersReportListFilters from '../model/TiersReportListFilters'; import V2LoyaltiesProgramsReportsTiersDailyListResponseBody from '../model/V2LoyaltiesProgramsReportsTiersDailyListResponseBody'; import V2LoyaltiesProgramsReportsTiersSummaryListResponseBody from '../model/V2LoyaltiesProgramsReportsTiersSummaryListResponseBody'; import V2LoyaltiesProgramsMembersRewardsPurchasesCreateRequestBody from '../model/V2LoyaltiesProgramsMembersRewardsPurchasesCreateRequestBody'; import LoyaltiesProgramsMembersRewardsPurchasesCreateCombinedResponseBody from '../model/LoyaltiesProgramsMembersRewardsPurchasesCreateCombinedResponseBody'; import V2LoyaltiesProgramsRewardsPurchasesRefundRequestBody from '../model/V2LoyaltiesProgramsRewardsPurchasesRefundRequestBody'; import V2LoyaltiesProgramsRewardsPurchasesRefundResponseBody from '../model/V2LoyaltiesProgramsRewardsPurchasesRefundResponseBody'; import V2LoyaltiesProgramsMembersUpdateRequestBody from '../model/V2LoyaltiesProgramsMembersUpdateRequestBody'; import V2LoyaltiesProgramsMembersUpdateResponseBody from '../model/V2LoyaltiesProgramsMembersUpdateResponseBody';