---
search:
  tags:
    - Connector Ingest
    - POST
seo:
  description: >-
    Called by the store plugin (HMAC auth) after the merchant installs the…
    Reference for the POST /connectors/pairing/complete endpoint in the Sarvex
    V1 API.
sidebar:
  label: Complete pairing and provision store credentials
  badge: POST
title: Complete pairing and provision store credentials
type: openapi-operation
---
Called by the store plugin (HMAC auth) after the merchant installs the plugin and
the admin has triggered pairing from the console. The plugin supplies its one-time
pairing code plus platform-specific store API credentials scoped to Sarvex's needs.
Sarvex validates the credentials, provisions signing keys, encrypts and persists the
credentials server-side, and marks the connector healthy.

The `store_credentials` payload is platform-specific and optional in the wire
envelope (a deployment where credentials are provisioned out-of-band may omit it),
but live checkout and write-back require credentials to be present.

**Credential boundary:** `store_credentials` carries integration credentials
(REST API keys, webhook secrets) — not payment credentials. Payment credentials
are never handled here; see the payment-credential boundary invariant.

`POST /connectors/pairing/complete`

**Request body** (`application/json`, required)

- `connector_id` (string, required) — The connector ID returned by POST /connectors at begin-pairing.
- `pairing_code` (string, required) — One-time pairing code issued to the console operator.
- `store_credentials` (store_credentials_woocommerce | store_credentials_magento) — Platform-specific store API credentials. The shape is discriminated by the platform recorded on the connector. Required for live checkout and write-back; may be omitted for profile-only deployments.

Request body example:

```json
{
  "connector_id": "string",
  "pairing_code": "string",
  "store_credentials": {
    "store_base_url": "http://example.com",
    "consumer_key": "string",
    "consumer_secret": "string",
    "webhook_secret": "string",
    "store_currency": "string"
  }
}
```

**Responses**

- `200` — Pairing completed; connector is healthy.
- `400` — Request body failed validation.
- `401` — Missing or invalid credentials.
- `422` — Invalid or expired pairing code, or credential validation failed.

Response example, 200:

```json
{
  "connector_id": "string",
  "store_id": "string",
  "status": "healthy"
}
```

Response example, 400:

```json
{
  "error": {
    "code": "validation_error",
    "message": "One or more fields are invalid.",
    "details": {
      "fields": {
        "email": "must be a valid email address"
      }
    }
  }
}
```

Response example, 401:

```json
{
  "error": {
    "code": "unauthorized",
    "message": "Authentication required.",
    "details": null
  }
}
```
