check_cart
Every time a customer changes the contents of the cart in the Mobile Website or apps this action will be requested to validate the contents. This is currently used to validate coupons, check the stock of the items and return shipping service providers of the shopping cart system. Future applications include a change of products for the cart contents.
Query parameters
The exact “internal_cart_info” that was returned on the last “check_cart” request for this particular cart.
The customer number in the Shopgate system.
Customer number in the shopping cart system (if registered via Shopgate Connect).
The customer’s database ID in the shopping cart system (if registered via Shopgate Connect).
The ID of the customer group in the shopping cart system.
Name of customer group.
The customer’s mail address.
Shipping amount
Shpping Service ID
API Version, “MANUAL” if no API was used.
Payment group chosen by the customer.
Payment method chosen by the customer.
Response
False means no error.
Error text; null means no error.
Shopgate Library version.
Plugin version.
Request trace-ID, needed as reference for contact
Information regarding this particular cart, that you want to have passed on the next “check_cart” request.
The currency of the cart.
Error Codes
Code | Description |
---|---|
2 | cannot open/create logfile(s) |
10 | invalid value in configuration |
11 | error reading or writing configuration |
20 | no action specified |
21 | unknown action requested |
22 | disabled action requested |
23 | wrong response format |
83 | database error |
100 | no connection to server |
101 | Unknown action |
102 | error code received from merchant API |
120 | authentication failed |
200 | the coupon is not valid |
201 | the coupon code is not valid |
202 | products for coupon are not valid |
203 | delivery address for coupon is not valid |
204 | user is not valid for coupon |
205 | too many coupons in cart |
300 | product is not in stock |
301 | product not found |
302 | less stock available than requested |
303 | product input validation failed: text too long |
304 | requested quantity is lower than required minimum quantity |
305 | requested quantity is higher than allowed maximum quantity |
306 | products can not be ordered together |
307 | product not allowed in cart constellation |
999 | Unknown error |
Example
{
"error": 0,
"error_text": null,
"trace_id": null,
"shopgate_library_version": "2.4.14",
"plugin_version": "2.4.29",
"currency": "USD",
"internal_cart_info": "{\"cart_id\":82,\"coupons\":[{\"code\":\"spring30\",\"status\":\"removed\"},{\"code\":\"shipfree\",\"status\":\"applied\"}]}",
"customer": {
"customer_tax_class_key": "Retail Customer",
"customer_groups": [
{
"id": "1"
},
{
"id": "13"
}
]
},
"shipping_methods": [
{
"id": "flatrate_flatrate",
"title": "Fixed",
"shipping_group": "flatrate",
"description": "",
"sort_order": null,
"amount": 50,
"amount_with_tax": 50,
"tax_class": 0,
"tax_percent": "0.00",
"internal_shipping_info": null
}
],
"items": [
{
"item_number": "1",
"is_buyable": 1,
"qty_buyable": 5,
"unit_amount": 750,
"unit_amount_with_tax": 750,
"error": null,
"error_text": null,
"options": [],
"inputs": [],
"attributes": []
},
{
"item_number": "126-127",
"is_buyable": 1,
"qty_buyable": 5,
"unit_amount": 18.75,
"unit_amount_with_tax": 18.75,
"error": null,
"error_text": null,
"options": [],
"inputs": [],
"attributes": []
},
{
"item_number": "1",
"is_buyable": 0,
"qty_buyable": 0,
"unit_amount": 0,
"unit_amount_with_tax": 0,
"error": 300,
"error_text": "product is not in stock",
"options": [],
"inputs": [],
"attributes": []
}
],
"external_coupons": [
{
"is_valid": false,
"not_valid_message": "Coupon code \"shopgate\n\" is not valid.",
"code": "shopgate\n",
"name": null,
"description": null,
"amount": null,
"amount_net": null,
"amount_gross": null,
"tax_type": "auto",
"currency": null,
"is_free_shipping": null,
"internal_info": null
}
],
"payment_methods": [
{
"id": "cod"
},
{
"id": "paypal"
}
]
}