Giftwraps
The giftwrap is an information related to a product line in the cart.
Set giftwrap
Set a giftwrap to some products on a cart line.
Example
https://wsmedia.tlsecure.com/api/json/00000/cart/giftwrap/1
Request
HTTP Verb : PUT
URL : http://{WS_URL}/{returnType}/{domainCode}/cart/giftwrap/{line}
Parameters | Location | Type | Required | Default | Accepted |
|
---|---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
|
Content-Type | Header | String | v | application/x-www-form-urlencoded |
|
|
line | Path | Integer | v |
|
|
|
quantity | Form | Integer |
| 1 |
|
|
giftwrap | Form | Integer | v |
|
|
Setting a giftwrap to 0 remove the giftwrap from a line, merging it with another one if need be.
Giftwrap can't be set to eBooks, obviously.
Response
Success
{
"response": {
"success": true
"message": "cart retrieved"
"object": {
"cart": {
"customer": 2
"productsQuantity": 2
"price": 45
"totalPrice": 45
"creationDate": "2016-02-29 15:18:34"
"lines": {
"line": [2]
0: {
"id": 1
"ean": 9789462500877
"title": "Kip"
"author": "Marcus Bean & Ellen Hosmar"
"price": 22.5
"quantity": 1
"productForm": "BB"
}
1: {
"id": 6
"ean": 9789462500877
"title": "Kip"
"author": "Marcus Bean & Ellen Hosmar"
"price": 22.5
"quantity": 1
"productForm": "BB"
"giftwrap": 4
}
}
}
}
}
}
Error
{
"response": {
"success": false
"code": 11
"message": "cartline not exist"
}
}
Codelist
Code | Success | Message |
---|---|---|
0 | v | gift set and cart line updated |
1 |
| domaincode malformed |
2 |
| connexion error |
3 |
| token empty |
4 |
| no token with that key |
5 |
| invalid token |
9 |
| {param} not {type} {(or undefined)} |
10 |
| cart not exist |
11 |
| cartline not exist |
12 |
| giftwrap not exist |
13 |
| quantity too high |
14 |
| same giftwrap given |
15 |
| giftwrap not available for ebooks |
99 |
| uncatched exception |