Skip to main content

Counterparties API

Manage payment recipients and trust levels.

List Counterparties

curl https://conto.finance/api/counterparties \
  -H "Authorization: Bearer $CONTO_API_KEY"

Query Parameters

ParameterTypeDefaultDescription
limitnumber50Results per page
offsetnumber0Pagination offset
statusstringallTRUSTED, VERIFIED, UNKNOWN, BLOCKED
searchstring-Search by name or address

Response

{
  "counterparties": [
    {
      "id": "cpty_abc123",
      "name": "OpenAI",
      "address": "0x892c45Dd7745D0643036b4c955Ac8e6706g...",
      "status": "TRUSTED",
      "trustScore": 95,
      "category": "API_PROVIDER",
      "transactionCount": 150,
      "totalVolume": 7500.00,
      "lastTransactionAt": "2024-01-15T14:30:00Z",
      "createdAt": "2024-01-01T10:00:00Z"
    }
  ],
  "pagination": {
    "total": 25,
    "limit": 50,
    "offset": 0,
    "hasMore": false
  }
}

Get Counterparty

curl https://conto.finance/api/counterparties/{counterpartyId} \
  -H "Authorization: Bearer $CONTO_API_KEY"

Response

{
  "id": "cpty_abc123",
  "name": "OpenAI",
  "address": "0x892c45Dd7745D0643036b4c955Ac8e6706g...",
  "status": "TRUSTED",
  "trustScore": 95,
  "category": "API_PROVIDER",
  "notes": "Primary AI provider for customer support agents",
  "website": "https://openai.com",
  "transactionCount": 150,
  "totalVolume": 7500.00,
  "averageAmount": 50.00,
  "lastTransactionAt": "2024-01-15T14:30:00Z",
  "networkTrust": {
    "globalScore": 98,
    "transactionCount": 50000,
    "organizationCount": 250,
    "lastUpdated": "2024-01-15T00:00:00Z"
  },
  "createdAt": "2024-01-01T10:00:00Z",
  "updatedAt": "2024-01-15T14:30:00Z"
}

Create Counterparty

curl -X POST https://conto.finance/api/counterparties \
  -H "Authorization: Bearer $CONTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Anthropic",
    "address": "0x123abc...",
    "category": "API_PROVIDER",
    "status": "VERIFIED",
    "notes": "Claude API provider"
  }'

Request Body

FieldTypeRequiredDescription
namestringYesCounterparty name
addressstringYesWallet address
categorystringNoMerchant category
statusstringNoTrust status
notesstringNoInternal notes
websitestringNoWebsite URL

Status Values

StatusDescription
TRUSTEDFully trusted, no restrictions
VERIFIEDIdentity verified
UNKNOWNNot yet verified
BLOCKEDAll payments blocked

Categories

CategoryDescription
API_PROVIDERAPI service providers
CLOUD_SERVICESCloud infrastructure
DATA_SERVICESData providers
TOOLSSoftware tools
VENDORGeneral vendors
CONTRACTORService contractors
REFUNDCustomer refunds
OTHEROther categories

Update Counterparty

curl -X PUT https://conto.finance/api/counterparties/{counterpartyId} \
  -H "Authorization: Bearer $CONTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Name",
    "status": "TRUSTED",
    "notes": "Updated notes"
  }'

Update Trust Status

Trust Counterparty

curl -X POST https://conto.finance/api/counterparties/{counterpartyId}/trust \
  -H "Authorization: Bearer $CONTO_API_KEY" \
  -d '{"reason": "Verified business relationship"}'

Block Counterparty

Blocking a counterparty will prevent all future payments to this address.
curl -X POST https://conto.finance/api/counterparties/{counterpartyId}/block \
  -H "Authorization: Bearer $CONTO_API_KEY" \
  -d '{"reason": "Suspicious activity"}'

Unblock Counterparty

curl -X POST https://conto.finance/api/counterparties/{counterpartyId}/unblock \
  -H "Authorization: Bearer $CONTO_API_KEY"

Lookup by Address

Find a counterparty by wallet address.
curl "https://conto.finance/api/counterparties/lookup?address=0x..." \
  -H "Authorization: Bearer $CONTO_API_KEY"

Response

