> ## Documentation Index
> Fetch the complete documentation index at: https://docs.y.uno/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Create a Connection

> Creates a connection in ACTIVE status from credentials and configuration you fill in based on the provider's catalog.

Creates a connection in `ACTIVE` status from credentials and configuration you fill in based on the provider's catalog. The response includes the `connection_id` you'll use to reference this connection from routing rules.

### Headers

**X-account-code** `string` *required*

Code of the account under which the connection is created. The account comes from this header, not from the request body.

**X-Idempotency-Key** `string` *required*

UUID, 24-hour scope. Re-sending the same key + body returns the cached response; same key with a different body returns a `409`.

### Body

**merchant\_connection\_id** `string` *required*

Your label for this connection. Must be unique within the account. Free-form (e.g., `"adyen-us-prod-001"`, `"stripe-eu-test"`).

**provider\_id** `string` *required*

Yuno provider identifier (e.g., `"STRIPE"`, `"ADYEN"`). Must exist in the catalog.

**flow\_type** `enum`

Optional. Defaults to `"PAYIN"`, the only supported value.

**payment\_methods** `string[]`

Optional. Subset of the provider's `payment_method_type[]` (from the catalog).

Omit this field to enable every payment method the provider supports. Payment methods the provider adds later are added to the connection too.

If you send it, include at least one payment method. An empty array (`[]`) is rejected with `400 VALIDATION_ERROR`: either omit the field or send it with values.

**params** `object[]` *required*

One `{param_id, value}` pair per parameter you're supplying. **Flat array** — even nested catalog params are submitted at the top level; Yuno resolves the hierarchy from the catalog tree.

Required params (where the catalog has `optional: false`) must be present and non-empty. Activating a `boolean` parent (`"value": true`) makes its `optional: false` children required.

**item**

**param\_id** `string` *required*

The exact `param_id` from the catalog. Casing matters.

**value** `string | boolean | number | array` *required*

Match the `field_type` from the catalog. Numerics are submitted as JSON numbers (or strings if the catalog says `field_type: "string"`). For `field_type: "array"`, submit a JSON array.

**costs** `object[]`

Optional. Per-connection cost configuration. Omit it for a connection without costs. `currency` must be one supported by the provider.

**item**

**sort\_number** `integer`

Order of priority for the cost entry.

**cost\_name** `string`

Label for the cost entry.

**currency** `string`

ISO 4217 currency code.

**cost\_values** `object`

**successful | unsuccessful**

**fixed\_fee** `number`

Fixed fee amount.

**percentage** `number`

Percentage fee.

### Response

**connection\_id** `string`

Unique identifier for the connection. **Save this value** to reference it from routing rules.

**merchant\_connection\_id** `string`

Your internal label for this connection.

**provider\_id** `string`

The provider this connection belongs to (e.g., `ADYEN`).

**status** `string`

Current status (always `ACTIVE` on create).

**flow\_type** `string`

Always `PAYIN`.

**payment\_methods** `string[]`

List of supported payment methods.

**params** `object[]`

Echoed parameters. Sensitive values are masked as `***`.

**costs** `object[]`

Cost configuration for the connection.

**created\_at** `string`

ISO 8601 timestamp.

**updated\_at** `string`

ISO 8601 timestamp.

```bash cURL theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
curl -X POST 'https://api.y.uno/v1/connections' \
  -H 'public-api-key: <YOUR_PUBLIC_KEY>' \
  -H 'private-secret-key: <YOUR_SECRET_KEY>' \
  -H 'X-account-code: <ACCOUNT_CODE>' \
  -H 'Content-Type: application/json' \
  -H 'X-Idempotency-Key: <UUID>' \
  -d '{
    "merchant_connection_id": "stripe-us-prod-001",
    "provider_id": "STRIPE",
    "flow_type": "PAYIN",
    "payment_methods": ["CARD"],
    "params": [
      { "param_id": "INTEGRATION_TYPE",             "value": "STRIPE_CHARGES" },
      { "param_id": "SECRET_KEY",                   "value": "sk_live_..." },
      { "param_id": "RADAR_FRAUD_ANALYSIS",         "value": false },
      { "param_id": "SEND_RECEIPT_EMAIL_PARAMETER", "value": false },
      { "param_id": "SETUP_FUTURE_USAGE",           "value": false },
      { "param_id": "ORDER_ID",                     "value": "DEFAULT" }
    ],
    "costs": [
      {
        "sort_number": 1,
        "cost_name": "Transaction Fee",
        "currency": "USD",
        "cost_values": {
          "successful":   { "fixed_fee": 0.30, "percentage": 2.9 },
          "unsuccessful": { "fixed_fee": 0.0,  "percentage": 0.0 }
        }
      }
    ]
  }'
```

