これらのリクエストパラメーターでは、ECプラットフォームから送信される注文詳細を定義します。
|
パラメーター |
型 |
使用可能な正規表現 |
最小文字数 |
最大文字数 |
初期値 |
必須 |
|
OrderID |
文字列 |
^[A-Za-z0-9]{5,10}$ |
5 |
20 |
- |
✅ |
|
CustomerID |
文字列 |
[^[A-Za-z0-9]{5,10}$ |
5 |
20 |
- |
✅ |
|
ProductID |
文字列 |
^[A-Za-z0-9]{5,10}$ |
5 |
20 |
- |
✅ |
|
Quantity |
整数 |
\d+ |
1 |
5 |
1 |
✅ |
|
OrderDate |
日付 |
^[A-Za-z0-9]{5,10}$ |
- |
- |
- |
✅ |
これらのレスポンスパラメーターにより、ECプラットフォームに返される注文確認の詳細が定義されます。
|
パラメーター |
必須 |
|
ステータス |
✅ |
|
OrderReference |
✅ |
Qntrlでは、soapRequestオブジェクトを使用してリクエストを処理し、値を抽出します。
let orderID = soapRequest.getParam('OrderID');
let customerID = soapRequest.getParam('CustomerID');
let productID = soapRequest.getParam('ProductID');
let quantity = soapRequest.getParam('Quantity');
let orderDate = soapRequest.getParam('OrderDate');
// Business logic: Validate and store the order
if (!validateOrder(orderID, customerID, productID, quantity, orderDate)) {
soapResponse.setFault('INVALID_ORDER', 'Order validation failed.');
} else {
let orderRef = processOrder(orderID, customerID, productID, quantity, orderDate);
soapResponse.setParam('Status', 'Success');
soapResponse.setParam('OrderReference', orderRef);
}
Qntrlは、XMLレスポンスを返し、注文が正常に処理されたかどうかを通知します。
SOAPレスポンスのサンプル
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
<soapenv:Body>
<OrderResponse>
<Status>Success</Status>
<OrderReference>ORD12345XYZ</OrderReference>
</OrderResponse>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope
xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:ord='https://core.qntrl.com/webservice/soap/orderManagement'>
<soapenv:Header>
<ord:AuthHeader>
<ord:Username>APIUser</ord:Username>
</ord:AuthHeader>
</soapenv:Header>
<soapenv:Body>
<ord:PlaceOrder>
<ord:OrderID>ORD67890</ord:OrderID>
<ord:CustomerID>CUST54321</ord:CustomerID>
<ord:ProductID>PROD1122</ord:ProductID>
<ord:Quantity>2</ord:Quantity>
<ord:OrderDate>2025-04-10</ord:OrderDate>
</ord:PlaceOrder>
</soapenv:Body>
</soapenv:Envelope>