Skip to content
Get started

Submit a customer's one-time code

client.PaymentHandles.Verify(ctx, handle, body) (*PaymentHandleConnection, error)
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.

ParametersExpand Collapse
handle string
body PaymentHandleVerifyParams
Code param.Field[string]

The one-time code the customer received.

ConnectID param.Field[string]

The id returned by connect.

ReturnsExpand Collapse
type PaymentHandleConnection struct{…}
ConnectID stringOptional

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 stringOptional
Status PaymentHandleConnectionStatusOptional
One of the following:
const PaymentHandleConnectionStatusNotConnected PaymentHandleConnectionStatus = "not_connected"
const PaymentHandleConnectionStatusPending PaymentHandleConnectionStatus = "pending"
const PaymentHandleConnectionStatusConnected PaymentHandleConnectionStatus = "connected"
const PaymentHandleConnectionStatusRevoked PaymentHandleConnectionStatus = "revoked"

Submit a customer's one-time code

package main

import (
  "context"
  "fmt"

  "github.com/linq-team/linq-go"
  "github.com/linq-team/linq-go/option"
)

func main() {
  client := linqgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  paymentHandleConnection, err := client.PaymentHandles.Verify(
    context.TODO(),
    "handle",
    linqgo.PaymentHandleVerifyParams{
      Code: "482913",
      ConnectID: "cs_01HZY8",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", paymentHandleConnection.ConnectID)
}
{
  "connect_id": "cs_01HZY8",
  "handle": "+14155550123",
  "status": "connected"
}
{
  "error": {
    "status": 400,
    "code": 1002,
    "message": "Phone number must be in E.164 format",
    "doc_url": "https://docs.linqapp.com/error/codes/1xxx/1002/"
  },
  "success": false
}
{
  "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": 400,
    "code": 1002,
    "message": "Phone number must be in E.164 format",
    "doc_url": "https://docs.linqapp.com/error/codes/1xxx/1002/"
  },
  "success": false
}
{
  "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
}