{
  "found": true,
  "counterparty": {
    "id": "cpty_abc123",
    "name": "OpenAI",
    "address": "0x...",
    "status": "TRUSTED",
    "trustScore": 95
  },
  "networkTrust": {
    "globalScore": 98,
    "transactionCount": 50000,
    "status": "TRUSTED"
  }
}

Transaction History

Get transactions with a specific counterparty.
curl "https://conto.finance/api/counterparties/{counterpartyId}/transactions?limit=50" \
  -H "Authorization: Bearer $CONTO_API_KEY"

Response

{
  "transactions": [
    {
      "id": "tx_abc123",
      "amount": 50.00,
      "currency": "USD",
      "status": "CONFIRMED",
      "agentId": "agt_xyz789",
      "agentName": "Support Agent",
      "purpose": "API credits",
      "createdAt": "2024-01-15T14:30:00Z"
    }
  ],
  "summary": {
    "totalVolume": 7500.00,
    "transactionCount": 150,
    "averageAmount": 50.00
  },
  "pagination": {
    "total": 150,
    "limit": 50,
    "offset": 0,
    "hasMore": true
  }
}

Network Trust Data

Get network-wide trust intelligence for an address.
curl "https://conto.finance/api/counterparties/network-trust?address=0x..." \
  -H "Authorization: Bearer $CONTO_API_KEY"

Response

{
  "address": "0x...",
  "networkTrust": {
    "globalScore": 98,
    "transactionCount": 50000,
    "organizationCount": 250,
    "successRate": 99.9,
    "averageAmount": 75.00,
    "firstSeen": "2023-01-15T00:00:00Z",
    "lastSeen": "2024-01-15T14:30:00Z",
    "status": "TRUSTED",
    "flags": []
  },
  "riskIndicators": {
    "ofacMatch": false,
    "highRiskCountry": false,
    "unusualPattern": false
  }
}

Bulk Import

Import multiple counterparties at once.
curl -X POST https://conto.finance/api/counterparties/import \
  -H "Authorization: Bearer $CONTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "counterparties": [
      {
        "name": "Vendor A",
        "address": "0x...",
        "category": "VENDOR",
        "status": "VERIFIED"
      },
      {
        "name": "Vendor B",
        "address": "0x...",
        "category": "VENDOR",
        "status": "VERIFIED"
      }
    ]
  }'

Response

{
  "imported": 2,
  "skipped": 0,
  "errors": [],
  "counterparties": [
    { "id": "cpty_abc123", "name": "Vendor A" },
    { "id": "cpty_def456", "name": "Vendor B" }
  ]
}

SDK: Create Counterparty (Agent Endpoint)

Agents can programmatically create or update counterparties via the SDK endpoint. This upserts on [organizationId, address] and automatically creates an AgentRelationship. Required Scope: counterparties:write
curl -X POST https://conto.finance/api/sdk/counterparties \
  -H "Authorization: Bearer conto_agent_xxx..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Anthropic",
    "address": "0x123abc...",
    "type": "VENDOR",
    "category": "AI_SERVICES",
    "description": "Claude API provider"
  }'

Request Body

FieldTypeRequiredDescription
namestringYesCounterparty name (1-200 chars)
addressstringYesWallet address (1-200 chars)
typestringNoCounterparty type (default: VENDOR)
categorystringNoSpending category
descriptionstringNoNotes (max 500 chars)

Response

{
  "id": "cpty_abc123",
  "name": "Anthropic",
  "address": "0x123abc...",
  "type": "VENDOR",
  "category": "AI_SERVICES",
  "trustScore": 0.2,
  "trustLevel": "LOW",
  "riskLevel": "MEDIUM",
  "created": true
}
If the address already exists for the organization, existing fields are updated and created still returns true. An AgentRelationship (TRANSACTS_WITH) is automatically created if it doesn’t exist. New counterparties start with a LOW trust level (score 0.2).

Delete Counterparty

curl -X DELETE https://conto.finance/api/counterparties/{counterpartyId} \
  -H "Authorization: Bearer $CONTO_API_KEY"
Deleting a counterparty does not delete transaction history. The counterparty will be recreated if a new transaction is made to the same address.

Error Responses

StatusCodeDescription
400INVALID_INPUTInvalid request data
400INVALID_ADDRESSInvalid wallet address
401AUTH_FAILEDAuthentication failed
403INSUFFICIENT_SCOPEMissing required scope
404NOT_FOUNDCounterparty not found
409ALREADY_EXISTSAddress already registered