Cart informations
These are what define for a cart :
payment method,
delivery type,
the delivery and invoice addresses,
email address,
shop - For delivery at shop you need to specify the shop id otherwise the default shop will be filled in by default
company in case of B2B customer,
message, which is a free field.
About addresses
A given invoice address can also be set as delivery address (that's the purpose of the deliverySameAsInvoice parameter),
Delivery address is not needed in case of orders with only eBooks,
Delivery address is not needed in case of delivery in shop (but in this case, a link to the delivery shop is needed).
In case of a collection point, disable deliverySameAsInvoice and do not put a delivery address
The deliverySameAsInvoice parameter has to be used in combination of a invoice address. He won't have any use alone, and a delivery address would overwrite the information it puts.
Set informations
Attach informations to the cart.
Addresses can be attached that way too, see above.
Example
https://wsmedia.tlsecure.com/api/json/00000/cart/information
Request
HTTP Verb : PUT
URL : http://{WS_URL}/{returnType}/{domainCode}/cart/information
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
Content-Type | Header | String | v | application/x-www-form-urlencoded |
|
Form | String |
|
|
| |
deliveryType | Form | Integer |
|
| |
paymentMethod | Form | Integer |
|
| |
shop | Form | Integer |
|
|
|
deliveryAddress | Form | Long |
|
|
|
invoiceAddress | Form | Long |
|
|
|
collectionPoint | Form | Long |
|
|
|
deliverySameAsInvoice | Form | Boolean |
|
|
|
company | Form | Integer |
|
|
|
message | Form | String |
|
|
|
Email is not needed for a cart. However, if you intent to allow unregistred users to make orders, that field is quite usefull, as it would allow to recover those orders in case of a further account creation.
Response
Success
{
"response": {
"success": true
"code": 0
"message": "cart info updated"
"object": {
"cart": {
"customer": 62
"email": "thor@avengers.com"
"message": "call for Heimdall"
"creationDate": "2016-02-29 15:43:21"
"deliveryType": 3
"paymentMethod": 1
}
}
}
}
Error
{
"Response": {
"Success": false
"Code": 10
"Message": "nothing to be updated"
}
}
Codelist
Code | Success | Message |
---|---|---|
0 | v | cart info 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 |
| nothing to be updated |
11 |
| delivery address not exist |
12 |
| facturation address not exist |
13 |
| delivery type not exist/defined |
14 |
| delivery type not available - cart with not only ebooks |
15 |
| delivery type not available - cart with only ebooks |
16 |
| payment method not exist/defined |
17 |
| no postal charges available |
18 |
| shop not exist |
19 |
| company not exist |
99 |
| uncatched exception |
Delivery types available
Click here for more information.
Payment methods available
Click here for more information.
Shipping costs simulation
Click here for more information.