StoreApi - PurchaseBox¶
Swagger: https://sandbox-cn.archiproducts.com/estoreapi/swagger/index.html
Endpoint: PurchaseBox¶
- Method:
POST - URL:
/estoreapi/api/v1/purchasebox?culture={culture}&apikey={apikey}
Request¶
| Name | Description | Type | Mandatory |
|---|---|---|---|
config |
Config request | Object | Y |
productId |
Product id | Integer | N* |
productGuid |
Outlet id | Guid | N* |
quantity |
Quantity must be greater than 0 and less than 1000 | Integer | Y |
attributeId |
attribute string | String | N |
userToken |
user token | GUID | N |
* At least one of the two must be supported
PurchaseBoxConfig¶
| Name | Description | Type | Mandatory |
|---|---|---|---|
shippingPrice |
Get article shipping Price | Boolean | Y |
shippingInfo |
Get article ShippingInfo | Boolean | Y |
applyDiscount |
Apply Platform discount | Boolean | Y |
has3d |
Add additiona data for 3d expivi | Boolean | Y |
usePricePolicy |
Use price policy | Boolean | Y |
If the expected behavior is to have the estimated dimensions of the individual item's packages, rather than the estimated shipping costs, the box should be configured with the following parameters:
1 2 3 4 5 6 7 | |
Response¶
PurchaseBoxResponse¶
View Swagger documentation for model PurchaseBoxResponse
The first field to check is haveBox, to evaluate if the product has a purchase box and the product is sellable.
The isFullConfiguration field indicates that a product is fully configured. An item is fully configured, if all selects have at least one option selected (isSelected field)
Then you need to call the endpoint interactively by changing the attributeId parameter in the request with the toSelect parameter during configuration.
The CanBuy field indicates whether the product configuration is complete and can be purchased, if isFullConfiguration is true but canBuy not, means that you have received some warnings.
To configure a product, you need to select an option (PurchaseBoxResponseOption) from the selections (PurchaseBoxResponseSelect). For each option selected, you need to call the endpoint by adding the value in the toSelect field as the attributeId value in the next request. Until the isFullConfiguration field becomes true.
If the isFullConfiguration field is true and the canBuy field is false, check the possible warnings
flowchart TD
A["Call purchaseBox"] --> B{"haveBox?"}
B -- false --> n1(["Product not for sale"])
B -- true --> n2{"isFullConfiguration"}
n2 -- true --> n3{"canBuy"}
n3 -- true --> n4(["Product for sale"])
n2 -- false --> n5["Edit configuration"]
n5 --> A
n3 -- false --> n6["View Warnings"]
n6 --> n5
n1:::Rose
n4:::Rose
classDef Sky stroke-width:1px, stroke-dasharray:none, stroke:#374D7C, fill:#E2EBFF, color:#374D7C
classDef Rose stroke-width:1px, stroke-dasharray:none, stroke:#FF5978, fill:#FFDFE5, color:#8E2236
Notables fields¶
- minQuantity
- Indicates the minimum quantity that can be purchased
- availability
- Indicates the number of products already in stock.
- null value indicates that there is no availability in stock.
- outOfOrder
- Indicates that the product is out of production
- If out of production, it can be purchased at most the quantity in stock
- uomConfig
- Present if the product is sold per unit of measure
Article mandatory field¶
When a product is purchasable, it is necessary to save these fields:
| Name | Description | Where |
|---|---|---|
productId |
ProductId | From the request |
productGuid |
Outlet id | From the request |
manufacturerId |
ManufacturerId | From the response of purchaseBox field manufacturerId |
itemIds |
ItemIds | From the response of purchasebox field items |
attrIds |
AttributeIds | From the response of purchasebox field selectedAttribute |
quantity |
Quantity | From the response of purchasebox field quantity |