Developer

Baxi example responses

Loyalty API examples

Lookup

Request


{
    "da": {
        "ver": "1.0",
        "type": 101,
        "action": 193,
        "ra2t": { "ver": "1.0", "query": [ { "mode": 4 } ] },
        "ra2dam": {
            "ver": "2.0",
            "requestid": "1231231230",
            "getasset": {
                "asset": {
                    "template": { "name": "storebox" },
                    "keys": [
                        {
                            "cardref": "<cardref.001>"
                        }
                    ]
                }
            }
        }
    }
}

Response - User found

{
    "da": {
        "ver": "1.0",
        "type": 101,
        "action": 193,
        "status": "  5:0",
        "statustext": "OK",
        "dam2ra": {
            "requestid": "1231231230",
            "responseid": "296fb489-fb69-4fde-be9f-282422858e8f",
            "ver": "2.0",
            "getasset": {
                "asset": {
                    "template": "92debb63-0cc5-4570-aeaf-a3f9fb6c0563",
                    "keys": [
                        {
                            "cardref": "1dfbf15a-461a-11ed-96bb-5c4242535400"
                        }
                    ],
                    "attributes": [
                        {
                            "payload": "{\"par\":\"8844D2URH5WKI0R8HW03DQZQK200Z\",\"loyaltyapi\":{\"memberType\":\"customer\",\"card\":{\"cardId\":\"29r9oadywalgk5mmux3cz8i9cqc0ig1t\",\"cardtype\":1},\"memberId\":\"61adcdbxaurao4lu5jtrh3ow0f6s7thb\"}}"
                        }
                    ],
                    "id": "92debb63-0cc5-4570-aeaf-a3f9fb6c0563"
                }
            }
        }
    }
}

Response - User not found

If a user is not found, the payload returns an error object under loyaltyapi, which includes an error code and message.

{
    "errorCode": 2,
    "errorMessage": "No user found"
}

Code Description
2 Card is not registered to any users on the current provider

{
    "da": {
        "ver": "1.0",
        "type": 101,
        "action": 193,
        "status": "  5:0",
        "statustext": "OK",
        "dam2ra": {
            "requestid": "1231231230",
            "responseid": "4528553e-26c4-4a62-926a-d7563044cf7d",
            "ver": "2.0",
            "getasset": {
                "asset": {
                    "template": "92debb63-0cc5-4570-aeaf-a3f9fb6c0563",
                    "keys": [
                        {
                            "cardref": "1dfbf15a-461a-11ed-96bb-5c4242535400"
                        }
                    ],
                    "attributes": [
                        {
                            "payload": "{\"par\":\"8844D2URH5WKI0R8HW03DQZQK200Z\",\"loyaltyapi\":{\"errorMessage\":\"No user found\",\"errorCode\":2,\"timestamp\":\"2022-11-17T09:43:13.772+00:00\"}}"
                        }
                    ],
                    "id": "92debb63-0cc5-4570-aeaf-a3f9fb6c0563"
                }
            }
        }
    }
}