| GET | /customer/{boosterCustomerId}/kpi | Get customer KPI details |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetCustomerKpiResponse:
# @ApiMember(Description="Booster Customer ID", IsRequired=true)
booster_customer_id: int = 0
"""
Booster Customer ID
"""
# @ApiMember(Description="Total Transaction", IsRequired=true)
total_transaction: int = 0
"""
Total Transaction
"""
# @ApiMember(Description="Total Sales", IsRequired=true)
total_sales: int = 0
"""
Total Sales
"""
# @ApiMember(Description="Total Return", IsRequired=true)
total_return: int = 0
"""
Total Return
"""
# @ApiMember(Description="Total Items", IsRequired=true)
total_items: int = 0
"""
Total Items
"""
# @ApiMember(Description="Average Basket Amount", IsRequired=true)
average_basket_amount: Decimal = decimal.Decimal(0)
"""
Average Basket Amount
"""
# @ApiMember(Description="Total Spending Amount", IsRequired=true)
total_spending_amount: float = 0.0
"""
Total Spending Amount
"""
# @ApiMember(Description="Currency code e.g. 'EUR', 'CHF'", IsRequired=true)
currency_code: Optional[str] = None
"""
Currency code e.g. 'EUR', 'CHF'
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetCustomerKpi:
# @ApiMember(Description="Booster Customer ID", IsRequired=true)
booster_customer_id: int = 0
"""
Booster Customer ID
"""
# @ApiMember(Description="Transaction Date From e.g. '2022-01-01'")
transaction_date_from: Optional[datetime.datetime] = None
"""
Transaction Date From e.g. '2022-01-01'
"""
# @ApiMember(Description="Transaction Date To e.g. '2023-11-01'")
transaction_date_to: Optional[datetime.datetime] = None
"""
Transaction Date To e.g. '2023-11-01'
"""
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /customer/{boosterCustomerId}/kpi HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"boosterCustomerId":0,"totalTransaction":0,"totalSales":0,"totalReturn":0,"totalItems":0,"averageBasketAmount":0,"totalSpendingAmount":0,"currencyCode":"String"}