BokaMera.API.Host

<back to all web services

CompanyCreditCardInformation

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, bookingsupplier-administrator-read, superadmin
The following routes are available for this service:
GET/billing/company/creditcardGet saved credit card information for the company.Get saved credit card information for the company.
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 QueryBase:
    skip: Optional[int] = None
    """
    Skip over a given number of elements in a sequence and then return the remainder. Use this when you need paging.<br/><br/><strong>Example:</strong><br/><code>?skip=10&orderBy=Id</code>
    """

    take: Optional[int] = None
    """
    Return a given number of elements in a sequence and then skip over the remainder. Use this when you need paging.<br/><br/><strong>Example:</strong><br/><code>?take=20</code>
    """

    order_by: Optional[str] = None
    """
    Comma separated list of fields to order by. Prefix the field name with a minus if you wan't to invert the sort for that field.<br/><br/><strong>Example:</strong><br/><code>?orderBy=Id,-Age,FirstName</code>
    """

    order_by_desc: Optional[str] = None
    """
    Comma separated list of fields to order by in descending order. Prefix the field name with a minus if you wan't to invert the sort for that field.<br/><br/><strong>Example:</strong><br/><code>?orderByDesc=Id,-Age,FirstName</code>
    """

    include: Optional[str] = None
    """
    Include any of the aggregates <code>AVG, COUNT, FIRST, LAST, MAX, MIN, SUM</code> in your result set. The results will be returned in the meta field.<br/><br/><strong>Example:</strong><br/><code>?include=COUNT(*) as Total</code><br/><br/>or multiple fields with<br/><code>?include=Count(*) Total, Min(Age), AVG(Age) AverageAge</code><br/></br>or unique with<br/><code>?include=COUNT(DISTINCT LivingStatus) as UniqueStatus</code>
    """

    fields: Optional[str] = None
    meta: Optional[Dict[str, str]] = None


From = TypeVar('From')
Into = TypeVar('Into')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryDb2(Generic[From, Into], QueryBase, IReturn[QueryResponse[Into]]):
    @staticmethod
    def response_type(): return QueryResponse[Into]


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CompanyCreditCardQueryResponse:
    # @ApiMember(Description="The credit card id")
    id: int = 0
    """
    The credit card id
    """


    # @ApiMember(Description="The credit card name")
    name: Optional[str] = None
    """
    The credit card name
    """


    # @ApiMember(Description="If the credit card is active")
    active: bool = False
    """
    If the credit card is active
    """


    # @ApiMember(Description="If the credit card is valid (active and not expired)")
    is_valid: bool = False
    """
    If the credit card is valid (active and not expired)
    """


    # @ApiMember(Description="The credit card type")
    type: Optional[str] = None
    """
    The credit card type
    """


    # @ApiMember(Description="The credit card expiration Year")
    exp_year: Optional[str] = None
    """
    The credit card expiration Year
    """


    # @ApiMember(Description="The credit card expiration month")
    exp_month: Optional[str] = None
    """
    The credit card expiration month
    """


    # @ApiMember(Description="The credit card ticket name. This is secret information and won't be displayed")
    ticket_id: Optional[str] = None
    """
    The credit card ticket name. This is secret information and won't be displayed
    """


    # @ApiMember(Description="The date when the credit card was saved.")
    created: Optional[datetime.datetime] = None
    """
    The date when the credit card was saved.
    """


    # @ApiMember(Description="The date when the credit card was updated.")
    updated: Optional[datetime.datetime] = None
    """
    The date when the credit card was updated.
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseModel:
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreditCard(BaseModel):
    # @Ignore()
    is_valid: bool = False

    # @Required()
    company_id: Optional[str] = None

    id: int = 0
    # @Required()
    name: Optional[str] = None

    # @Required()
    active: bool = False

    # @Required()
    type: Optional[str] = None

    # @Required()
    exp_year: Optional[str] = None

    # @Required()
    exp_month: Optional[str] = None

    # @Required()
    ticket_id: Optional[str] = None

    updated: Optional[datetime.datetime] = None
    created: Optional[datetime.datetime] = None
    modified_date: Optional[datetime.datetime] = None


# @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
# @ValidateRequest(Validator="IsAuthenticated")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CompanyCreditCardInformation(QueryDb2[CreditCard, CompanyCreditCardQueryResponse], ICompany):
    # @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
    company_id: Optional[str] = None
    """
    The company id, if empty will use the company id for the user you are logged in with.
    """


    # @ApiMember(DataType="boolean", Description="If you want to include only active credit cards", ParameterType="query")
    active: bool = False
    """
    If you want to include only active credit cards
    """


    # @ApiMember(DataType="boolean", Description="If you want to include only valid credit cards (not expired and valid)", ParameterType="query")
    is_valid: bool = False
    """
    If you want to include only valid credit cards (not expired and valid)
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AccessKeyTypeResponse:
    id: int = 0
    key_type: Optional[str] = None
    description: Optional[str] = None


AccessKeyTypeResponse = TypeVar('AccessKeyTypeResponse')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryResponse(Generic[AccessKeyTypeResponse]):
    offset: int = 0
    total: int = 0
    results: Optional[List[AccessKeyTypeResponse]] = None
    meta: Optional[Dict[str, str]] = None
    response_status: Optional[ResponseStatus] = None

Python CompanyCreditCardInformation DTOs

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

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /billing/company/creditcard HTTP/1.1 
Host: api.bokamera.se 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Offset":0,"Total":0,"Results":[{"Id":0,"Name":"String","Active":false,"IsValid":false,"Type":"String","ExpYear":"String","ExpMonth":"String","TicketId":"String","Created":"0001-01-01T00:00:00","Updated":"0001-01-01T00:00:00"}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}