Storecards

A service which allows to manage discount cards. All Storecards endpoints have path prefix /storecards-service.

Get countries

Returns a list of countries where a service is available

GET /storecards-service/country
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
    "276": {
        "cards_doc_id": "urn:authenticateit:storecards_settings@276",
        "country_info": {
            "alpha2": "DE",
            "alpha3": "DEU",
            "iso": "276",
            "name": "Germany",
            "name_ru": "Германия",
            "name_zh": "德国"
        }
    },
    "036": {
        "cards_doc_id": "urn:authenticateit:storecards_settings@036",
        "country_info": {
            "alpha2": "AU",
            "alpha3": "AUS",
            "iso": "036",
            "name": "Australia",
            "name_ru": "Австралия",
            "name_zh": "澳大利亚"
        }
    }
}

Set country

Add country to list. Return id of country cards document

POST /storecards-service/country/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string iso code of country, like 036 or 276
Example Response
{
    "id": "urn:authenticateit:storecards_settings@036"
}

Delete country

Remove country from list.

DELETE /storecards-service/objects/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string iso code of country, like 036 or 276
Example Response
{
    "result": "ok"
}

Check country

Method that checks service availability in the country.

GET /storecards-service/is_available/:country_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
country_id string iso code of country, like 036
Example Response
{
    "result": true
}

Get country cards

Returns list of discount cards available for the country.

GET /storecards-service/card/:country_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
country_id string iso code of country, like 036
Example Response
[
    {
        "name": "Test Card",
        "image_big": "https://dev-cdn.shping.com/2019/2/6/0092-big.jpg",
        "image_small": "https://dev-cdn.shping.com/2019/2/6/0092-small.jpg",
        "bgcolor": "#fff",
        "id": "3f8488f9-9e7e-4518-9b75-82901783fd2a"
    }
]

Set new country card

Create new card for country and return card id.

POST /storecards-service/card/:country_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
country_id string iso code of country, like 036
Example body
{
    "name": "Test Card",
    "image_big": "https://dev-cdn.shping.com/2019/2/6/0092-big.jpg",
    "image_small": "https://dev-cdn.shping.com/2019/2/6/0092-small.jpg",
    "bgcolor": "#fff"
}
Example Response
{
    "id": "3f8488f9-9e7e-4518-9b75-82901783fd2a"
}

Update country card

Update card information.

POST /storecards-service/card/:country_id/:card_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
country_id string iso code of country, like 036
card_id string 3f8488f9-9e7e-4518-9b75-82901783fd2a
Example body
{
    "name": "Test Card 2",
    "image_big": "https://dev-cdn.shping.com/2019/2/6/0092-big.jpg",
    "image_small": "https://dev-cdn.shping.com/2019/2/6/0092-small.jpg",
    "bgcolor": "#000"
}
Example Response
{
    "result": "ok"
}

Delete country card

Delete card from card list.

DELETE /storecards-service/card/:country_id/:card_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
country_id string iso code of country, like 036
card_id string 3f8488f9-9e7e-4518-9b75-82901783fd2a
Example Response
{
    "result": "ok"
}

Find country cards

Get list of store cards in a country with search option by name.

GET /storecards-service/find_cards/:country_id/:search_string
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
country_id string iso code of country, like 036
search_string string value for search
Example Response
[
    {
        "name": "Updated Test Card",
        "image_big": "test_big_image",
        "image_small": "test_small_image",
        "bgcolor": "#000",
        "id": "f661b6d6-664e-4b7d-b438-a0392d128fca"
    },
    {
        "name": "Test Card NEW",
        "image_big": "https://dev-cdn.shping.com/2019/2/6/0092-big.jpg",
        "image_small": "https://dev-cdn.shping.com/2019/2/6/0092-small.jpg",
        "bgcolor": "#fff",
        "id": "5c88b863-2247-4e74-be41-300615792132"
    }
]

Get card

Get user card list.

