Scan badges
Send the QR or barcode codes your booth staff scan, with an optional rating and note. Each code that matches a person in the event creates a connection (a lead) for your booth.
Reference: scanBadges mutation, Connection object
Before you begin
- An exhibitor API key created in the Exhibitor Center, sent in the
Authorizationheader tohttps://developer.swapcard.com/exhibitor/graphql. See Exhibitor authentication. - The
exhibitorIdof your booth and theeventIdof the event. Get both with List your booths.
Scan badges
Use this mutation each time a badge is scanned. You can send one code or several codes in the same call.
| Argument | Type | Description |
|---|---|---|
input | ScanBadgesInput! | Badge codes and evaluation data to process. |
ScanBadgesInput contains:
| Field | Type | Description |
|---|---|---|
eventId | ID! | The ID of the event. |
exhibitorId | ID! | The ID of the exhibitor booth. |
scanBadges | [ScanBadgeInput!]! | The scanned badges. Each one has a code (String!), and an optional note (String) and rating (Float). |
Mutation
mutation scanBadges($input: ScanBadgesInput!) {
scanBadges(input: $input) {
badges {
errorCode
connection {
id
rating
note
target {
__typename
... on PersonInterface {
...PersonFields
}
... on EventPerson {
...EventPersonFields
}
}
customFields {
__typename
... on NumberField {
id
definition {
id
name
}
number: value
}
... on UrlField {
id
definition {
id
name
}
value
}
... on MediaField {
id
definition {
id
name
}
value
}
... on TextField {
id
definition {
id
name
}
locale
value
}
... on LongTextField {
id
definition {
id
name
}
locale
value
}
... on SelectField {
id
definition {
id
name
}
translations {
value
language
}
value
}
... on MultipleSelectField {
id
definition {
id
name
}
translations {
value
language
}
value
}
... on MultipleTextField {
id
definition {
id
name
}
locale
value
}
... on DateField {
id
definition {
id
name
}
date: value
}
}
connectedAt
}
}
errors {
inputId
message
code
}
}
}
fragment PersonFields on PersonInterface {
firstName
lastName
jobTitle
email
organization
address {
city
country
place
street
zipCode
}
}
fragment EventPersonFields on EventPerson {
firstName
lastName
jobTitle
email
organization
address {
city
country
place
street
zipCode
}
}
Variables
{
"input": {
"eventId": "RXZlbnRfMjg1NzM=",
"exhibitorId": "RXhoaWJpdG9yXzU5NTIx",
"scanBadges": [
{
"code": "123456789",
"note": "Lead to contact urgently",
"rating": 5
}
]
}
}
Handle the response
The mutation returns one entry in badges per scanned code. For each entry:
errorCodeisnullandconnectioncontains the new lead when the code matches a person.- Otherwise
connectionisnullanderrorCodeis one of theScanBadgeErrorCodeEnumvalues:CODE_NOT_FOUND,FEATURE_NOT_ALLOWEDorUSER_NOT_IN_EVENT.
The scanned person is returned in connection.target as an EventPerson. See the Changelog.
The connection is created
Response
{
"data": {
"scanBadges": {
"badges": [
{
"errorCode": null,
"connection": {
"id": "Q29ubmVjdGlvbl8xMTYzNDE=",
"rating": 5,
"note": "Lead to contact urgently",
"target": {
"__typename": "EventPerson",
"firstName": "John",
"lastName": "Doe",
"jobTitle": null,
"email": "test@gmail.com",
"organization": null,
"address": null
},
"customFields": [
{
"__typename": "SelectField",
"id": "RmllbGRWYWx1ZV8zMzg3ODA=",
"definition": {
"id": "RmllbGREZWZpbml0aW9uXzI0NzYyNg==",
"name": "Interested by the Cloud offer ?"
},
"translations": [
{
"value": "Yes",
"language": "en_US"
}
],
"value": "yes"
},
{
"__typename": "MultipleSelectField",
"id": "RmllbGRWYWx1ZV8zMzg3ODI=",
"definition": {
"id": "RmllbGREZWZpbml0aW9uXzI0NzYyNw==",
"name": "Should contacted the week of ?"
},
"translations": [
{
"value": "1st Sept.",
"language": "en_US"
}
],
"value": "1st-sept"
}
],
"connectedAt": "2025-09-03 15:28:33"
}
}
],
"errors": []
}
}
}
The code is not found
Response
{
"data": {
"scanBadges": {
"badges": [
{
"errorCode": "CODE_NOT_FOUND",
"connection": null
}
],
"errors": []
}
}
}