---
title: "Swap a one-time code for the plugin's key"
method: POST
path: "/connect/exchange"
tags: ["Connection"]
---

# Swap a one-time code for the plugin's key

`POST /connect/exchange`

## Request

- Base URL: `https://sitesplaced.com/api/v1`
- URL: `https://sitesplaced.com/api/v1/connect/exchange`
- Auth: none required

No key: the plugin does not have one yet. The code works once, for 10 minutes, and only when the host of `site_url` matches the shop that was approved. Any failure gives 400.

## Request body

- ConnectExchangeRequest
  - `code` string, required
  - `site_url` string, uri, required

## Response `200`

The plugin's key and signing secret.

- ConnectExchangeResult
  - `api_key` string, required
  - `webhook_secret` string, required: Signs the updates pushed back to the shop.
  - `connection_id` string, uuid, required
  - `store` ConnectedStore, required
    - `id` string, uuid, required
    - `name` string, required
    - `slug` string, required
    - `tracking_url` string, uri, required
    - `dashboard_url` string, uri, required

## Other responses

- `400`: `invalid_request`. The request is malformed or a field has a bad value; `param` names the field.
- `429`: `rate_limited`. Wait for `Retry-After` seconds.

---

[API](https://skmtc.dev/sitesplaced/apis/sitesplaced-developer-api.md) · [All operations](https://skmtc.dev/sitesplaced/apis/sitesplaced-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sitesplaced/apis/sitesplaced-developer-api/revisions/66fbfbbaad1a?raw)