GET /storecards-service/user/card
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
include_retail_connect url Include retail_connect card ('true'/'false')
Example Response
[
    {
        "id": "57b6f90e-9c04-4fe3-9346-58d8ac801881",
        "custom_fields": [{"id":"cardholder_name","value":"Holder Name"},{"id":"expiry_date","value":"01/01/2020"},{"id":"member_since","value":"member since 3"},{"id":"Notes","value":"Notes text - 12345"}],
        "issue_number": "654321",
        "country_iso": "036",
        "card": {
            "name": "Updated Test Card",
            "image_big": "test_big_image",
            "image_small": "test_small_image",
            "bgcolor": "#000",
            "id": "799549b8-ac43-4680-9781-192e95bbcfd3"
        },
        "usage": [
            {
                "accuracy": "14,4549999237061",
                "longitude": "144974757",
                "latitude": "-37838094",
                "ts": "2019-04-16T09:27:16.716Z"
            }
        ],
        "ts": "2019-04-16T09:52:52.436Z"
    },
    {
        "activity_from_date": "2023-05-01",
        "activity_from_utc_ts": "2023-04-30T20:00:00Z",
        "activity_to_date": "2023-05-31",
        "activity_to_utc_ts": "2023-05-31T19:59:59Z",
        "calculated_ts": "2023-05-09T01:29:30Z",
        "counters": {
            "purchases_count": 0,
            "sessions": [],
            "spends": 0
        },
        "id": "742440a9-6af3-4bfc-9d71-6707238e8249",
        "loyalty_program": {
            "bgcolor": "#ED1010",
            "coin_payments_rule": {
                "currency_value": 2000,
                "type": "currency_value"
            },
            "country": "036",
            "created_at": "2023-05-09T03:04:44Z",
            "created_by": "urn:authenticateit:user:email:system@authenticateit.com",
            "description": "The loyalty card list will be updated to include the <b>NovaStore</b> card, which enables payment with shping coins and offers a personalized discount of up to 33% at affiliated stores.",
            "id": "87f9db8b-9aec-47a0-aaca-1ff140b3ba0a",
            "image_big": "https://dev-cdn.shping.com/2023/3/31/8ae6d806-d44a-4c0e-beb8-6a24187249e4.png",
            "image_small": "https://dev-cdn.shping.com/2023/3/31/8ae6d806-d44a-4c0e-beb8-6a24187249e4.png",
            "level_up": [
                {
                    "level_id": "casual",
                    "rules": []
                },
                {
                    "level_id": "regular",
                    "rules": [
                        {
                            "purchases_count": 5,
                            "type": "purchases_count"
                        },
                        {
                            "spends": 2000,
                            "type": "spends"
                        }
                    ]
                },
                {
                    "level_id": "vip",
                    "rules": [
                        {
                            "purchases_count": 10,
                            "type": "purchases_count"
                        },
                        {
                            "spends": 2500,
                            "type": "spends"
                        }
                    ]
                }
            ],
            "name": "NovaStore",
            "rebate": [
                {
                    "level_id": "casual",
                    "rebate_percents": 15
                },
                {
                    "level_id": "regular",
                    "rebate_percents": 25
                },
                {
                    "level_id": "vip",
                    "rebate_percents": 33
                }
            ],
            "status": "active",
            "type": "custom"
        },
        "next_date": "2023-07-01",
        "next_ts_utc": "2023-06-30T20:00:00Z",
        "participant_id": "urn:authenticateit:participant:735879621218609",
        "rules": [
            {
                "pass": false,
                "purchases_count": 5,
                "type": "purchases_count",
                "user_value": 0
            },
            {
                "pass": false,
                "spends": 2000,
                "type": "spends",
                "user_value": 0
            }
        ],
        "timezone_min": 240,
        "type": "retail_connect_level",
        "user_id": "urn:authenticateit:user:email:ikleeen+12@gmail.com",
        "user_level": "casual",
        "user_level_next": "regular",
        "user_level_rebate_percents": 15,
        "country_iso": "036",
        "card_type": "retail_connect",
        "ts": "2023-05-09T02:02:43.016Z"
    }
]

Create card by code

Create new user card.

