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
Example Response
[
    {
        "id": "57b6f90e-9c04-4fe3-9346-58d8ac801881",
        "custom_fields": [{"id":"cardholder_name","value":"Holder Name"},{"id":"issue_number","value":"654321"},{"id":"expiry_date","value":"01/01/2020"},{"id":"member_since","value":"member since 3"},{"id":"Notes","value":"Notes text - 12345"}],
        "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"
    }
]

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)
Example body
{
    custom_fields: [{
            "id": "cardholder_name",
            "value": "Holder Name"
        }, {
            "id": "issue_number",
            "value": "654321"
        }, {
            "id": "expiry_date",
            "value": "01/01/2020"
        }, {
            "id": "member_since",
            "value": "member since 3"
        }, {
            "id": "Notes",
            "value": "Notes text"
        }
    ],
    "country_iso": "036",
    "country_card_id": "f661b6d6-664e-4b7d-b438-a0392d128fca"
}
Example Response
{
    "id": "1a396b96-e1cc-4438-96b0-5e688155273a"
}

Update card

Update user card information.

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": "issue_number",
            "value": "changed - 654321"
        }, {
            "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
[
    {
        "cardholder_name": "holder name 2",
        "issue_number": "654321",
        "member_since": "member since 2",
        "expiry_date": "01/01/2020",
        "country_iso": "036",
        "country_card_id": "f661b6d6-664e-4b7d-b438-a0392d128fca",
        "id": "d2c9b46c-1085-4e64-9762-a220d939f2e7",
        "ts": "2019-04-08T19:43:00.380Z",
        "usage": [
            {
                "accuracy": "14,4549999237061",
                "longitude": "144974757",
                "latitude": "-37838094",
                "ts": "2019-04-08T19:57:38.760Z"
            },
            {
                "accuracy": "14,4549999237061",
                "longitude": "144974757",
                "latitude": "-37838094",
                "ts": "2019-04-09T19:30:11.585Z"
            }
        ]
    }
]

Get receipt

Get user receipt list.

GET /storecards-service/user/receipt
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
[
    {
        "accuracy": "14,4549999237061",
        "longitude": "144974757",
        "latitude": "-37838094",
        "receipt": "https://dev-cdn.shping.com/2019/1/28/5efe62a4-db8c-47ab-94ea-3f43e8cd62e7.jpg",
        "receipt_id": "46256f45-7526-4ee8-8e76-97c49b25e07c",
        "ts": "2019-04-08T07:31:49.470Z"
    }
]

Add new receipt

Add new user receipt information.

POST /storecards-service/user/receipt
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example body
{
    "accuracy": "14,4549999237061",
    "longitude": "144974757",
    "latitude": "-37838094",
    "receipt": "https://dev-cdn.shping.com/2019/1/28/5efe62a4-db8c-47ab-94ea-3f43e8cd62e7.jpg"
}
Example Response
{
    "id": "e2af5961-e74d-41ca-a998-a782a7a90807"
}

Delete receipt

Delete user receipt.

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

results matching ""

    No results matching ""