POST | /v1/configurator | Validate and save a car configurator code for a back order | This endpoint calls Agency API to validate and save a car configurator code for a back order. The code is validated and saved in the database and returns a response from a third party CCS which provides car configuration details. These get saved to open search and returned to the front-end |
---|
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 KeyInformation:
b_m7_n_s_t: Optional[str] = None
configuration_date: Optional[str] = None
model_year: Optional[str] = None
half_year: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OrderingOptions:
interior: Optional[List[str]] = None
exterior: Optional[List[str]] = None
other: Optional[List[str]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CarConfiguratorResponse:
name: Optional[str] = None
key_information: Optional[KeyInformation] = None
ordering_options: Optional[OrderingOptions] = None
response_status: Optional[ResponseStatus] = None
configurator_code: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CarConfiguratorRequest(IPost):
# @ApiMember(Description="Configurator code", IsRequired=true)
configurator_code: Optional[str] = None
"""
Configurator code
"""
Python CarConfiguratorRequest DTOs
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 /v1/configurator HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ConfiguratorCode: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Name: String, KeyInformation: { BM7NST: String, ConfigurationDate: String, ModelYear: String, HalfYear: String }, OrderingOptions: { Interior: [ String ], Exterior: [ String ], Other: [ String ] }, ResponseStatus: { ErrorCode: String, Message: String, StackTrace: String, Errors: [ { ErrorCode: String, FieldName: String, Message: String, Meta: { String: String } } ], Meta: { String: String } }, ConfiguratorCode: String }