POST /storecards-service/user/import/card/retail_connect
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
code string Required: Deeplink card code
Example body
{
    "code": "735879621218609"
}
Example Response
{
    "id": "e300d398-19b5-4918-8d1a-88426e7a026f"
}

Create card

Create new user card.

POST /storecards-service/user/card
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
country_iso string iso code of country, like 036
country_card_id string id of selected country card (guid)
card_type string Used only for retail_connect card
Example body. Add custom card
{
    "custom_fields": [{
            "id": "cardholder_name",
            "value": "Holder Name"
        }, {
            "id": "expiry_date",
            "value": "01/01/2020"
        }, {
            "id": "member_since",
            "value": "member since 3"
        }, {
            "id": "Notes",
            "value": "Notes text"
        }
    ],
    "issue_number": "654321",
    "country_iso": "036",
    "country_card_id": "f661b6d6-664e-4b7d-b438-a0392d128fca"
}
Example body. Add retail_connect card
{
    "card_type": "retail_connect",
    "country_card_id": "e6945475-fe03-4272-8317-fedaf0e91403"
}
Example Response
{
    "id": "e300d398-19b5-4918-8d1a-88426e7a026f"
}

Update card

Update user card information. Should be used only for custom cards

POST /storecards-service/user/card/:card_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
card_id string user card id (guid)
Example body
{
    "custom_fields": [{
            "id": "cardholder_name",
            "value": "changed - Holder Name"
        }, {
            "id": "expiry_date",
            "value": "01/01/2020"
        }, {
            "id": "member_since",
            "value": "changed - member since 3"
        }, {
            "id": "Notes",
            "value": "changed - Notes text"
        }
    ]
}
Example Response
{
    "result": "ok"
}

Delete card

Delete user card.

DELETE /storecards-service/user/card/:card_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
card_id string user card id (guid)
Example Response
{
    "result": "ok"
}

Update card usage

Append user card usage information.

POST /storecards-service/user/cardusage/:card_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
card_id string user card id (guid)
Example body
{
    "accuracy": "14,4549999237061",
    "longitude": "144974757",
    "latitude": "-37838094"
}
Example Response
{
    "result": "ok"
}

Find user card

Looking for user cards that were used in this location earlier.

POST /storecards-service/user/cardusage
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example body
{
    "accuracy": "14,4549999237061",
    "longitude": "144974757",
    "latitude": "-37838094"
}
Example Response
{
    "result": {
        "issue_number": "987654321",
        "custom_fields": [
            {
                "id": "cardholder_name",
                "value": "Тестов Дмитрий Тестович"
            },
            {
                "id": "expiry_date",
                "value": "01/01/2021"
            },
            {
                "id": "member_since",
                "value": "member since 0507"
            },
            {
                "id": "Notes",
                "value": "For test only"
            }
        ],
        "country_iso": "643",
        "country_card_id": "eeea4263-2180-444e-af8c-1607d11a3b98",
        "id": "20973bf4-6cc7-4c18-bbda-129ede8585d8",
        "ts": "2019-05-30T07:35:47.326Z",
        "usage": [
            {
                "accuracy": "14,4549999237061",
                "longitude": "144974757",
                "latitude": "-37838094",
                "ts": "2019-05-30T07:41:38.045Z"
            }
        ],
        "card": {
            "name": "Leroy Merlin",
            "bgcolor": "#e04d11",
            "image_big": "https://dev-cdn.shping.com/2019/5/15/24dad515-d0d3-4772-9981-e320b1327b09.jpeg",
            "image_small": "https://dev-cdn.shping.com/2019/5/15/371dfe75-d1c0-4101-a3c6-80b0076080d2.jpeg",
            "id": "eeea4263-2180-444e-af8c-1607d11a3b98"
        }
    }
}

or for empty

{
    "result": null
}

Read cards by country code with retail_connect

Returns a list of cards with retail_connect cards

