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/jsonportal_session_uuidstringREQUIRED1
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
1003Create 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-sessionsBearer {{ access_token | api_key }}application/jsonBody
shop_uuidstringREQUIREDcontact_uuidstringOPTIONALscanner_typestringOPTIONALenable_email_identificationbooleanOPTIONALenable_registrationbooleanOPTIONALenable_on_screen_keyboardbooleanOPTIONALcamera_serviceintegerOPTIONALfacing_modestringOPTIONALprimary_identification_methodstringOPTIONAL1
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
550311008Create 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-receptionBearer {{ access_token | api_key }}application/jsonBody
shop_uuidstringREQUIREDcontact_uuidstringOPTIONALscanner_typestringOPTIONALenable_email_identificationbooleanOPTIONALenable_registrationbooleanOPTIONALenable_on_screen_keyboardbooleanOPTIONALcamera_serviceintegerOPTIONALfacing_modestringOPTIONALprimary_identification_methodstringOPTIONAL1
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
100855031Create 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-giftcardsBearer {{ access_token | api_key }}application/jsonBody
amount_in_centsnumberREQUIREDshop_uuidstringREQUIREDallow_multiple_giftcardsbooleanOPTIONALcontact_uuidstringOPTIONALscanner_typestringOPTIONALenable_email_identificationbooleanOPTIONALenable_registrationbooleanOPTIONALenable_on_screen_keyboardbooleanOPTIONALcamera_serviceintegerOPTIONALfacing_modestringOPTIONALprimary_identification_methodstringOPTIONAL1
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
100855031Create 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-giftcardsBearer {{ access_token | api_key }}application/jsonBody
shop_uuidstringREQUIREDcontact_uuidstringOPTIONALscanner_typestringOPTIONALenable_email_identificationbooleanOPTIONALenable_registrationbooleanOPTIONALenable_on_screen_keyboardbooleanOPTIONALcamera_serviceintegerOPTIONALfacing_modestringOPTIONALprimary_identification_methodstringOPTIONAL1
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
100855031Create 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-prepaidBearer {{ access_token | api_key }}application/jsonBody
shop_uuidstringREQUIREDcontact_uuidstringOPTIONALscanner_typestringOPTIONALenable_email_identificationbooleanOPTIONALenable_registrationbooleanOPTIONALenable_on_screen_keyboardbooleanOPTIONALcamera_serviceintegerOPTIONALfacing_modestringOPTIONALprimary_identification_methodstringOPTIONAL1
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
100855031Create 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-prepaidBearer {{ access_token | api_key }}application/jsonBody
shop_uuidstringREQUIREDcontact_uuidstringOPTIONALscanner_typestringOPTIONALenable_email_identificationbooleanOPTIONALenable_registrationbooleanOPTIONALenable_on_screen_keyboardbooleanOPTIONALcamera_serviceintegerOPTIONALfacing_modestringOPTIONALprimary_identification_methodstringOPTIONAL1
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
100855031Create 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/vouchersBearer {{ access_token | api_key }}application/jsonBody
shop_uuidstringREQUIREDcontact_uuidstringOPTIONALscanner_typestringOPTIONALenable_email_identificationbooleanOPTIONALenable_registrationbooleanOPTIONALenable_on_screen_keyboardbooleanOPTIONALcamera_serviceintegerOPTIONALfacing_modestringOPTIONALprimary_identification_methodstringOPTIONAL1
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
100855031