---
updatedAt: 2025-08-11T18:18:17.000Z
agentTools:
  projectIndex: https://docs.keycafe.com/llms.txt
---

# Link SmartBox

Link a SmartBox to a location with a PUT request to the endpoint with the location ID.

The body should contain the serial number of the SmartBox as a JSON object:

```json json
{
  
    "box": {
        "serialNumber": "XXXXXX"
    }    
}
```

Returns a location object if the call succeeded.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Keycafe API",
    "version": "0"
  },
  "x-explorer-enabled": true,
  "x-proxy-enabled": true,
  "x-samples-languages": [
    "shell",
    "python",
    "go"
  ],
  "servers": [
    {
      "url": "https://www.keycafe.com/"
    }
  ],
  "components": {
    "securitySchemes": {
      "BasicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "BasicAuth": []
    }
  ],
  "paths": {
    "/v0/location/{location_id}": {
      "put": {
        "tags": [
          "Location"
        ],
        "summary": "Link SmartBox",
        "description": "Link a SmartBox to a location with a PUT request to the endpoint with the location ID.",
        "operationId": "link-smartbox",
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of location. </br> Example: 123456",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": ""
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "box": {
                    "properties": {
                      "serialNumber": {
                        "type": "string",
                        "description": "The serial number of the SmartBox."
                      }
                    },
                    "required": [
                      "serialNumber"
                    ],
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SmartBox successfully linked to the location.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "Unique identifier for the linked SmartBox location.",
                      "example": 123456
                    },
                    "name": {
                      "type": "string",
                      "description": "Display name of the SmartBox location.",
                      "example": "Corner Cafe"
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Timezone where the SmartBox is located.",
                      "example": "America/Vancouver"
                    },
                    "address": {
                      "type": "object",
                      "description": "Physical address of the SmartBox location.",
                      "properties": {
                        "street": {
                          "type": "string",
                          "description": "Street address of the SmartBox.",
                          "example": "123 Main St."
                        },
                        "unit": {
                          "type": "string",
                          "description": "Unit or suite number.",
                          "example": "1A"
                        },
                        "city": {
                          "type": "string",
                          "description": "City where the SmartBox is located.",
                          "example": "Vancouver"
                        },
                        "stateProv": {
                          "type": "string",
                          "description": "State or province.",
                          "example": "BC"
                        },
                        "country": {
                          "type": "string",
                          "description": "Country name.",
                          "example": "Canada"
                        },
                        "postalCode": {
                          "type": "string",
                          "description": "Postal or ZIP code.",
                          "example": "A1A1A1"
                        },
                        "latitude": {
                          "type": "number",
                          "description": "Latitude coordinate of the SmartBox.",
                          "example": 9.2839043
                        },
                        "longitude": {
                          "type": "number",
                          "description": "Longitude coordinate of the SmartBox.",
                          "example": -123.1053527
                        }
                      }
                    },
                    "hours": {
                      "type": "array",
                      "description": "Opening hours of the SmartBox location.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "dayOfWeek": {
                            "type": "integer",
                            "description": "Day of the week (0 = Sunday, 6 = Saturday).",
                            "example": 0
                          },
                          "startMinuteOfDay": {
                            "type": "integer",
                            "description": "Opening time in minutes after midnight.",
                            "example": 360
                          },
                          "endMinuteOfDay": {
                            "type": "integer",
                            "description": "Closing time in minutes after midnight.",
                            "example": 1320
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": 123456,\n    \"name\": \"Corner Cafe\",\n    \"timezone\": \"America/Vancouver\",\n    \"address\": {\n        \"street\": \"123 Main St.\",\n        \"unit\": \"1A\",\n        \"city\": \"Vancouver\",\n        \"stateProv\": \"BC\",\n        \"country\": \"Canada\",\n        \"postalCode\": \"A1A1A1\",\n        \"latitude\": 9.2839043,\n        \"longitude\": -123.1053527\n    },\n    \"hours\": [\n        { \"dayOfWeek\": 0, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n        { \"dayOfWeek\": 1, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n        { \"dayOfWeek\": 2, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n        { \"dayOfWeek\": 3, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n        { \"dayOfWeek\": 4, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n        { \"dayOfWeek\": 5, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 },\n        { \"dayOfWeek\": 6, \"startMinuteOfDay\": 360, \"endMinuteOfDay\": 1320 }\n    ]\n}"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```