All creations and updates are done through mutations called upsert. If the entity id
is included in the request, that entity will be updated, otherwise a new entity will be created.
To create/update a pass you will use the upsertPass mutation. It accepts a few different parameters, one of them being inputFieldValues
which are the values that differentiate the pass from other passes. Pass input fields are defined on the pass template.
{
passTemplates {
data {
id
name
inputFields {
id
identifier
}
}
}
}
mutation UpsertPass($data: PassDataInput!) {
upsertPass(data: $data) {
id
deliveryPageUrl
}
}
{
"data": {
"passTemplateId": "0b68ad0c-17fd-4b89-9e66-ee71b33ed38f",
"expirationDate": "2021-08-29T00:00:00Z",
"inputFieldValues": [
{"identifier": "name", "value": "Helga Katla Jónsdóttir"},
{"identifier": "memberId", "value": "12345"}
]
}
}
<aside> 💡 Please look at docs in the GraphQL playground, https://api.passi.is/playground, to see other available parameters.
</aside>