All Verbs | /account/billing | ||
---|---|---|---|
All Verbs | /BillingHistory |
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 BillingHistory:
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Invoice:
order_id: int = 0
date: datetime.datetime = datetime.datetime(1, 1, 1)
description: Optional[str] = None
item_quantity: int = 0
total: int = 0
paid: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BillingHistoryResponse:
invoices: Optional[List[Invoice]] = None
response_status: Optional[ResponseStatus] = None
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /account/billing HTTP/1.1
Host: account.servicestack.net
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"invoices":[{"orderId":0,"date":"\/Date(-62135596800000-0000)\/","description":"String","itemQuantity":0,"total":0,"paid":false}],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}