| POST | /purchase/v2 | Create Order |
|---|
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 StrapItem:
# @ApiMember(Description="Article reference")
speaking_article_code: Optional[str] = None
"""
Article reference
"""
# @ApiMember(Description="Buckle type Description")
buckle_type_description: Optional[str] = None
"""
Buckle type Description
"""
# @ApiMember(Description="Buckle type")
buckle_type_code: Optional[str] = None
"""
Buckle type
"""
# @ApiMember(Description="watch 6 Length")
watch6_length: Optional[int] = None
"""
watch 6 Length
"""
# @ApiMember(Description="watch 12 Length")
watch12_length: Optional[int] = None
"""
watch 12 Length
"""
# @ApiMember(Description="Article Material Code")
material_code: Optional[str] = None
"""
Article Material Code
"""
# @ApiMember(Description="Article Material Description")
material_description: Optional[str] = None
"""
Article Material Description
"""
# @ApiMember(Description="Article Color Code")
color_code: Optional[str] = None
"""
Article Color Code
"""
# @ApiMember(Description="Article Color Description")
color_description: Optional[str] = None
"""
Article Color Description
"""
# @ApiMember(Description="Buckle Witdh")
buckle_width: Optional[str] = None
"""
Buckle Witdh
"""
# @ApiMember(Description="Article Lining Code")
lining_code: Optional[str] = None
"""
Article Lining Code
"""
# @ApiMember(Description="Article Lining Description")
lining_description: Optional[str] = None
"""
Article Lining Description
"""
# @ApiMember(Description="Article Stitching Code")
stitching_code: Optional[str] = None
"""
Article Stitching Code
"""
# @ApiMember(Description="Article Stitching Description")
stitching_description: Optional[str] = None
"""
Article Stitching Description
"""
# @ApiMember(Description="Article Edge Code")
edge_code: Optional[str] = None
"""
Article Edge Code
"""
# @ApiMember(Description="Article Edge Description")
edge_description: Optional[str] = None
"""
Article Edge Description
"""
# @ApiMember(Description="Article Padding Code")
padding_code: Optional[str] = None
"""
Article Padding Code
"""
# @ApiMember(Description="Article Padding Description")
padding_description: Optional[str] = None
"""
Article Padding Description
"""
# @ApiMember(Description="Article Speciality Code")
specialty_code: Optional[str] = None
"""
Article Speciality Code
"""
# @ApiMember(Description="Article Speciality Description")
specialty_description: Optional[str] = None
"""
Article Speciality Description
"""
# @ApiMember(Description="Nuancier Code")
nuancier_code: Optional[str] = None
"""
Nuancier Code
"""
# @ApiMember(Description="Strap Vip Order")
is_strap_vip_order: Optional[bool] = None
"""
Strap Vip Order
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateOrderItemRequestV2:
# @ApiMember(Description="Line Number", IsRequired=true)
line_number: int = 0
"""
Line Number
"""
# @ApiMember(Description="Reference ID of the article/product, e.g. 'CRWB520003'", IsRequired=true)
article_code: Optional[str] = None
"""
Reference ID of the article/product, e.g. 'CRWB520003'
"""
# @ApiMember(Description="Desired quantity of the article", IsRequired=true)
quantity: int = 0
"""
Desired quantity of the article
"""
# @ApiMember(Description="Requested Delivery Date of the Item, e.g. '2020-12-30'")
requested_delivery_date: Optional[datetime.datetime] = None
"""
Requested Delivery Date of the Item, e.g. '2020-12-30'
"""
# @ApiMember(Description="Strap definition")
strap: Optional[StrapItem] = None
"""
Strap definition
"""
# @ApiMember(Description="Purchase order type, e.g. 'WCFS', null. Null for ordinary order")
order_type: Optional[str] = None
"""
Purchase order type, e.g. 'WCFS', null. Null for ordinary order
"""
# @ApiMember(Description="DeliveryPlantId of item, e.g.: CHD6")
delivery_plant_id: Optional[str] = None
"""
DeliveryPlantId of item, e.g.: CHD6
"""
# @ApiMember(Description="Reason Code", IsRequired=true)
reason_code: Optional[str] = None
"""
Reason Code
"""
# @ApiMember(Description="Order Delivery Priority, e.g.: 10, 20, 30, 40, 50")
order_delivery_priority: Optional[int] = None
"""
Order Delivery Priority, e.g.: 10, 20, 30, 40, 50
"""
# @ApiMember(Description="Buckle Summary, can be get from order simulation")
buckle_summary: Optional[str] = None
"""
Buckle Summary, can be get from order simulation
"""
# @ApiMember(Description="Material Summary, can be get from order simulation")
material_summary: Optional[str] = None
"""
Material Summary, can be get from order simulation
"""
# @ApiMember(Description="Content Summary, can be get from order simulation")
content_summary: Optional[str] = None
"""
Content Summary, can be get from order simulation
"""
# @ApiMember(Description="Strap Summary, can be get from order simulation")
strap_summary: Optional[str] = None
"""
Strap Summary, can be get from order simulation
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SplittedOrder:
# @ApiMember(Description="Ship To Pos Code", IsRequired=true)
ship_to_id: Optional[str] = None
"""
Ship To Pos Code
"""
# @ApiMember(Description="Final Ship To Pos Code")
final_ship_to_id: Optional[str] = None
"""
Final Ship To Pos Code
"""
# @ApiMember(Description="Bill To Pos Code", IsRequired=true)
bill_to_id: Optional[str] = None
"""
Bill To Pos Code
"""
# @ApiMember(Description="Sold To Pos Code", IsRequired=true)
sold_to_id: Optional[str] = None
"""
Sold To Pos Code
"""
# @ApiMember(Description="Sales Representative Code")
sales_representative_id: Optional[str] = None
"""
Sales Representative Code
"""
# @ApiMember(Description="List of Articles to be created", IsRequired=true)
order_items: Optional[List[CreateOrderItemRequestV2]] = None
"""
List of Articles to be created
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EndCustomerDetails:
# @ApiMember(Description="Title of the end Customer, e.g. 'MR', 'MRS'.")
title: Optional[str] = None
"""
Title of the end Customer, e.g. 'MR', 'MRS'.
"""
# @ApiMember(Description="First Name of the end Customer", IsRequired=true)
first_name: Optional[str] = None
"""
First Name of the end Customer
"""
# @ApiMember(Description="Last Name of the end Customer", IsRequired=true)
last_name: Optional[str] = None
"""
Last Name of the end Customer
"""
# @ApiMember(Description="Email of the end Customer")
email: Optional[str] = None
"""
Email of the end Customer
"""
# @ApiMember(Description="Phone number of the end Customer, e.g. '0032477123456'. ")
phone: Optional[str] = None
"""
Phone number of the end Customer, e.g. '0032477123456'.
"""
# @ApiMember(Description="Countr code in the shipping address, e.g. 'BE' (ISO Code)", IsRequired=true)
country: Optional[str] = None
"""
Countr code in the shipping address, e.g. 'BE' (ISO Code)
"""
# @ApiMember(Description="City name in the shipping address", IsRequired=true)
city: Optional[str] = None
"""
City name in the shipping address
"""
# @ApiMember(Description="Street name in the shipping address", IsRequired=true)
street: Optional[str] = None
"""
Street name in the shipping address
"""
# @ApiMember(Description="House number in the shipping address")
house_number: Optional[str] = None
"""
House number in the shipping address
"""
# @ApiMember(Description="Building number in the shipping address")
building: Optional[str] = None
"""
Building number in the shipping address
"""
# @ApiMember(Description="Postal code in the shipping address")
postal_code: Optional[str] = None
"""
Postal code in the shipping address
"""
# @ApiMember(Description="Region code in the shipping address, e.g. 'VL' (ISO Code)")
region: Optional[str] = None
"""
Region code in the shipping address, e.g. 'VL' (ISO Code)
"""
# @ApiMember(Description="District name in the shipping address")
district: Optional[str] = None
"""
District name in the shipping address
"""
# @ApiMember(Description="Additional Info number to the shipping address")
additional_info: Optional[str] = None
"""
Additional Info number to the shipping address
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateOrderV2:
# @ApiMember(Description="Purchase order ID, total length-max with x-booster-App header: 99", IsRequired=true)
order_id: Optional[str] = None
"""
Purchase order ID, total length-max with x-booster-App header: 99
"""
# @ApiMember(Description="Global Pos Code for the intended Order e.g. ES100:102048", IsRequired=true)
pos_code: Optional[str] = None
"""
Global Pos Code for the intended Order e.g. ES100:102048
"""
# @ApiMember(Description="Brand Trigram of the intended Order, e.g. 'IWC', 'CAR', etc.", IsRequired=true)
brand: Optional[str] = None
"""
Brand Trigram of the intended Order, e.g. 'IWC', 'CAR', etc.
"""
# @ApiMember(Description="Additional Notes regarding the Order")
notes: Optional[str] = None
"""
Additional Notes regarding the Order
"""
# @ApiMember(Description="Customer Reference")
customer_reference: Optional[str] = None
"""
Customer Reference
"""
# @ApiMember(Description="Customer Reference for Consignment Order")
customer_reference_consignment: Optional[str] = None
"""
Customer Reference for Consignment Order
"""
# @ApiMember(Description="Purchase order date, e.g. '2020-12-31'")
order_date: Optional[datetime.datetime] = None
"""
Purchase order date, e.g. '2020-12-31'
"""
# @ApiMember(Description="Details of the end Customer")
splitted_orders: Optional[List[SplittedOrder]] = None
"""
Details of the end Customer
"""
# @ApiMember(Description="Booster1 ID of the end Customer")
end_customer_booster1_id: Optional[str] = None
"""
Booster1 ID of the end Customer
"""
# @ApiMember(Description="Details of the end Customer")
end_customer_details: Optional[EndCustomerDetails] = None
"""
Details of the end Customer
"""
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 /purchase/v2 HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
orderId: String,
posCode: String,
brand: String,
notes: String,
customerReference: String,
customerReferenceConsignment: String,
orderDate: 0001-01-01,
splittedOrders:
[
{
shipToId: String,
finalShipToId: String,
billToId: String,
soldToId: String,
salesRepresentativeId: String,
orderItems:
[
{
lineNumber: 0,
articleCode: String,
quantity: 0,
requestedDeliveryDate: 0001-01-01,
strap:
{
speakingArticleCode: String,
buckleTypeDescription: String,
buckleTypeCode: String,
watch6Length: 0,
watch12Length: 0,
materialCode: String,
materialDescription: String,
colorCode: String,
colorDescription: String,
buckleWidth: String,
liningCode: String,
liningDescription: String,
stitchingCode: String,
stitchingDescription: String,
edgeCode: String,
edgeDescription: String,
paddingCode: String,
paddingDescription: String,
specialtyCode: String,
specialtyDescription: String,
nuancierCode: String,
isStrapVipOrder: False
},
orderType: String,
deliveryPlantId: String,
reasonCode: String,
orderDeliveryPriority: 0,
buckleSummary: String,
materialSummary: String,
contentSummary: String,
strapSummary: String
}
]
}
],
endCustomerBooster1Id: String,
endCustomerDetails:
{
title: String,
firstName: String,
lastName: String,
email: String,
phone: String,
country: String,
city: String,
street: String,
houseNumber: String,
building: String,
postalCode: String,
region: String,
district: String,
additionalInfo: String
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
}