PassesService
Use client.passes to issue and manage wallet passes. Identity and custom fields belong to the related client, not the pass.
Core methods
| Method | Result |
|---|---|
get(id) | One pass envelope |
create(data) | Created pass envelope |
update(id, data) | Updated pass envelope |
delete(id) | void |
getByWorkspace(workspaceId, options?) | Pass list envelope |
getByTemplate(templateId, options) | Pass list envelope |
getByProject(projectId, options) | Pass list envelope |
search(query, options) | Search a workspace's passes |
aggregateByWallet(workspaceId) | Counts grouped by wallet registration |
refreshAllForWorkspace(workspaceId) | Refresh summary |
list(), getByTemplate(), getByProject(), and search() require options.filter.workspace_id._eq; unscoped cross-workspace listing is rejected.
Create
typescript
const { data: pass } = await client.passes.create({
workspace_id: "workspace-uuid",
project_id: "project-uuid",
pass_template_id: "template-uuid",
client_id: "client-uuid",
});Or create/reuse the client in the same request:
typescript
const { data: pass } = await client.passes.create({
workspace_id: "workspace-uuid",
project_id: "project-uuid",
pass_template_id: "template-uuid",
client_identity: {
email: "[email protected]",
first_name: "Jane",
custom_fields: { member_number: "M-1042" },
},
});Delivery and refresh
typescript
await client.passes.sendNotification(pass.id, "Your balance changed.");
const resend = await client.passes.resendEmail(pass.id);
const loyaltyData = await client.passes.getLoyaltyRenderData(
"workspace-uuid",
pass.id,
);Template switching and bulk operations
typescript
await client.passes.switchTemplate(pass.id, "new-template-uuid");
await client.passes.bulkSwitchTemplate(
["pass-1", "pass-2"],
"new-template-uuid",
);Additional methods include bulkCreateFromTemplate() and getCompleteData().
Update client-owned custom fields through client.clients.updateCustomFields() or mergeCustomFields() so downstream field-change logic runs.