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.
Modifier
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
Modifier
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) |
Modifier
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 |