Approve or deny a pending provider swap request on a work order.
Approve or deny a pending provider swap request on a work order. A service company that has been assigned a work order raises a swap request to put one of its own technicians on the job; the buyer decides the outcome.
Call this after finding a swap in pending status in the swaps collection on the work order (GET /workorders/{work_order_id}).
Setting status to accepted reassigns the work order to the proposed provider. Setting it to denied leaves the original provider assigned. Either way the swap leaves pending and can no longer be acted on. The full updated work order is returned; read its swaps collection to confirm the new status and, on approval, its assignee.user to confirm the reassignment.
access_token OAuth 2.0 Access Token
In: query
Work Order ID
The swap request's unique ID. Obtain it from swaps.results[].id on the work order (GET /workorders/{work_order_id}).
application/json
Buyer decision on the pending swap request
TypeScript Definitions
Use the request body type in TypeScript.
curl -X PUT "https://api-sandbox.fndev.net/api/rest/v2/workorders/0/swaps/456" \ -H "Content-Type: application/json" \ -d '{ "status": "accepted" }'{
"id": 20546,
"work_order_id": 20546,
"title": "Install Point of Sale Terminal",
"status": {
"id": 3,
"name": "Assigned",
"display": "Checked out",
"code": "checked_out",
"is_routed": false,
"delay": 0,
"ncns": true,
"sub_status": "",
"confirmed": true,
"correlation_id": "139afced528488f08884c5e0d75e23b8cca1f729"
},
"type_of_work": {
"id": 62,
"name": "Point of Sale (POS)"
},
"location": {
"coordinates": {
"latitude": 44.8963,
"longitude": -93.2682,
"exact": true
},
"work_order_id": 20546,
"mode": "custom",
"address1": "1254 Commerce Lane",
"address2": "",
"city": "Minneapolis",
"state": "MN",
"zip": "55402",
"country": "US",
"notes": [],
"type": {
"id": 1,
"name": "Commercial"
},
"saved_location": {
"id": 0,
"name": "",
"display_name": "",
"contact": {
"name": "",
"phone": ""
},
"group": {
"id": 0,
"name": ""
}
},
"display_name": "1254 Commerce Lane, Minneapolis, MN 55402",
"status_id": 3,
"correlation_id": "d3f8591566b5bf59a06279cedc02501bc16bbb6e",
"zoom": "13z",
"map": {
"url": "https://maps.fieldnation.com/static/-93.2682,44.8963,13",
"href": "https://www.google.com/maps/search/1254+Commerce+Lane+Minneapolis+MN+55402/@44.8963,-93.2682,13z"
},
"actions": []
}
}{
"status": 400,
"message": "Validation failed: field 'title' is required"
}{
"status": 500,
"message": "Operation successful."
}{
"status": 403,
"message": "You do not have permission to access this work order"
}{
"status_code": 404,
"message": "Work order not found"
}{
"status": 500,
"message": "An unexpected error occurred. Please try again later or contact support."
}application/json
application/json
application/json
application/json
application/json
application/json
The decision to apply to the swap request. accepted reassigns the work order to the proposed provider; denied leaves the original provider assigned.
"accepted" | "denied"Approve the swap even when the proposed provider is missing one or more qualifications required by the work order.