TB.One > Order Data and Order Processing > Order Processing via XML > Changing the Order Status after Retrieval via REST

Changing the Order Status after Retrieval via REST

The REST interface is accessed via an URI which includes identification and specifies the desired actions:

https://rest.core.tradebyte.com/ACCOUNTNR/TARGET/[TARGET_ID][/ACTION]?[CHANNEL=CHID]

 

WITHOUT CHECKING PENDING ORDERS

Method

POST

Sets

Target/Resource

orders

the order

TARGET_ID

ORDER_ID

with the specified order ID

Parameter

exported

to "exported"

Example

https://rest.core.tradebyte.com/ACCOUNTNR/orders/ORDER_ID/exported?

Response

200 OK

 

WITH CHECK OF PENDING ORDERS

TIP:
If you work with pending orders, it may happen that the status change signifying the successful export coincides with the channel's order confirmation. As a result, the status "exported" would be assigned to the confirmed order and not -  as intended - to the pending order. The confirmed order would not be forwarded to your system, since it already has the status "exported".

To avoid this scenario, you can add a parameter to the REST call that causes a status check. The expected order status will then be checked against the status in TB.One. The "exported" flag will only be set if both are identical.

 

Method

POST

Sets

Target/Resource

orders

the order

TARGET_ID

ORDER_ID

with the specified order ID

Parameter

exported

pending=0

pending=1

to "exported"

and "approved"

or "pending"

Example

https://rest.core.tradebyte.com/ACCOUNTNR/orders/ORDER_ID/exported?pending=0

Response

200 OK

In case deviations are detected, the following message will be displayed:
"412 Precondition Failed: Order does not have expected pending state."

This means that the information in your system is out of date. In this case, you should retrieve the order data again.


For further information, see also:

Order processing via REST - overview and status codes