Target - Work Order/Visit API Integration
Overview
Target has requested that BDS provide a data integration to supply visit information for continuity visits to their store locations.
Contacts
Target APIs
Target makes their API accessible from their Target Developer Portal at: https://developer.target.com/login
BDS has access to three Target APIs:
![mceclip0.png]()
-
rest_hook_subscriptions-v1 - API used to pull down Work Orders (WO) created by Target
-
visitors-v1 - API used to create visits and update visits related details like check in/out of stores
-
work_orders-v1 - API to update Work Orders after visits are completed
BDS Integration with Target
The BDS IT team created an integration between ic and the Target APIs to update their internal work order system (Maximo) with details about visits to all USA locations by the Target Continuity call form reps.
The diagram below shows the work process created to support Targets integration.
- Target creates work orders that flow into a Target Work Orders table using a Target Work Order API exposed by the Development team.
- A windows console app matches the work orders to any scheduled appointments on the Target Continuity call form and creates Target visits to match in the Target visits table and with a call to the Target Visitors API
- After a visit is synced and checked out the visit is updated using the Target Visitors API and the Work Order is completed using the Target Work Order API.
Workflow Diagram
![mceclip1.png]()
Target/BDS Workflow Timeline
This example is based on a typical Target Continuity program work week of Monday - Sunday, with the wave inactivated on the following Wednesday.
Monday
- The Target IT team setup an automated process to generate Maximo work orders for each Target store every Monday AM to make them available for the BDS weekly continuity visits.
- The work orders are sent to BDS using Targets Webhook API to the BDS - Target Work Order API on the bdssolutions Azure API.
Rest of the week
- Visit Creation:
- BDS uses the Target Visitors API to create a visit on Targets side that matches the Work Order with a BDS scheduled visit to the same store.
- Visit: EnRoute & Check In
- EnRoute and Check in is sent to the Target Visitors API at the same time after our field rep checks in on their mobile device (if live) or syncs (if offline)
- Visit: Check Out
- It is sent to the Visitors API at the same time after our field rep checks out on their mobile device (if live) or syncs (if offline)
- Work Order: VACCEPT, VINPRG, VREPAIR
- After the field rep checks out all three of the Work Order statuses are updated using the Target Work Orders API
- Visit: Cancel and Work Order: Decline
- Visit Cancel: A Target visit exists, but the BDS scheduled visit does not exist. This case could occur if a scheduled visit is adjusted and cannot be updated.
- Work Order Decline: Set work order to “declined” if 10 days have passed since create date and there is no match.
Process Running Schedule
-
Run Days: Monday to Sunday
-
Run Timing: Every 15 minutes on the quarter hour
Business Rules
- The matching process between the Target WO and IC appointments uses the following criteria for a match:
- Call Form 9577 - Target Break Fix Continuity
- Chain store number of IC appointment matches Target WO LocationID
- WO date is within the wave dates
Error Reporting
A PowerBI report - Target API Work Order and Visits is published on the BDS Dev Teams team site with data statistics regarding work order and visits.
Target Work Orders Tab
Work order information received from the Target Work order web hook
- Top - Total work order count
- Left - Detailed list of Work Orders
- Right - Count of work order status
![mceclip0.png]()
Target Visits Tab
Visits information stored in the database in ic:
- Top - Total target visits created matching Target work orders to ic Target continuity call form scheduled appointments.
- Left - Detailed list of Target visits created and their status
- Right - Count of Target visits by status
![mceclip1.png]()