Portal Sessions
A Portal Session is created for a Contact. Portal Sessions support different scanner_types
, like camera or hand scanner, adding flexibility on how to interact with the loyalty platform.
Get Portal Session
Retrieve a Portal Session by supplying its UUID.
https://api.piggy.eu/api//portal-sessions/{{portal_session_uuid}}
Bearer {{ access_token | api_key }}
application/json
portal_session_uuid
string
REQUIRED
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"data": {
"uuid": "d02c7730-a1bb-471d-b293-bdc5add171e5",
"url": "https://api.piggy.eu/portal-sessions?uuid=d02c7730-a1bb-471d-b293-bdc5add171e5",
"contact": {
"uuid": "123"
},
"shop": {
"id": 243,
"uuid": "2222e1242t3324535",
"reference": "",
"name": "Sesame Street"
},
"created_at": "2023-10-19T15:11:13+00:00"
},
"meta": []
}
Code
Message
1003
Create Portal Session
When creating a portal session, a valid shop_uuid
specifying the shop for which the portal session is to be created must be provided. Optionally, a contact_uuid
can be provided, which will pre-fill the contact's details in the portal session. If no contact UUID is provided, the contact can be added in the portal session itself.
It is also possible to specify the scanner_type
that is being used. This can be either 'camera' or 'hand_scanner', and defaults to 'camera' if this option is not set.
Additionally, it is possible to enable the option for contacts to use their email-address as identification. As well as the option to start a session by registering a new contact.
Finally, the portal session can also be configured to use an on-screen keyboard.
https://api.piggy.eu/api//portal-sessions
Bearer {{ access_token | api_key }}
application/json
Body
shop_uuid
string
REQUIRED
contact_uuid
string
OPTIONAL
scanner_type
string
OPTIONAL
enable_email_identification
boolean
OPTIONAL
enable_registration
boolean
OPTIONAL
enable_on_screen_keyboard
boolean
OPTIONAL
camera_service
integer
OPTIONAL
facing_mode
string
OPTIONAL
primary_identification_method
string
OPTIONAL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"data": {
"uuid": "5a2066f3-d52b-4216-8177-ee341dbd9849",
"url": "https://api.piggy.eu/portal-sessions?uuid=5a2066f3-d52b-4216-8177-ee341dbd9849",
"contact": {
"uuid": "123"
},
"shop": {
"id": 15,
"uuid": "123123",
"reference": null,
"name": "Amsterdam Pop-up Store"
},
"events": [],
"created_at": "2023-11-12T19:43:01+00:00"
},
"meta": []
}
Code
Message
55031
1008
Create Credit Reception Portal Session
A portal session can also specifically be made for credit receptions. This is done by specifying the credit-reception
endpoint. All other parameters are the same as when creating a regular portal session.
https://api.piggy.eu/api//portal-sessions/credit-reception
Bearer {{ access_token | api_key }}
application/json
Body
shop_uuid
string
REQUIRED
contact_uuid
string
OPTIONAL
scanner_type
string
OPTIONAL
enable_email_identification
boolean
OPTIONAL
enable_registration
boolean
OPTIONAL
enable_on_screen_keyboard
boolean
OPTIONAL
camera_service
integer
OPTIONAL
facing_mode
string
OPTIONAL
primary_identification_method
string
OPTIONAL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"data": {
"uuid": "5a2066f3-d52b-4216-8177-ee341dbd9849",
"url": "https://api.piggy.eu/portal-sessions?uuid=5a2066f3-d52b-4216-8177-ee341dbd9849",
"contact": {
"uuid": "123"
},
"shop": {
"id": 15,
"uuid": "123123",
"reference": null,
"name": "Amsterdam Pop-up Store"
},
"events": [],
"created_at": "2023-11-12T19:43:01+00:00"
},
"meta": []
}
Code
Message
1008
55031
Create Redeem Giftcard Portal Session
A portal session can also specifically be made for redeeming giftcards. This is done by specifying the redeem-giftcards
endpoint. This session type requires a purchase amount, amount_in_cents
, to be provided. It is also possible to specify whether multiple giftcards can be used for a single transaction by supplying the allow_multiple_giftcards
parameter (defaults to true).
https://api.piggy.eu/api//portal-sessions/redeem-giftcards
Bearer {{ access_token | api_key }}
application/json
Body
amount_in_cents
number
REQUIRED
shop_uuid
string
REQUIRED
allow_multiple_giftcards
boolean
OPTIONAL
contact_uuid
string
OPTIONAL
scanner_type
string
OPTIONAL
enable_email_identification
boolean
OPTIONAL
enable_registration
boolean
OPTIONAL
enable_on_screen_keyboard
boolean
OPTIONAL
camera_service
integer
OPTIONAL
facing_mode
string
OPTIONAL
primary_identification_method
string
OPTIONAL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"data": {
"uuid": "5a2066f3-d52b-4216-8177-ee341dbd9849",
"url": "https://api.piggy.eu/portal-sessions?uuid=5a2066f3-d52b-4216-8177-ee341dbd9849",
"contact": {
"uuid": "123"
},
"shop": {
"id": 15,
"uuid": "123123",
"reference": null,
"name": "Amsterdam Pop-up Store"
},
"events": [],
"created_at": "2023-11-12T19:43:01+00:00"
},
"meta": []
}
Code
Message
1008
55031
Create Top Up Giftcard Portal Session
A portal session can also specifically be made for topping up giftcards. This is done by specifying the top-up-giftcards
endpoint. All other parameters are the same as when creating a regular portal session.
https://api.piggy.eu/api//portal-sessions/top-up-giftcards
Bearer {{ access_token | api_key }}
application/json
Body
shop_uuid
string
REQUIRED
contact_uuid
string
OPTIONAL
scanner_type
string
OPTIONAL
enable_email_identification
boolean
OPTIONAL
enable_registration
boolean
OPTIONAL
enable_on_screen_keyboard
boolean
OPTIONAL
camera_service
integer
OPTIONAL
facing_mode
string
OPTIONAL
primary_identification_method
string
OPTIONAL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"data": {
"uuid": "5a2066f3-d52b-4216-8177-ee341dbd9849",
"url": "https://api.piggy.eu/portal-sessions?uuid=5a2066f3-d52b-4216-8177-ee341dbd9849",
"contact": {
"uuid": "123"
},
"shop": {
"id": 15,
"uuid": "123123",
"reference": null,
"name": "Amsterdam Pop-up Store"
},
"events": [],
"created_at": "2023-11-12T19:43:01+00:00"
},
"meta": []
}
Code
Message
1008
55031
Create Pay Prepaid Portal Session
A portal session can also specifically be made for prepaid transactions. This is done by specifying the pay-prepaid
endpoint. All other parameters are the same as when creating a regular portal session.
https://api.piggy.eu/api//portal-sessions/pay-prepaid
Bearer {{ access_token | api_key }}
application/json
Body
shop_uuid
string
REQUIRED
contact_uuid
string
OPTIONAL
scanner_type
string
OPTIONAL
enable_email_identification
boolean
OPTIONAL
enable_registration
boolean
OPTIONAL
enable_on_screen_keyboard
boolean
OPTIONAL
camera_service
integer
OPTIONAL
facing_mode
string
OPTIONAL
primary_identification_method
string
OPTIONAL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"data": {
"uuid": "5a2066f3-d52b-4216-8177-ee341dbd9849",
"url": "https://api.piggy.eu/portal-sessions?uuid=5a2066f3-d52b-4216-8177-ee341dbd9849",
"contact": {
"uuid": "123"
},
"shop": {
"id": 15,
"uuid": "123123",
"reference": null,
"name": "Amsterdam Pop-up Store"
},
"events": [],
"created_at": "2023-11-12T19:43:01+00:00"
},
"meta": []
}
Code
Message
1008
55031
Create Top Up Prepaid Portal Session
A portal session can also specifically be made to top up a contact's prepaid balance. This is done by specifying the top-up-prepaid
endpoint. All other parameters are the same as when creating a regular portal session.
https://api.piggy.eu/api//portal-sessions/top-up-prepaid
Bearer {{ access_token | api_key }}
application/json
Body
shop_uuid
string
REQUIRED
contact_uuid
string
OPTIONAL
scanner_type
string
OPTIONAL
enable_email_identification
boolean
OPTIONAL
enable_registration
boolean
OPTIONAL
enable_on_screen_keyboard
boolean
OPTIONAL
camera_service
integer
OPTIONAL
facing_mode
string
OPTIONAL
primary_identification_method
string
OPTIONAL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"data": {
"uuid": "5a2066f3-d52b-4216-8177-ee341dbd9849",
"url": "https://api.piggy.eu/portal-sessions?uuid=5a2066f3-d52b-4216-8177-ee341dbd9849",
"contact": {
"uuid": "123"
},
"shop": {
"id": 15,
"uuid": "123123",
"reference": null,
"name": "Amsterdam Pop-up Store"
},
"events": [],
"created_at": "2023-11-12T19:43:01+00:00"
},
"meta": []
}
Code
Message
1008
55031
Create Voucher Portal Session
A portal session can also specifically be made for vouchers. This is done by specifying the vouchers
endpoint. All other parameters are the same as when creating a regular portal session.
https://api.piggy.eu/api//portal-sessions/vouchers
Bearer {{ access_token | api_key }}
application/json
Body
shop_uuid
string
REQUIRED
contact_uuid
string
OPTIONAL
scanner_type
string
OPTIONAL
enable_email_identification
boolean
OPTIONAL
enable_registration
boolean
OPTIONAL
enable_on_screen_keyboard
boolean
OPTIONAL
camera_service
integer
OPTIONAL
facing_mode
string
OPTIONAL
primary_identification_method
string
OPTIONAL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"data": {
"uuid": "5a2066f3-d52b-4216-8177-ee341dbd9849",
"url": "https://api.piggy.eu/portal-sessions?uuid=5a2066f3-d52b-4216-8177-ee341dbd9849",
"contact": {
"uuid": "123"
},
"shop": {
"id": 15,
"uuid": "123123",
"reference": null,
"name": "Amsterdam Pop-up Store"
},
"events": [],
"created_at": "2023-11-12T19:43:01+00:00"
},
"meta": []
}
Code
Message
1008
55031