これらの要求パラメーターは、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プラットフォームに返される注文確認の詳細を定義します。
|
パラメーター |
必須 |
|
Status |
✅ |
|
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>