Dropship Rules API Testing
API-DROPSHIP-001: Create Sales Order using DROPSHIP-SPECIAL Product
1
2
3
POST /api/sales-order/create
Authorization: Bearer <token>
Content-Type: application/json
Request Body
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"orderType": "GUIDED_SALES",
"customerId": "CUST-001",
"businessModel": "DROPSHIP-SPECIAL",
"items": [
{
"productCode": "DROPSHIP-PROD-001",
"quantity": 10,
"unitPrice": 1250000
}
],
"deliveryDate": "2026-07-02",
"paymentMethod": "CREDIT"
}
Expected Response (Success)
1
2
3
4
5
6
7
8
9
10
11
{
"success": true,
"statusCode": 201,
"orderId": "SO-LEGAL-20260629-045",
"status": "SUBMITTED",
"message": "Sales Order created successfully",
"legalNumberPrefix": "LEGAL-XXX",
"availableStockDisplayed": 999999,
"deliveryDate": "2026-07-02",
"businessModel": "DROPSHIP-SPECIAL"
}
API-DROPSHIP-002: Validate Available Stock for DROPSHIP-SPECIAL Product
1
GET /api/product/DROPSHIP-PROD-001/stock
Expected Response
1
2
3
4
5
6
7
8
9
{
"productCode": "DROPSHIP-PROD-001",
"businessModel": "DROPSHIP-SPECIAL",
"displayedStock": 999999,
"actualStock": null,
"locationRestricted": true,
"allowedLocations": ["MOBILE-WAREHOUSE"],
"message": "Stock display is hardcoded for DROPSHIP-SPECIAL products"
}
API-DROPSHIP-003: Validate No Stock Movement Reflected in Inventory
1
GET /api/inventory/stock-ledger?productCode=DROPSHIP-PROD-001
Expected Response
1
2
3
4
5
6
{
"productCode": "DROPSHIP-PROD-001",
"transactions": [],
"totalStock": 0,
"message": "No inventory stock movement recorded for DROPSHIP-SPECIAL products as per HARD CODE rule"
}
API-DROPSHIP-004: Negative Case - Invalid Location Attempt
1
POST /api/stock/movement
Request Body
1
2
3
4
5
6
{
"productCode": "DROPSHIP-PROD-001",
"fromLocation": "MOBILE-WAREHOUSE",
"toLocation": "DEVICE",
"quantity": 20
}
Expected Response
1
2
3
4
5
6
{
"success": false,
"statusCode": 400,
"message": "Movement to DEVICE is not allowed for DROPSHIP-SPECIAL products",
"errorCode": "HARD_CODE_LOCATION_RESTRICTION"
}
API Testing Summary
| Test Case | Endpoint | Method | Expected Behavior |
|---|---|---|---|
| Create Sales Order | /api/sales-order/create | POST | Success + Status SUBMITTED |
| Check Displayed Stock | /api/product/{code}/stock | GET | Returns 999999 |
| Check Inventory Ledger | /api/inventory/stock-ledger | GET | No movement recorded |
| Invalid Stock Movement | /api/stock/movement | POST | Rejected (400) |