# Payment Handles

## Connect a customer handle

**post** `/v3/payments/handles/{handle}/connect`

Starts connecting a customer (by phone/email) so an agent can pay on
their behalf. Linq drives the OTP + consent ceremony through the
messaging channel; this returns `pending` and a `connection.created`
webhook fires once the customer completes it.

### Path Parameters

- `handle: string`

### Returns

- `PaymentHandleConnection object { connect_id, handle, status }`

  - `connect_id: optional string`

    Returned only by `connect`, and only while the ceremony is pending.
    Nothing on our side persists it — it comes back from the provider and
    is required again to verify — so hold it until you submit the code.

  - `handle: optional string`

  - `status: optional "not_connected" or "pending" or "connected" or "revoked"`

    - `"not_connected"`

    - `"pending"`

    - `"connected"`

    - `"revoked"`

### Example

```http
curl https://api.linqapp.com/api/partner/v3/payments/handles/$HANDLE/connect \
    -X POST \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY"
```

#### Response

```json
{
  "connect_id": "cs_01HZY8",
  "handle": "+14155550123",
  "status": "connected"
}
```

## Submit a customer's one-time code

**post** `/v3/payments/handles/{handle}/verify`

Completes the ceremony `connect` started: verifies the code, records the
customer's consent, and stores the connection. Returns `connected` on
success, after which payments for this handle no longer need the
customer present.

The code reaches you however your channel works — typically the customer
replies with it in the thread. Codes are single-use and short-lived; if
one has expired, call `connect` again for a fresh `connect_id`.

### Path Parameters

- `handle: string`

### Body Parameters

- `code: string`

  The one-time code the customer received.

- `connect_id: string`

  The id returned by `connect`.

### Returns

- `PaymentHandleConnection object { connect_id, handle, status }`

  - `connect_id: optional string`

    Returned only by `connect`, and only while the ceremony is pending.
    Nothing on our side persists it — it comes back from the provider and
    is required again to verify — so hold it until you submit the code.

  - `handle: optional string`

  - `status: optional "not_connected" or "pending" or "connected" or "revoked"`

    - `"not_connected"`

    - `"pending"`

    - `"connected"`

    - `"revoked"`

### Example

```http
curl https://api.linqapp.com/api/partner/v3/payments/handles/$HANDLE/verify \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY" \
    -d '{
          "code": "482913",
          "connect_id": "cs_01HZY8"
        }'
```

#### Response

```json
{
  "connect_id": "cs_01HZY8",
  "handle": "+14155550123",
  "status": "connected"
}
```

## Get a handle's connection status

**get** `/v3/payments/handles/{handle}/connection`

Get a handle's connection status

### Path Parameters

- `handle: string`

### Returns

- `PaymentHandleConnection object { connect_id, handle, status }`

  - `connect_id: optional string`

    Returned only by `connect`, and only while the ceremony is pending.
    Nothing on our side persists it — it comes back from the provider and
    is required again to verify — so hold it until you submit the code.

  - `handle: optional string`

  - `status: optional "not_connected" or "pending" or "connected" or "revoked"`

    - `"not_connected"`

    - `"pending"`

    - `"connected"`

    - `"revoked"`

### Example

```http
curl https://api.linqapp.com/api/partner/v3/payments/handles/$HANDLE/connection \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY"
```

#### Response

```json
{
  "connect_id": "cs_01HZY8",
  "handle": "+14155550123",
  "status": "connected"
}
```

## Revoke a handle's connection

**delete** `/v3/payments/handles/{handle}/connection`

Revokes this partner's grant for the customer. Only your grant is
removed; the customer's wallet at the provider is untouched.

### Path Parameters

- `handle: string`

### Returns

- `PaymentHandleConnection object { connect_id, handle, status }`

  - `connect_id: optional string`

    Returned only by `connect`, and only while the ceremony is pending.
    Nothing on our side persists it — it comes back from the provider and
    is required again to verify — so hold it until you submit the code.

  - `handle: optional string`

  - `status: optional "not_connected" or "pending" or "connected" or "revoked"`

    - `"not_connected"`

    - `"pending"`

    - `"connected"`

    - `"revoked"`

### Example

```http
curl https://api.linqapp.com/api/partner/v3/payments/handles/$HANDLE/connection \
    -X DELETE \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY"
```

#### Response

```json
{
  "connect_id": "cs_01HZY8",
  "handle": "+14155550123",
  "status": "connected"
}
```

## Domain Types

### Payment Handle Connection

- `PaymentHandleConnection object { connect_id, handle, status }`

  - `connect_id: optional string`

    Returned only by `connect`, and only while the ceremony is pending.
    Nothing on our side persists it — it comes back from the provider and
    is required again to verify — so hold it until you submit the code.

  - `handle: optional string`

  - `status: optional "not_connected" or "pending" or "connected" or "revoked"`

    - `"not_connected"`

    - `"pending"`

    - `"connected"`

    - `"revoked"`
