Entities API examples#

Custom entities provides a framework for extending built-in Antavo functionality and also create new business-related structures. For example, extra fields can be added to custom entities, refining and enhancing the functionality of Antavo. Once a custom entity has been initiated, additional features can be added and modified using API calls.

Note

The custom entities must be enabled. Please contact your customer success manager if this functionality is not currently available in your system

Tiers#

Customer-free tier information can be accessed by a GET request to http://api.environment.antavo.com/entities/tiers/tier. This contains all information regarding the all tiers and includes the tier structure; type; expiration type and settings and the individual tier levels, ids, name and thresholds.

Example Response from GET request for a Tier custom entity#
{
"data": [
    {
    "id": "standard",
    "name": "Standard Tier",
    "rolling_months": "12",
    "calendar_expirations": [],
    "account": "standard",
    "status": "active",
    "type": "point_based",
    "expiration_type": "none",
    "tiers": [
        {
        "id": "t0",
        "name": {
            "en": "Basic"
        },
        "threshold": 0
        },
        {
        "id": "t1",
        "name": {
            "en": "medium"
        },
        "threshold": 100
        }
    ]
    },
    {
    "id": "bonus",
    "name": "Bonus",
    "rolling_months": "12",
    "calendar_expirations": [],
    "account": "other",
    "status": "active",
    "type": "point_based",
    "expiration_type": "none",
    "tiers": [
        {
        "id": "b0",
        "name": {
            "en": "no Bonus"
        },
        "threshold": 0
        },
        {
        "id": "b1",
        "name": {
            "en": "first stage"
        },
        "threshold": 10
        }
    ]
    }
]
}

Offers#

A GET request to http://api.enbironment.antavo.com/entities/offers/offer returns all available information for all offers. All offers are configured in the Backoffice.

Generic GET request response for a Tier custom entity#
{
    "data": [
        {
            "id": "",
            "name": "Offer name",
            "type": "type",
            "weight": numeric,
            "coupon pool": "coupon pool",
            "recurring": true/false,
            "starts_at": "2020-07-21T12:00:00+00:00",
            "ends_at": "2020-12-21T12:00:00+00:00",
            "min_total": numeric,
            "max_total": numeric,
            "applications": numeric,
            "redemption_frequency_threshold": numeric,
            "redemption_frequency_period": "day|week|month|year""segments": [
                {
                    "id": "5ef1ad79a44b5e15008b456e",
                    "name": ""
                }
            ],
            "stores": [
                {
                    "id": "5ef1ad79a44b5e15008b456e",
                    "name": ""
                }
            ],
            "exclusive": true/false,
            "required_match": "all/any",
            "required_items": [
                {
                    "type": "category|product|list",
                    "min_quantity": "1",
                    "id": [
                        "aa",
                        "bb",
                        "cc",
                        "dd"
                    ]
                }
            ],
            "eligible_match": "all|any",
            "eligible_items": [
                {
                    "type": "category/product/list",
                    "min_quantity": "1",
                    "id": [
                        "aa",
                        "bb",
                        "cc",
                        "dd"
                    ]
                }
            ],
            "discount": {
                "type": "fixed pice|fixed discount|percent discount",
                "value": numeric,
                "target": "all items|cheapest item|most expensive item",
                "max_quantity": numeric
            }
    "card_enabled": true|false,
            "card_title": {
                "en": "Card title"
            },
            "card_description": {d
            },
            "card_image"[],
            "issuance_start_at": "2020-07-21T12:00:00+00:00",
            "issuance_end_at": "2020-07-21T12:00:00+00:00",
            "display_coming_soon": true|false,
            "hide_restricted": true|false,
            "inventory_size": numeric,
            "inventory_scope": global|customer,
            "issuance_frequency_threshold": numeric,
            "issuance_frequency_period": "day|week|month|year"
        }
    ]
}