> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://partner.docs.trychannel3.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://partner.docs.trychannel3.com/_mcp/server.

# Create connect session

POST https://partners.trychannel3.com/v0/partner/merchants/{customer_id}/connections/sessions
Content-Type: application/json

Create a short-lived, single-use hosted connect session.

Reference: https://partner.docs.trychannel3.com/api-overview/createpartnerconnectsessionroute

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Channel3 Partner Program API
  version: 1.0.0
paths:
  /v0/partner/merchants/{customer_id}/connections/sessions:
    post:
      operationId: createpartnerconnectsessionroute
      summary: Create connect session
      description: Create a short-lived, single-use hosted connect session.
      tags:
        - subpackage_connections
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectSessionResponse'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                platform:
                  oneOf:
                    - $ref: '#/components/schemas/PlatformSlug'
                    - type: 'null'
                  description: >-
                    Platform slug to deep-link to (validated against the
                    connectable catalog). Omit to show the picker.
                redirect_uri:
                  type: string
                  description: >-
                    Where the hosted flow redirects on completion. Must
                    prefix-match a URI on your registered allowlist.
              required:
                - redirect_uri
servers:
  - url: https://partners.trychannel3.com
    description: Production
components:
  schemas:
    PlatformSlug:
      type: string
      enum:
        - channel3
        - google
        - microsoft
        - openai
        - paypal
        - perplexity
        - stripe
        - ucp
        - shopify
        - woocommerce
        - bigcommerce
        - magento
        - salesforce_commerce
        - akeneo
        - web_crawl
      description: Platforms Channel3 can ingest from or distribute to.
      title: PlatformSlug
    ConnectSessionResponse:
      type: object
      properties:
        token:
          type: string
        url:
          type: string
        expires_at:
          type: string
      required:
        - token
        - url
        - expires_at
      title: ConnectSessionResponse
    ErrorResponseDetail:
      oneOf:
        - type: string
        - type: array
          items:
            type: object
            additionalProperties:
              description: Any type
      title: ErrorResponseDetail
    ErrorResponse:
      type: object
      properties:
        detail:
          $ref: '#/components/schemas/ErrorResponseDetail'
      required:
        - detail
      title: ErrorResponse
  securitySchemes:
    APIKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

```

## Examples



**Request**

```json
{
  "redirect_uri": "https://merchant.example.com/connect/callback"
}
```

**Response**

```json
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ik1lcmNoYW50IENvbm5lY3Rpb24iLCJpYXQiOjE2ODU0MjQwMDB9.s5X9vQ7X9vQ7X9vQ7X9vQ7X9vQ7X9vQ7X9vQ7X9vQ7X9vQ7X9vQ7X9vQ7X9vQ7X9vQ7",
  "url": "https://connect.trychannel3.com/session/abc123def456",
  "expires_at": "2024-07-01T15:00:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://partners.trychannel3.com/v0/partner/merchants/customer_id/connections/sessions"

payload = { "redirect_uri": "https://merchant.example.com/connect/callback" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://partners.trychannel3.com/v0/partner/merchants/customer_id/connections/sessions';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"redirect_uri":"https://merchant.example.com/connect/callback"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://partners.trychannel3.com/v0/partner/merchants/customer_id/connections/sessions"

	payload := strings.NewReader("{\n  \"redirect_uri\": \"https://merchant.example.com/connect/callback\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://partners.trychannel3.com/v0/partner/merchants/customer_id/connections/sessions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"redirect_uri\": \"https://merchant.example.com/connect/callback\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://partners.trychannel3.com/v0/partner/merchants/customer_id/connections/sessions")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"redirect_uri\": \"https://merchant.example.com/connect/callback\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://partners.trychannel3.com/v0/partner/merchants/customer_id/connections/sessions', [
  'body' => '{
  "redirect_uri": "https://merchant.example.com/connect/callback"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://partners.trychannel3.com/v0/partner/merchants/customer_id/connections/sessions");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"redirect_uri\": \"https://merchant.example.com/connect/callback\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["redirect_uri": "https://merchant.example.com/connect/callback"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://partners.trychannel3.com/v0/partner/merchants/customer_id/connections/sessions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```