```json 201 Created — Stripe theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "connection_id": "f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e",
  "merchant_connection_id": "stripe-us-prod-001",
  "provider_id": "STRIPE",
  "status": "ACTIVE",
  "flow_type": "PAYIN",
  "payment_methods": ["CARD"],
  "params": [
    { "param_id": "INTEGRATION_TYPE",             "value": "STRIPE_CHARGES" },
    { "param_id": "SECRET_KEY",                   "value": "***" },
    { "param_id": "RADAR_FRAUD_ANALYSIS",         "value": false },
    { "param_id": "SEND_RECEIPT_EMAIL_PARAMETER", "value": false },
    { "param_id": "SETUP_FUTURE_USAGE",           "value": false },
    { "param_id": "ORDER_ID",                     "value": "DEFAULT" }
  ],
  "costs": [
    {
      "sort_number": 1,
      "cost_name": "Transaction Fee",
      "currency": "USD",
      "cost_values": {
        "successful":   { "fixed_fee": 0.30, "percentage": 2.9 },
        "unsuccessful": { "fixed_fee": 0.0,  "percentage": 0.0 }
      }
    }
  ],
  "created_at": "2026-05-12T10:24:00Z",
  "updated_at": "2026-05-12T10:24:00Z"
}
```

```json 201 Created — Adyen theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "connection_id": "b2c4d5e6-1a2b-3c4d-5e6f-7a8b9c0d1e2f",
  "merchant_connection_id": "adyen-eu-prod-001",
  "provider_id": "ADYEN",
  "status": "ACTIVE",
  "flow_type": "PAYIN",
  "payment_methods": ["CARD", "GOOGLE_PAY"],
  "params": [
    { "param_id": "merchantAccount",        "value": "ACME_LIVE" },
    { "param_id": "x-api-key",              "value": "***" },
    { "param_id": "transaction-identifier", "value": "MERCHANT_REFERENCE" }
  ],
  "created_at": "2026-05-12T10:31:42Z",
  "updated_at": "2026-05-12T10:31:42Z"
}
```

```json 400 — Missing Param theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "type": "validation_error",
  "code": "MISSING_REQUIRED_PARAM",
  "message": "Required param 'SECRET_KEY' is missing for provider 'STRIPE'",
  "details": { "provider_id": "STRIPE", "param_id": "SECRET_KEY" }
}
```

```json 409 — Conflict theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "type": "conflict",
  "code": "CONNECTION_MERCHANT_ID_CONFLICT",
  "message": "A connection with merchant_connection_id 'stripe-us-prod-001' already exists in this account",
  "details": { "merchant_connection_id": "stripe-us-prod-001" }
}
```

> [!NOTE]
>
> Yuno validates `param_id` values, required params and `costs[].currency` against the provider's catalog. It does not call the provider to check the credentials, so a wrong key is accepted with `201`.

> [!NOTE]
>
> **Secret handling:** any param marked `secret: true` in the catalog is returned as `"value": "***"`. Your submitted secret is stored encrypted and never echoed back.

### Errors

| HTTP | `code` |
| - | - |
| `400` | `PROVIDER_NOT_FOUND` Unknown `provider_id`. |
| `400` | `MISSING_REQUIRED_PARAM` A required param is missing. `details.param_id` names which one. |
| `400` | `UNSUPPORTED_PAYMENT_METHOD` `payment_methods` contains a method the provider doesn't support. |
| `400` | `NO_SUPPORTED_PAYMENT_METHODS` `payment_methods` was omitted and the provider has no payment method available for the connection's integration type. |
| `400` | `VALIDATION_ERROR` The body failed validation, for example `payment_methods` sent as an empty array. `details` names the field. |
| `400` | `UNSUPPORTED_CURRENCY` A `costs[].currency` isn't in the provider's supported list. |
| `401` | `NOT_AUTHENTICATED` Missing or invalid API key. |
| `409` | `CONNECTION_MERCHANT_ID_CONFLICT` `merchant_connection_id` already exists in this account. |


