All Verbs | /quote/{Id}/{Quantity} | ||
---|---|---|---|
All Verbs | /quote/{Id}/{Quantity}/{Coupon} | ||
GET | /GetQuote | ||
GET | /GetQuote/{Id} |
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 QuoteResponse:
sku_id: int = 0
code: Optional[str] = None
customer_id: Optional[int] = None
modifying_existing_subscription: bool = False
changing_subscriptions: bool = False
switching_licensing_models: bool = False
replaces_existing_quantity: bool = False
existing_subscription_quantity: Optional[int] = None
new_subscription_quantity: Optional[int] = None
unused_amount: Optional[str] = None
manual_prorating: bool = False
unused_days: int = 0
quantity: int = 0
min_quantity: int = 0
max_quantity: Optional[int] = None
subtotal: Optional[str] = None
discount_description: Optional[str] = None
discount_received: Optional[str] = None
discount: Optional[str] = None
total: Optional[str] = None
expiry_date: Optional[str] = None
renewal_date: Optional[str] = None
is_referrer: bool = False
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetQuote(IGet):
id: int = 0
quantity: int = 0
coupon: Optional[str] = None
renewal_ref: Optional[str] = None
upgrade_ref: Optional[str] = None
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /quote/{Id}/{Quantity} HTTP/1.1
Host: account.servicestack.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: 0,
quantity: 0,
coupon: String,
renewalRef: String,
upgradeRef: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { skuId: 0, code: String, customerId: 0, modifyingExistingSubscription: False, changingSubscriptions: False, switchingLicensingModels: False, replacesExistingQuantity: False, existingSubscriptionQuantity: 0, newSubscriptionQuantity: 0, unusedAmount: String, manualProrating: False, unusedDays: 0, quantity: 0, minQuantity: 0, maxQuantity: 0, subtotal: String, discountDescription: String, discountReceived: String, discount: String, total: String, expiryDate: String, renewalDate: String, isReferrer: False, responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } } }