Cart Management
The shopping cart is list of the products that a customer want to buy.
When he's ready to pay, he confirm that buying intention by converting that cart into an order. Doing so, his cart becomes empty, and the order is created.
Get cart
Retrieve the cart of the user logged in.
Example
https://wsmedia.tlsecure.com/api/json/00000/cart/
Request
HTTP Verb : GET
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
Response
Success
{
"response": {
"success": true
"code": 0
"message": "cart retrieved"
"object": {
"cart": {
"customer": 586
"productsQuantity": 1
"price": 22.5
"totalPrice": 22.5
"creationDate": "2016-03-03 11:39:45"
"deliveryType": 1
"paymentMethod": 1
"lines": {
"line": [1]
0: {
"id": 2
"ean": 9789462500877
"title": "Kip"
"author": "Marcus Bean & Ellen Hosmar"
"price": 22.5
"quantity": 1
"productForm": "BB"
}
}
"deliveryAddress": {
"id": 3
"user": 586
"addressType": 1
"firstName": "Spider"
"lastName": "Man"
"adressLine1": "Victoria Street"
"number": 44
"postcode": "10025"
"city": "New York"
"country": 3
"default": false
}
"invoiceAddress": {
"id": 3
"user": 586
"addressType": 1
"firstName": "Spider"
"lastName": "Man"
"adressLine1": "Victoria Street"
"number": 44
"postcode": "10025"
"city": "New York"
"country": 3
"default": false
}
}
}
}
}
Error
{
"response": {
"success": false
"code": 10
"message": "no cart at this time"
}
}
Codelist
Code | Success | Message |
---|---|---|
0 | v | retrieving cart |
1 |
| Domain code missing or malformed |
2 |
| Required field empty |
3 |
| Required field malformed |
4 |
| There is not session with this token |
10 |
| no cart at this time |
Check cart
That service allows you tho check whether or not a cart is valid.
To be valid, a cart need to have products, a payment method, a facturation address, a delivery type, a delivery address (or the shop where the delivery will be).
A check is not needed. A cart confirmation (see below) will in any case perform one.
Example
https://wsmedia.tlsecure.com/api/json/00000/cart/check
Request
HTTP Verb : GET
URL : http://{WS_URL}/api/{returnType}/{domainCode}/cart/check
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
Response
Success
{
"response": {
"success": true
"code": 0
"message": "valid cart"
"object": {
"cart": {
"customer": 586
"price": 22.5
"totalPrice": 22.5
"creationDate": "2016-03-03 11:39:45"
"deliveryType": 1
"paymentMethod": 1
"lines": {
"line": [1]
0: {
"id": 2
"ean": 9789462500877
"title": "Kip"
"author": "Marcus Bean & Ellen Hosmar"
"price": 22.5
"quantity": 1
"productForm": "BB"
}
}
"deliveryAddress": {
"id": 3
"user": 586
"addressType": 1
"firstName": "Spider"
"lastName": "Man"
"adressLine1": "Victoria Street"
"number": 44
"postcode": "10025"
"city": "New York"
"country": 3
"default": false
}
"invoiceAddress": {
"id": 3
"user": 586
"addressType": 1
"firstName": "Spider"
"lastName": "Man"
"adressLine1": "Victoria Street"
"number": 44
"postcode": "10025"
"city": "New York"
"country": 3
"default": false
}
}
}
}
}
Error
Codelist
Code | Success | Message |
---|---|---|
0 | v | cart is valid |
1 |
| Domain code missing or malformed |
2 |
| Required field empty |
3 |
| Required field malformed |
4 |
| There is not session with this token |
10 |
| cart does not exist |
11 |
| cart already became an order |
12 |
| cart contains no products |
13 |
| cart error - does not belong to shop |
14 |
| cart belongs to a unregistred user while no email address has been given |
15 |
| facturation address not set |
16 |
| facturation address does not exist |
17 |
| delivery type not set |
18 |
| delivery type does not exist / is not defined |
19 |
| delivery address not set |
20 |
| facturation address does not exist |
21 |
| delivery in shop set while no shop has been selected |
22 |
| shop to be delivered in not exist |
23 |
| payment method not set |
24 |
| payment method does not exist / is not defined |
25 |
| payment in shop must have delivery in shop |
99 |
| Uncatched exception |
Confirm cart
Cart confirmation put an end to the cart, and create a “pending” order out of it.
It won't be updatable anymore. Any further cart actions will result by a new cart to be made.
This order is in status pending (see here the order status list). For the order process to get further, it will need a status update. That can be made by two ways :
The first one , we handle the payment process by ourselves. That involve some other webservices call (MSP and Buckaroo) as well.
The second one, you choose to implement the payment process by your side. In that case, when the payment is done, you only have to push that information by the order status update service. Then, the order will trace its way through the rest of the order process.
Example
https://wsmedia.tlsecure.com/api/json/00000/cart/confirm
Request
HTTP Verb : PUT
URL : http://{WS_URL}/api/{returnType}/{domainCode}/cart/confirm
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
Content-Type | Header | String | v | application/x-www-form-urlencoded |
|
Response
Success
Error
Codelist
Code | Success | Message |
---|---|---|
0 | v | order saved |
1 |
| Domain code missing or malformed |
2 |
| Required field empty |
3 |
| Required field malformed |
4 |
| There is not session with this token |
10 |
| cart does not exist |
11 |
| cart already became an order |
12 |
| cart contains no products |
13 |
| cart error - does not belong to shop |
14 |
| cart belongs to a unregistred user while no email address has been given |
15 |
| facturation address not set |
16 |
| facturation address does not exist |
17 |
| delivery type not set |
18 |
| delivery type does not exist / is not defined |
19 |
| delivery address not set |
20 |
| facturation address does not exist |
21 |
| delivery in shop set while no shop has been selected |
22 |
| payment method not set |
23 |
| payment method does not exist / is not defined |
99 |
| Uncatched exception |
Cart lines
Click here for more information.
Informations
Click here for more information.
Giftwrap
Click here for more information.
Discount
Click here for more information.