WS Orders
While carts are temporary and unconfirmed, and may never end, orders are real and definitive attempts.
An order has a few status. Click here for the order status list.
- 1 Status update
- 2 Get orders list
- 3 Get order
- 4 Apply a voucher
- 4.1 Request
- 4.2 Voucher type: Ean
- 4.3 Response
- 4.4 Voucher type: Selection
- 4.5 Response
- 4.6 Voucher type: User
- 4.7 Response
- 4.8 Voucher type: Author
- 4.9 Response
- 4.10 Voucher type: ProductForm
- 4.11 Response
- 5 Order status
- 5.1 Veloyd mapping
- 5.2 eBooks mapping
Status update
This service update the order status, and lead it through the ordering process.
Unless you decide to manage the payment process by yourself (see cart confirmation), you should not use that feature.
In order to use this service, you'll need to use a system process.
That system process is nothing more than a regular webservice call, but using the system user you received while getting access to our services. This ensure the security because that token can then never be seen BUT that process.
Depending on the status it's updated to, some mails may be sent. That's the case for :
Confirmed. A confirmation/invoice mail is sent (see mail configuration).
Processing. Whenever a package of the order is sent, a notification mail is sent too. See the packages documentation for more information about that.
Example
https://wsmedia.tlsecure.com/api/json/00000/admin/order/1/status
Request
HTTP Verb : PUT
URL : http://{WS_URL}/api/{returnType}/{domainCode}/admin/order/{order}/status
Parameters | Location | Type | Required | Default | Accepted |
|
---|---|---|---|---|---|---|
token | Header | String(26) | v |
|
| Must be the SYSTEM user |
Content-Type | Header | String | v | application/x-www-form-urlencoded |
|
|
order | Path | Long | v |
|
|
|
status | Form | Int | v |
|
| |
message | Form | String |
|
|
| Some information to be logged (ex. payment confirmation by the provider) |
Response
Success
{
"response": {
"success": true
"code": 0
"message": "order has ben set to status confirmerd"
"object": {
"order": {
"id": 3
"customer": 2
"price": 22.5
"totalPrice": 22.5
"status": 2
"creationDate": "2016-02-29 15:43:21"
"deliveryType": 3
"paymentMethod": 1
"lines": {
"line": [1]
0: {
"id": 7
"ean": 9789462500877
"title": "Kip"
"author": "Marcus Bean & Ellen Hosmar"
"price": 22.5
"quantity": 1
"productForm": "BB"
}
}
"deliveryFirstName": "Thor"
"deliveryLastName": "-"
"deliveryAdressLine1": "-"
"deliveryPostcode": "-"
"deliveryCity": "Asgard"
"deliveryCountry": 1
"invoiceFirstName": "Thor"
"invoiceLastName": "-"
"invoiceAdressLine1": "-"
"invoicePostcode": "-"
"invoiceCity": "Asgard"
"invoiceCountry": 1
}
}
}
}
Error
{
"response": {
"success": false
"code": 12
"message": "status not exist"
}
}
Codelist
Code | Success | Message |
---|---|---|
0 | v | order has ben set to status X |
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 |
| order not exist |
11 |
| not an order but still a cart |
12 |
| status not exist |
13 |
| order already confirmed |
99 |
| uncatched exception |
Get orders list
Example
https://wsmedia.tlsecure.com/api/json/00000/customer/order
Request
HTTP Verb : GET
URL : https://{WS_URL}/{returnType}/{domainCode}/customer/order
Parameters | Location | Type | Required | Default | Accepted |
|
---|---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
|
Response
Success
{
"response": {
"success": true
"code": 0
"message": "get orders"
"object": {
"orders": {
"order": [1]
0: {
"id": 5
"customer": 10
"price": 51.44
"shipping": 0
"totalPrice": 51.44
"status": 1
"creationDate": "2016-03-10 13:45:20"
"deliveryType": 4
"paymentMethod": 2
"lines": {
"line": [3]
0: {
"id": 3
"ean": 9789025762186
"title": "Kaatje Kip"
"author": "Axel Scheffler & Bette Westera"
"price": 8.95
"quantity": 1
"productForm": "BB"
}
1: {
"id": 4
"ean": 9789021560571
"title": "Gouden Kip"
"author": "Diana Henry & Laura Edwards & Hilde Smeesters"
"price": 19.99
"quantity": 1
"productForm": "BB"
}
2: {
"id": 5
"ean": 9789462500877
"title": "Kip"
"author": "Marcus Bean & Ellen Hosmar"
"price": 22.5
"quantity": 1
"productForm": "BB"
}
}
"deliveryFirstName": "Uncle"
"deliveryLastName": "Ben"
"deliveryAddressLine1": "Ingram St."
"deliveryNumber": 20
"deliveryPostcode": "11375"
"deliveryCity": "NY (Queens)"
"deliveryCountry": 231
"invoiceFirstName": "Peter"
"invoiceLastName": "Parker"
"invoiceAddressLine1": "Ingram St."
"invoiceNumber": 20
"invoicePostcode": "11375"
"invoiceCity": "NY (Queens)"
"invoiceCountry": 231
}
}
}
}
}
Error
Codelist
Code | Success | Message |
---|---|---|
0 | v | get orders |
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 |
| no orders |
99 |
| uncatched exception |
Get order
Example
https://wsmedia.tlsecure.com/api/json/00000/customer/order/5
Request
HTTP Verb : GET
URL : https://{WS_URL}/{returnType}/{domainCode}/customer/order/{order}
Parameters | Location | Type | Required | Default | Accepted |
|
---|---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
|
order | Path | long | v |
|
|
|
Response
Success
Error
Codelist
Code | Success | Message |
---|---|---|
0 | v | get order |
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 |
| order not exist |
99 |
| uncatched exception |
Apply a voucher
Example
https://wsmedia.tlsecure.com/api/json/00000/cartVoucher
Request
HTTP Verb : PUT
URL : https://{WS_URL}/{returnType}/{domainCode}/cartVoucher
Parameters | Location | Type | Required | Default | Accepted |
|
---|---|---|---|---|---|---|
token | Header | String(26) | v |
|
|
|
voucherCode | Form param | String | v |
|
|
|
orderId | Form param | Int | v |
|
|
|
As soon as you use a voucher in your basket, you will notice new nodes:
priceFull (price without the “discount”)
voucherCode
voucher (voucher id)
discount
percentage (visible only if the voucher is a percentage reduction)
For voucher type of ean, selection, author and productType the new nodes will be visible on the orderline level as well.
Voucher type: Ean
Reduction on order line level. A voucher eligible for an ean.
Response
Success
Voucher type: Selection
Reduction on order line level. Eligible for each ean of a selection.
Response
Success
Voucher type: User
Reduction on the total order amount. It works with a connected user.
Response
Success
Voucher type: Author
Reduction on order line level. Eligible for each ean having the corresponding author.
Response
Success
Voucher type: ProductForm
Reduction on the total order amount.
Response
Success
Error
Codelist
Code | Success | Message |
---|---|---|
0 | v | voucher code is valid |
10 |
| voucher code is not valid |
11 |
| there is already a code used for this order |
12 |
| voucher code already used |
13 |
| error on update order |
14 |
| order does not exist |
15 |
| discount too big for the order |
Order status
Set Order.status (OS) | Package.status (PS) | orderline_to_package.status (OPS) |
5 Confirmed | 0 = Confirmed | 0 = Confirmed |
|
|
|
7 Processing (via BO) | 1 = Processing (via BO, CB FullFilment ONT) | 10 = Processing (via BO) |
|
| 14 = Supplier Order (via ML) |
|
| 16 = Partial recieved (via ML) |
|
| 18 = Not available (via ML) |
|
|
|
|
|
|
8 Processed (via BO) | 2 = Processed (via BO) | 20 = Ready to ship (via BO) |
8 Processed (via BO) | 2 = Processed (via BO) | 22 = Ready to collect (via BO) |
|
|
|
10 Done (via BO) -> 8 Processed ? | 3 = Sent to customer (Via BO, CB fulfilment UIT, Veloyd or SendCloud) | 30 = Shipped (CB fulfilment UIT) |
|
|
|
10 Done (via BO) | 4 = recieved by customer (Via BO, Veloyd or SendCloud) | 40 = Recieved by customer (via eBook link generation) |
|
|
|
| 5 = Unknown | 50 = Unknown |
|
|
|
99 Cancelled (via BO, ML) | 99 = Cancelled (via SendCloud, Veloyd, BO, ML) | 99 = Cancelled (via BO, ML) |
98 Error | no change | no change |
| 98 Error (via SendCloud, Veloyd, CB FullFilment ONT) |
|
|
| 98 Error (CB FullFilment NUIT) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Veloyd mapping
Package.type=homedelivery |
|
|
|
Veloyd Status | Package.Status |
1 REGISTERED | 2 processed |
2 CONFIRMED | 2 processed |
3 COLLECTED | 3 Sent to customer |
4 IN TRANSIT | 3 Sent to customer |
5 MANCO | 98 Error |
6 AT PICKUP POINT | 4 Recieved by customer |
7 DELIVERED | 4 Recieved by customer |
8 RETURNED TO SENDER | 5 Unknown |
9 CANCELLED | 99 Cancelled |
eBooks mapping
Package.type = Digital, eBooks Fulfilment |
|
|
|
| orderline_to_package |
preorder | OPS.Status = 1 Processing |
URL ok | OPS.Status = 40 Recieved by customer |
Error | OPS.status = 98 Error |