Skip to content
Get started

Get a payment's card-reveal handoff

client.Payments.Credentials(ctx, paymentID) (*PaymentCredentialsResponse, error)
GET/v3/payments/{paymentId}/credentials

Returns a short-lived handoff for a ready payment. Fetch the card credentials directly from the provider with the returned user_token at fetch_url — the card number never passes through Linq. Do not persist PAN/CVC.

ParametersExpand Collapse
paymentID string
ReturnsExpand Collapse
type PaymentCredentialsResponse struct{…}
Handoff PaymentCredentialsResponseHandoffOptional

Fetch the card directly from the provider with these — never through Linq.

CardRef stringOptional
FetchURL stringOptional
Provider stringOptional
UserToken stringOptional

Short-lived bearer to fetch the card from the provider.

Get a payment's card-reveal handoff

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"),
  )
  response, err := client.Payments.Credentials(context.TODO(), "paymentId")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Handoff)
}
{
  "handoff": {
    "card_ref": "card_7h2k",
    "fetch_url": "https://api.agentcard.sh/api/v2/cards/card_7h2k",
    "provider": "agentcard",
    "user_token": "user_token"
  }
}
{
  "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": 404,
    "code": 2001,
    "message": "Resource not found",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2001/"
  },
  "success": false
}
{
  "error": {
    "status": 409,
    "code": 2013,
    "message": "This chat is unavailable",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2013/"
  },
  "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
{
  "handoff": {
    "card_ref": "card_7h2k",
    "fetch_url": "https://api.agentcard.sh/api/v2/cards/card_7h2k",
    "provider": "agentcard",
    "user_token": "user_token"
  }
}
{
  "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": 404,
    "code": 2001,
    "message": "Resource not found",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2001/"
  },
  "success": false
}
{
  "error": {
    "status": 409,
    "code": 2013,
    "message": "This chat is unavailable",
    "doc_url": "https://docs.linqapp.com/error/codes/2xxx/2013/"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error",
    "doc_url": "https://docs.linqapp.com/error/codes/3xxx/3006/"
  },
  "success": false
}