Orders
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
{
"response": {
"success": false
"code": 10
"message": "no orders"
}
}
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
{
"response": {
"success": true
"code": 0
"message": "get order"
"object": {
"order": {
"id": 5
"customer": 10
"price": 104.87
"shipping": 0
"totalPrice": 113.82
"status": 3
"creationDate": "2016-03-10 13:45:20"
"deliveryType": 4
"paymentMethod": 2
"lines": {
"line": [3]
0: {
"id": 164
"ean": 9789462082977
"title": "Adolf Loos Architectuur En Al Het Andere "
"author": "Ineke Van Der Burg"
"price": 24.95
"quantity": 1
"productForm": "ED"
"giftwrap": 1
}
1: {
"id": 116
"ean": 9789021560571
"title": "Gouden Kip"
"author": "Diana Henry & Laura Edwards & Hilde Smeesters"
"price": 19.99
"quantity": 3
"productForm": "BB"
}
2: {
"id": 166
"ean": 9789044629354
"title": "Gij nu"
"author": "Griet Op de Beeck"
"price": 19.95
"quantity": 1
"productForm": "BB"
"giftwrap": 1
}
}
"packages": {
"package": [3]
0: {
"id":21
"processType": 1
"deliveryType": 2
"status": 4
"lines": [1]
0: {
"id": 164
"ean": 9789462082977
"title": "Adolf Loos Architectuur En Al Het Andere "
"author": "Ineke Van Der Burg"
"price": 24.95
"quantity": 1
"productForm": "ED"
"giftwrap": 1
}
}
1: {
"id":22
"processType": 2
"deliveryType": 4
"status": 4
"carrier": 1
"carrierPackageId": 648
"tracking": "321084351546850"
"trackingLink": "http://www.sendcloud.nl/tracking/321084351546850"
"lines": [2]
0: {
"id": 116
"ean": 9789021560571
"title": "Gouden Kip"
"author": "Diana Henry & Laura Edwards & Hilde Smeesters"
"price": 19.99
"quantity": 3
"productForm": "BB"
"cancels": {
"cancel": [1]
0: {
"quantity": 1
"date": "2016-03-11 11:38:44"
}
}
"returns": {
"return": [1]
0: {
"quantity": 1
"date": "2016-04-20 13:27:03"
}
}
"quantityThatMayBeReturned":1
}
1: {
"id": 167
"ean": 9789025762186
"title": "Kaatje Kip"
"author": "Axel Scheffler & Bette Westera"
"price": 8.95
"quantity": 1
"productForm": "BB"
"quantityThatMayBeReturned":1
}
}
2: {
"id":23
"processType": 3
"deliveryType": 4
"status": 0
"lines": [1]
0: {
"id": 166
"ean": 9789044629354
"title": "Gij nu"
"author": "Griet Op de Beeck"
"price": 19.95
"quantity": 1
"productForm": "BB"
"giftwrap": 1
"quantityThatMayBeCancelled":1
}
}
}
"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
{
"response": {
"success": false
"code": 10
"message": "order not exist"
}
}
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
{
"response": {
"success": true,
"code": 0,
"message": "voucher code is valid",
"object": {
"cart": {
"id": 58128,
"customer": 5393280,
"productsQuantity": 2,
"price": 35.99,
"priceFull": 40.99,
"voucherCode": "DAVE04",
"voucher": 199,
"totalPrice": 35.99,
"status": 0,
"creationDate": "2022-06-02 14:15:52",
"lines": {
"line": [
{
"id": 126889,
"ean": 9789400406865,
"title": "Troje",
"author": "Stephen Fry",
"price": 20.99,
"quantity": 1,
"productForm": "BC",
"voucher": 199,
"voucherCode": "DAVE04",
"priceFull": 25.99,
"discount": 5,
"dbs": 40,
"dbp": 40
},
{
"id": 126890,
"ean": 9789463821261,
"title": "Een winter vol verhalen",
"author": "Frits Abrahams & Robert Alberdingk Thijm & Maarten Asscher & Abdelkader Benali & Merijn de Boer & Jan Brokken & Peter Buwalda & Jeroen Brouwers & Thera Coppens & Adriaan van Dis & Jessica Durlacher & Maarten 't Hart & Wim Hazeu & Maria Heiden & Bas Heijne",
"price": 15,
"quantity": 1,
"productForm": "BB",
"dbs": 40,
"dbp": 40
}
]
},
"isSchoolBook": true
}
}
}
}
Voucher type: Selection
Reduction on order line level. Eligible for each ean of a selection.
Response
Success
{
"response": {
"success": true,
"code": 0,
"message": "voucher code is valid",
"object": {
"cart": {
"id": 58125,
"customer": 5393229,
"productsQuantity": 1,
"price": 11.99,
"priceFull": 16.99,
"voucherCode": "DAVE04",
"voucher": 199,
"totalPrice": 11.99,
"status": 0,
"creationDate": "2022-05-30 14:51:26",
"lines": {
"line": [
{
"id": 126855,
"ean": 9789000366095,
"title": "Er hangt een geheim in de lucht",
"author": "Anna Ruhe",
"price": 11.99,
"quantity": 1,
"productForm": "BB",
"voucher": 199,
"voucherCode": "DAVE04",
"priceFull": 16.99,
"discount": 5,
"dbs": 40,
"dbp": 40
}
]
}
}
}
}
}
Voucher type: User
Reduction on the total order amount. It works with a connected user.
Response
Success
{
"response": {
"success": true,
"code": 0,
"message": "voucher code is valid",
"object": {
"cart": {
"id": 58127,
"customer": 5389662,
"productsQuantity": 1,
"price": 11.99,
"priceFull": 16.99,
"reduction": 5,
"voucherCode": "DAVE04",
"voucher": 199,
"shipping": 0,
"totalPrice": 11.99,
"status": 0,
"creationDate": "2022-06-01 17:08:30",
"lines": {
"line": [
{
"id": 126858,
"ean": 9789000366095,
"title": "Er hangt een geheim in de lucht",
"author": "Anna Ruhe",
"price": 16.99,
"quantity": 1,
"productForm": "BB",
"dbs": 40,
"dbp": 40
}
]
}
}
}
}
}
Voucher type: Author
Reduction on order line level. Eligible for each ean having the corresponding author.
Response
Success
{
"response": {
"success": true,
"code": 0,
"message": "voucher code is valid",
"object": {
"cart": {
"id": 58125,
"customer": 5393229,
"productsQuantity": 1,
"price": 11.99,
"priceFull": 16.99,
"voucherCode": "DAVE04",
"voucher": 199,
"shipping": 0,
"totalPrice": 11.99,
"status": 0,
"creationDate": "2022-05-30 14:51:26",
"lines": {
"line": [
{
"id": 126855,
"ean": 9789000366095,
"title": "Er hangt een geheim in de lucht",
"author": "Anna Ruhe",
"price": 11.99,
"quantity": 1,
"productForm": "BB",
"voucher": 199,
"voucherCode": "DAVE04",
"priceFull": 16.99,
"discount": 5,
"dbs": 40,
"dbp": 40
}
]
}
}
}
}
}
Voucher type: ProductForm
Reduction on the total order amount.
Response
Success
{
"response": {
"success": true,
"code": 0,
"message": "voucher code is valid",
"object": {
"cart": {
"id": 58127,
"customer": 5389662,
"productsQuantity": 1,
"price": 11.99,
"priceFull": 16.99,
"reduction": 5,
"voucherCode": "DAVE04",
"voucher": 199,
"totalPrice": 11.99,
"status": 0,
"creationDate": "2022-06-01 17:08:30",
"lines": {
"line": [
{
"id": 126858,
"ean": 9789000366095,
"title": "Er hangt een geheim in de lucht",
"author": "Anna Ruhe",
"price": 16.99,
"quantity": 1,
"productForm": "BB",
"dbs": 40,
"dbp": 40
}
]
}
}
}
}
}
Error
{
"response": {
"success": false
"code": 10
"message": "voucher code is not valid"
}
}
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 |