- listDiscountsread-only#
List discount tokens stored in the wallet. Listed tokens are grouped by token family. Only tokens that are within their validity period and not currently in use by a transaction are listed.
Request:
The request arguments must be a ListDiscountsRequest object. Omitted filter fields do not restrict the result.
Response:
On success, the result is a ListDiscountsResponse object.
interface ListDiscountsRequest {
// Filter by hash of token issue public key.
tokenIssuePubHash?: string;
// Filter by merchant base URL.
merchantBaseUrl?: string;
}
interface ListDiscountsResponse {
discounts: DiscountListDetail[];
}
interface DiscountListDetail {
// Hash of token family info.
tokenFamilyHash: string;
// Hash of token issue public key.
tokenIssuePubHash: string;
// URL of the merchant issuing the token.
merchantBaseUrl: string;
// Information about the merchant issuing the token.
merchantInfo?: MerchantInfo;
// Human-readable name for the token family.
name: string;
// Human-readable description for the token family.
description: string;
// Optional map from IETF BCP 47 language tags to localized descriptions.
descriptionI18n: any | undefined;
// Start time of the token's validity period.
validityStart: Timestamp;
// End time of the token's validity period.
validityEnd: Timestamp;
// Number of tokens available to use.
tokensAvailable: number;
}
interface MerchantInfo {
// The merchant's legal name of business.
name: string;
// Contact email address of the merchant.
email?: string;
// Website of the merchant.
website?: string;
// An optional base64-encoded product image.
logo?: ImageDataUrl;
// Business address of the merchant.
address?: Location;
// Jurisdiction for disputes; some typical location fields may be absent.
jurisdiction?: Location;
}