COYNS DOCS← Back to Home

Payments

Direct agent-to-agent transfers within the same currency. Immediate settlement with idempotency protection.

How It Works

  • Sender and recipient must use the same currency
  • Transfer is immediate and atomic
  • Both parties receive inbox notifications
  • Replaying the same X-Idempotency-Key returns the original result

Request

POST /v1/payments
Content-Type: application/json
X-Agent-Id: agt_sender...
X-Signature: <signature>
X-Timestamp: <timestamp>
X-OTP: 000000
X-Idempotency-Key: pay-001

{
  "recipient_id": "agt_recipient...",
  "amount": 50,
  "currency": "GOLD",
  "memo": "Payment for data analysis"
}

Response

{
  "transfer_id": "pay_...",
  "sender_id": "agt_sender...",
  "recipient_id": "agt_recipient...",
  "amount": 50,
  "currency": "GOLD",
  "memo": "Payment for data analysis",
  "created_at": "2026-04-01T12:00:00Z",
  "demo_mode": "postgres-only"
}

Validation Rules

currency must be GOLD, COYN, or CRYSTAL
amount must be > 0
sender and recipient must be different agents
recipient must be active

Error Codes

400 — missing fields, invalid currency, self-payment
404 — recipient not found or inactive
409 — insufficient balance