Create Exchange

Create an exchange with a POST request to the endpoint.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
🚧

The Exchange API is a realtime authentication method that requires the cloud and connectivity to be fully intact during the key exchange. This module predates and by its nature cannot support our offline key exchange capability. With Offline Mode, the MS5 and MS4 SmartBoxes can continue operating even when connectivity is lost or the cloud is disrupted by reverting to their last synced state, enhancing reliability and ensuring a seamless key exchange experience. Thus, we strongly encourage using Accesses and Permissions for development which sync with the SmartBox in advance of the key exchange. A seamless user experience can be implemented by presenting a QR code for the user to present at the SmartBox.

For more details on Offline Mode, visit our help center.

Creating an Exchange

To create an Exchange, submit a POST request containing the necessary data formatted as a JSON object. You can specify the user by ID, email address, or mobile number.

Example JSON Payloads

Create Exchange by User ID

{
  "type": "DROPOFF",
  "user": { "id": 123456 },
  "key": { "id": 123456 },
  "location": { "id": 123456 }
}

Create Exchange by User Email

{
  "type": "DROPOFF",
  "user": { "email": "[email protected]" },
  "key": { "id": 123456 },
  "location": { "id": 123456 }
}

Create Exchange by User Mobile Number

{
  "type": "DROPOFF",
  "user": { "mobile": "16042656073" },
  "key": { "id": 123456 },
  "location": { "id": 123456 }
}

Example Workflows

Pickup Workflow

  1. Prompt the user to select a key.
  2. Create an Exchange by sending a POST request, specifying:
    • type: PICKUP
    • key
    • user
  3. Save the Exchange ID returned in the response.
  4. Instruct the user to press the flashing button on the SmartBox to open their key bin.
  5. Poll the Exchange (GET request) using the Exchange ID to monitor its status:
    • If completed becomes true, prompt the user to retrieve their key and close the door.
    • Ifcancelled becomes true, display an error message and prompt the user to try again.

Drop-Off Workflow

  1. Prompt the user to select a key and location.
  2. Create an Exchange by sending a POST request, specifying:
    • type: DROPOFF
    • key
    • location
    • user
  3. Save the Exchange ID returned in the response.
  4. Instruct the user to scan their key fob at the SmartBox.
  5. Poll the Exchange (GET request) using the Exchange ID to monitor its status:
    • If completed becomes true, prompt the user to place the key in the bin and close the door.
    • If cancelled becomes true, display an error message and prompt the user to try again.

Activation Workflow

  1. Prompt the user to select a key and location.
  2. Create an Exchange by sending a POST request, specifying:
    • type: ACTIVATION
    • key
    • location
    • user
  3. Save the Exchange ID returned in the response.
  4. Instruct the user to press the flashing button on the SmartBox to open the fob bin.
  5. Poll the Exchange (GET request) using the Exchange ID to monitor the released and cancelled properties:
    • If released becomes true, instruct the user to retrieve a fob from the bin, close the door, and scan their new fob.
    • If cancelled becomes true, display an error message and prompt the user to try again.
  6. Continue polling the Exchange to monitor the completed and cancelled properties:
    • If completed becomes true, instruct the user to attach the fob to their keys.
    • If cancelled becomes true, display an error message and prompt the user to retry the process.
Body Params
string
required

The exchange type (PICKUP/DROPOFF/ACTIVATION).

key
object
required

The key for which the exchange is being performed.

user
object

The user who is performing the exchange. If omitted, the authenticated user is used. If another user is specified for a drop off, a location must also be specified. If another user is specified, the authenticated user must be the owner of both the key and the location network. Can be specified by user ID, email or mobile.

location
object

The location at which the exchange is being performed. Required for activations. Optional for dropping off. If omitted for a drop off, the key's home location will be used to determine if API exchanges are available. For pickups, the location property is ignored and the key's current location is used.

Response

Language
Credentials
Basic
base64
:
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json