get_all_orders
– Sending New Orders
The get_all_orders event is meant to send all open orders assigned to the account. The optional timestamp
field in the event_data
is used to only send new or modified orders after the timestamp sent. The timestamp is UTC time. If the integrator’s system can support it, this can reduce the amount of data being accessed and sent.
Field | Type | Description |
---|---|---|
timestamp | string | Unix timestamp |
Request payload JSON - get_all_orders
{
"username": "demo",
"password": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
"site_id": "dcc363d0-8ed1-48a2ba2e-f638275db4f",
"event_name": "get_all_orders",
"event_data": "{\"timestamp\":\"1491699142\"}"
}
curl -X POST \
--data 'payload={
"username": "demo",
"password": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
"site_id": "dcc363d0-8ed1-48a2ba2e-f638275db4f",
"event_name": "get_all_orders",
"event_data": "{\"timestamp\":\"1491699142\"}"
}' \
https://www.propertypreswizard.com/api/link/receiver.php
The response will contain an array of objects for each work order. The result data will have the report_id
, wo_number
, org_wo_num
, wo_status
, and transaction_id
. PPW uses the report_id
to track the order and return the results back to the correct order. The report_id
should be a unique ID from the integrator’s system. The report_id
needs to be an unsigned integer. The wo_number
needs to be a unique value for the client company the import is assigned to in PPW. Because multiple client companies could have the same wo_number
, this field is not verified to be unique across the users PPW account, just to the client company assigned to the PPWL import.
Field descriptions.
Field Name | Type/Length | Description |
---|---|---|
report_id | number | The unique id of the work order. |
wo_number | string | The order number displayed to the user. |
org_wo_num | number | For PPW to PPW, not used for 3rd party integrator. |
wo_status | string | New orders set to Unread. Can also be Update, RTV, Complete, or Cancel. |
transaction_id | string | Unique ID. |
Response JSON
{
"remote_site_id": "1fc25d06-72bd-42f8-ad34-ecbdc5f1a4a4",
"error": false,
"success": true,
"return_error_msg": null,
"result_data": [{
"report_id": "12249320",
"wo_number": "import test 3-1",
"org_wo_num": "2272",
"wo_status": "Unread",
"transaction_id": "6e0fc218-d7c1-480d-82e5-0630d134a483"
},
{
"report_id": "12249453",
"wo_number": "import test 3-5",
"org_wo_num": "2298",
"wo_status": "Unread",
"transaction_id": "ba1d10ab-fe52-4022-9a7a-f92643f774bb"
},
{
"report_id": "12249455",
"wo_number": "import test 3-6",
"org_wo_num": "2299",
"wo_status": "Unread",
"transaction_id": "0b85961d-2295-42da-b0c7-36837c4f51e3"
},
{
"report_id": "12249459",
"wo_number": "import test 3-7",
"org_wo_num": "2300",
"wo_status": "Unread",
"transaction_id": "e69dc54b-c624-4943-bc9d-6bb5fec0ffd2"
},
{
"report_id": "12249473",
"wo_number": "import test 3-7",
"org_wo_num": "2301",
"wo_status": "Unread",
"transaction_id": "8cefa2e6-2f62-4715-a5df-0a6c8699fb8e"
},
{
"get_all_updates": "1"
},
{
"get_all_notes": "1"
}
]
}
Based on the result of the get_all_orders
event, any new orders will be requested using the get_order
event.
If a transaction_id is passed PPW will respond with a ack_transaction event after the event has been processed. If a new work order is being sent, the acknowledgement will not come until after the get_order
event has been called. The same transaction_id should be passed in the get_order event as was passed in the get_all_orders event.
If a duplicate order is detected in the get_all_orders
event and a transaction_id is passed, PPW will respond with an ack_transaction
event indicating the transaction_id and the reason why the order could not be imported.
If an object is sent with the value get_all_updates set to 1, then PPW will queue an event called get_all_updates
. This event is described below in the Update Existing Orders section. Order updates can be sent with either the get_all_orders
or get_all_updates
event. This functionality allows the integrator to decide how the process is handled and logically separate them.
If an object is sent with the value get_all_notes set to 1, then PPW will queue an event called get_all_notes
. Check