GET /storecards-service/v2/card
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
country string Required: Country code
Example Response
[
[
    {
        "bgcolor": "#ED1010",
        "coin_payments_rule": {
            "currency_value": 2000,
            "type": "currency_value"
        },
        "country": "036",
        "description": "The loyalty card list will be updated to include the <b>NovaStore</b> card, which enables payment with shping coins and offers a personalized discount of up to 33% at affiliated stores.",
        "id": "87f9db8b-9aec-47a0-aaca-1ff140b3ba0a",
        "image_big": "https://dev-cdn.shping.com/2023/3/31/8ae6d806-d44a-4c0e-beb8-6a24187249e4.png",
        "image_small": "https://dev-cdn.shping.com/2023/3/31/8ae6d806-d44a-4c0e-beb8-6a24187249e4.png",
        "level_up": [
            {
                "level_id": "casual",
                "rules": []
            },
            {
                "level_id": "regular",
                "rules": [
                    {
                        "purchases_count": 5,
                        "type": "purchases_count"
                    },
                    {
                        "spends": 2000,
                        "type": "spends"
                    }
                ]
            },
            {
                "level_id": "vip",
                "rules": [
                    {
                        "purchases_count": 10,
                        "type": "purchases_count"
                    },
                    {
                        "spends": 2500,
                        "type": "spends"
                    }
                ]
            }
        ],
        "name": "NovaStore",
        "rebate": [
            {
                "level_id": "casual",
                "rebate_percents": 15
            },
            {
                "level_id": "regular",
                "rebate_percents": 25
            },
            {
                "level_id": "vip",
                "rebate_percents": 33
            }
        ],
        "card_type": "retail_connect",
        "participant_id": "urn:authenticateit:participant:735879621218609",
        "added": true
    },
    {
        "name": "Australia Card",
        "image_big": "https://dev-cdn.shping.com/2021/2/2/e0ececd1-3e73-4a8c-a1df-776ad2d723e2.jpg",
        "image_small": "https://dev-cdn.shping.com/2021/2/2/0721c713-08dc-438f-a897-6bc3ba10246c.jpg",
        "bgcolor": "#319ea8",
        "id": "799549b8-ac43-4680-9781-192e95bbcfd3",
        "barcode_type": "Code-128",
        "card_type": "custom"
    }
]

Find country cards with retail_connect

Returns a list of cards with retail_connect cards

GET /storecards-service/v2/card/search
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
country string Required: Country code
search_string string Required: Part of name
Example Response
[
    {
        "bgcolor": "#ED1010",
        "coin_payments_rule": {
            "currency_value": 2000,
            "type": "currency_value"
        },
        "country": "036",
        "description": "The loyalty card list will be updated to include the <b>NovaStore</b> card, which enables payment with shping coins and offers a personalized discount of up to 33% at affiliated stores.",
        "id": "87f9db8b-9aec-47a0-aaca-1ff140b3ba0a",
        "image_big": "https://dev-cdn.shping.com/2023/3/31/8ae6d806-d44a-4c0e-beb8-6a24187249e4.png",
        "image_small": "https://dev-cdn.shping.com/2023/3/31/8ae6d806-d44a-4c0e-beb8-6a24187249e4.png",
        "level_up": [
            {
                "level_id": "casual",
                "rules": []
            },
            {
                "level_id": "regular",
                "rules": [
                    {
                        "purchases_count": 5,
                        "type": "purchases_count"
                    },
                    {
                        "spends": 2000,
                        "type": "spends"
                    }
                ]
            },
            {
                "level_id": "vip",
                "rules": [
                    {
                        "purchases_count": 10,
                        "type": "purchases_count"
                    },
                    {
                        "spends": 2500,
                        "type": "spends"
                    }
                ]
            }
        ],
        "name": "NovaStore",
        "rebate": [
            {
                "level_id": "casual",
                "rebate_percents": 15
            },
            {
                "level_id": "regular",
                "rebate_percents": 25
            },
            {
                "level_id": "vip",
                "rebate_percents": 33
            }
        ],
        "card_type": "retail_connect",
        "participant_id": "urn:authenticateit:participant:735879621218609",
        "added": true
    }
]

results matching ""

    No results matching ""