Skip to content
Get started

Connect a customer handle

payment_handles.connect(strhandle) -> PaymentHandleConnection
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.

ParametersExpand Collapse
handle: str
ReturnsExpand Collapse
class PaymentHandleConnection:
connect_id: Optional[str]

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[str]
status: Optional[Literal["not_connected", "pending", "connected", "revoked"]]
One of the following:
"not_connected"
"pending"
"connected"
"revoked"

Connect a customer handle

import os
from linq import LinqAPIV3

client = LinqAPIV3(
    api_key=os.environ.get("LINQ_API_V3_API_KEY"),  # This is the default and can be omitted
)
payment_handle_connection = client.payment_handles.connect(
    "handle",
)
print(payment_handle_connection.connect_id)
{
  "connect_id": "cs_01HZY8",
  "handle": "+14155550123",
  "status": "connected"
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2004/"
  },
  "success": false
}
{
  "error": {
    "status": 403,
    "code": 2005,
    "message": "Access denied - insufficient permissions for this resource",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2005/"
  },
  "success": false
}
{
  "error": {
    "status": 404,
    "code": 2001,
    "message": "Resource not found",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2001/"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error",
    "doc_url": "https://docs.linqapp.com/error/codes/3xxx/3006/"
  },
  "success": false
}
Returns Examples
{
  "connect_id": "cs_01HZY8",
  "handle": "+14155550123",
  "status": "connected"
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2004/"
  },
  "success": false
}
{
  "error": {
    "status": 403,
    "code": 2005,
    "message": "Access denied - insufficient permissions for this resource",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2005/"
  },
  "success": false
}
{
  "error": {
    "status": 404,
    "code": 2001,
    "message": "Resource not found",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2001/"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error",
    "doc_url": "https://docs.linqapp.com/error/codes/3xxx/3006/"
  },
  "success": false
}