## OpenAPI

````yaml openapi/organizations/connections/create-connection.json POST /connections
openapi: 3.1.0
info:
  title: Connections API - Create
  version: 1.0.0
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /connections:
    post:
      summary: Create a Connection
      description: Creates a connection in ACTIVE status.
      operationId: create-connection
      parameters:
        - name: X-account-code
          in: header
          required: true
          description: The account that owns the connection.
          schema:
            type: string
        - name: X-Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - merchant_connection_id
                - provider_id
                - params
              properties:
                merchant_connection_id:
                  type: string
                  example: stripe-us-prod-001
                provider_id:
                  type: string
                  example: STRIPE
                flow_type:
                  type: string
                  description: Optional. Defaults to PAYIN.
                  example: PAYIN
                payment_methods:
                  type: array
                  items:
                    type: string
                  minItems: 1
                  description: >-
                    Optional. Subset of the provider's payment_method_type[].
                    Omit it to enable every payment method the provider
                    supports, including ones added later. If sent, it must
                    contain at least one value: an empty array is rejected with
                    400 VALIDATION_ERROR.
                  example:
                    - CARD
                params:
                  type: array
                  items:
                    type: object
                    properties:
                      param_id:
                        type: string
                      value:
                        type:
                          - string
                          - boolean
                          - number
                          - array
                costs:
                  type: array
                  description: Optional. Per-connection cost configuration.
                  items:
                    type: object
                    properties:
                      sort_number:
                        type: integer
                      cost_name:
                        type: string
                      currency:
                        type: string
                      cost_values:
                        type: object
            example:
              merchant_connection_id: stripe-us-prod-001
              provider_id: STRIPE
              flow_type: PAYIN
              payment_methods:
                - CARD
              params:
                - param_id: INTEGRATION_TYPE
                  value: STRIPE_CHARGES
                - param_id: SECRET_KEY
                  value: sk_live_...
                - param_id: RADAR_FRAUD_ANALYSIS
                  value: false
                - param_id: SEND_RECEIPT_EMAIL_PARAMETER
                  value: false
                - param_id: SETUP_FUTURE_USAGE
                  value: false
                - param_id: ORDER_ID
                  value: DEFAULT
              costs:
                - sort_number: 1
                  cost_name: Transaction Fee
                  currency: USD
                  cost_values:
                    successful:
                      fixed_fee: 0.3
                      percentage: 2.9
                    unsuccessful:
                      fixed_fee: 0
                      percentage: 0
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  connection_id:
                    type: string
                    example: f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e
                  merchant_connection_id:
                    type: string
                    example: stripe-us-prod-001
                  provider_id:
                    type: string
                    example: STRIPE
                  status:
                    type: string
                    example: ACTIVE
                  flow_type:
                    type: string
                    example: PAYIN
                  payment_methods:
                    type: array
                    items:
                      type: string
                    example:
                      - CARD
                  params:
                    type: array
                    items:
                      type: object
                  costs:
                    type: array
                    items:
                      type: object
                  created_at:
                    type: string
                    format: date-time
                    example: '2026-05-12T10:24:00Z'
                  updated_at:
                    type: string
                    format: date-time
                    example: '2026-05-12T10:24:00Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: validation_error
                  code:
                    type: string
                    example: MISSING_REQUIRED_PARAM
                  message:
                    type: string
                    example: Required param 'SECRET_KEY' is missing
                  details:
                    type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: auth_error
                  code:
                    type: string
                    example: NOT_AUTHENTICATED
                  message:
                    type: string
                    example: Not authenticated
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: conflict
                  code:
                    type: string
                    example: CONNECTION_MERCHANT_ID_CONFLICT
                  message:
                    type: string
                    example: >-
                      A connection with this merchant_connection_id already
                      exists
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: PUBLIC-API-KEY
      x-default: <Your PUBLIC-API-KEY>
    sec1:
      type: apiKey
      in: header
      name: PRIVATE-SECRET-KEY
      x-default: <Your PRIVATE-SECRET-KEY>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.