| PUT | /v1/VehicleSwap | Updates vehicle swap, order and back order records | This endpoint validates a swap vehicle and then calls an endpoint in the Agency API to update vehicle swap, order and back order and sends a message to OneAgent with the updated order vehicle and offers |
|---|
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 VehicleError:
field: Optional[str] = None
message: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateVehicleSwapResponse:
errors: Optional[List[VehicleError]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateVehicleSwapRequest(IPost):
vehicle_swap_guid: Optional[str] = None
order_guid: Optional[str] = None
back_order_guid: Optional[str] = None
gssn_id: Optional[str] = None
agent: Optional[str] = None
existing_vin: Optional[str] = None
swap_vin: Optional[str] = None
personalised_item_offer_ids: Optional[List[int]] = None
Python UpdateVehicleSwapRequest 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.
PUT /v1/VehicleSwap HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
VehicleSwapGuid: 00000000000000000000000000000000,
OrderGuid: 00000000000000000000000000000000,
BackOrderGuid: 00000000000000000000000000000000,
GssnId: String,
Agent: String,
ExistingVin: String,
SwapVin: String,
PersonalisedItemOfferIds:
[
0
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Errors:
[
{
Field: String,
Message: String
}
]
}