Voucher pools and codes tools

list_voucher_pools

Lists every voucher pool in a project. Voucher pools are named collections of unique discount or promo codes that campaigns draw from when sending to customers. The response gives you each pool's name, the total number of codes, and how many are still available.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.

Response parameters

The tool returns a VoucherPoolsResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[VoucherPoolSummary]The voucher pools defined in the project.
errorstr | nullError message if the request failed.

The VoucherPoolSummary object has the following fields:

FieldTypeDescription
idstrThe voucher pool's unique ID.
namestrThe pool's display name. Unique within the project.
totalintThe total number of codes in the pool.
availableintThe number of codes still available (not yet assigned or redeemed).

get_voucher_pool

Returns the full details of a single voucher pool, including the pool's name, code counts, and a used_by list of the campaigns or resources that draw from it. Use list_voucher_codes to inspect the individual codes inside the pool.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
pool_idstrYesThe voucher pool ID returned by list_voucher_pools.

Response parameters

The tool returns a VoucherPoolResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
dataVoucherPool | nullThe full voucher pool record.
errorstr | nullError message if the request failed.

The VoucherPool object adds the following fields on top of the summary record:

FieldTypeDescription
company_idstrThe project ID this pool belongs to.
used_bylist[any]Campaigns or other resources that draw from this pool.

list_voucher_codes

Lists the individual codes inside a voucher pool. Each code has a statusavailable (not yet used), assigned (given to a customer but not redeemed), or redeemed (fully used) — plus assignment and redemption timestamps where applicable. There is no detail endpoint for individual codes; this list is the only way to inspect them.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
pool_idstrYesThe voucher pool ID returned by list_voucher_pools.
skipintNoPagination offset. Defaults to 0.
countintNoNumber of codes to return. Defaults to 20. Maximum 1,000.

Response parameters

The tool returns a VoucherCodesResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[VoucherCode]The voucher code records on this page.
matchedint | nullThe total number of codes in the pool that match the current filter.
matched_limitedbool | nullWhether the matched count was capped by a server limit.
skipintThe pagination offset that was applied.
limitintThe maximum number of records returned.
errorstr | nullError message if the request failed.

The VoucherCode object has the following fields:

FieldTypeDescription
codestrThe voucher code string, for example SUMMER20 or ABC-123.
statusstrOne of available, assigned (given but not redeemed), or redeemed.
assigned_timefloat | nullUnix timestamp of when the code was assigned to a customer.
redeemed_timefloat | nullUnix timestamp of when the code was redeemed.


© Bloomreach, Inc. All rights reserved.