Refund & Dispute Handling

Refund checkout sessions and invoices in crypto.

Open the interactive version or read this guide as markdown.

Tags: Refunds, Webhooks, Support

Paste this prompt into Claude, ChatGPT, or any AI tool. It works best with the CoinCircuit MCP server connected: https://mcp.coincircuit.io


You are helping me add refund handling to my existing CoinCircuit payment integration. I have the CoinCircuit MCP server connected.

If you have access to the CoinCircuit MCP server, call these tools for the most accurate and detailed schema outputs:

Use the live MCP data as your source of truth. The details below are a guide, but if the MCP returns something different, trust the MCP.

API Basics

Project Context

I have an application using CoinCircuit for payments and I need to handle customer refund requests for both checkout session payments and invoice payments. CoinCircuit sends crypto refunds to a wallet address you specify.

What I Need You to Implement

1. Estimate refund before processing

Before issuing a refund, show the customer what they'll receive after fees.

Endpoint: GET /api/v1/refunds/estimate/{reference}?entity={type} (Call get_endpoint with method get, path /api/v1/refunds/estimate/{reference} in the CoinCircuit MCP for the full parameter and response details.)

Path params:

Query params:

Response (200):

Example:

{
  "success": true,
  "message": "Estimation retrieved successfully",
  "data": {
    "customerReceives": { "amount": "0.50098255", "asset": "SOL", "chain": "solana" },
    "fees": {
      "amount": "0.01038637",
      "asset": "SOL",
      "fiatAmount": "1.00",
      "fiatCurrency": "USDT",
      "paidBy": "customer"
    },
    "customerPaid": { "cryptoAmount": "0.52140427", "asset": "SOL", "fiatAmount": "50.00", "fiatCurrency": "USD" },
    "merchantCost": { "amount": "50.00", "currency": "USDT" },
    "conversionRate": "97.77676674533762",
    "balanceSource": "settled"
  }
}

Use customerReceives and fees for a confirmation screen, e.g. "Network fee: 0.01038637 SOL (1.00 USDT), Customer receives: 0.50098255 SOL".

2. Refund a checkout session

Endpoint: POST /api/v1/refunds/session/{sessionReference} (Call get_endpoint with method post, path /api/v1/refunds/session/{sessionReference}, section request in the CoinCircuit MCP for the exact request body.)

Path params:

Request body:

Example:

{
  "refundAddress": "TF6yMCJqFcT6wFFutxVmRocKgJFD5imKUT",
  "reason": "Customer requested refund - product not as described",
  "feePaidBy": "merchant"
}

Response (201): Returns the refund object:

(Call get_schema with name RefundResponseDto in the CoinCircuit MCP for every field in the refund object, including which are required vs optional.)

3. Refund an invoice

Endpoint: POST /api/v1/refunds/invoice/{invoiceReference} (Call get_endpoint with method post, path /api/v1/refunds/invoice/{invoiceReference} in the CoinCircuit MCP for the full schema.)

Same request body as session refunds: refundAddress (required), reason (optional), feePaidBy (optional). Same response shape.

4. Track refund status via webhooks

(Call get_schema with name RefundSuccessWebhookDto in the CoinCircuit MCP for the full refund.success webhook payload. Call get_schema with name RefundFailedWebhookDto for the failure payload.)

Refund events (envelope: { event: string, data: { refund: RefundObject } }):

Refund object fields in webhook:

5. Query refund history

(Call search_api with feature Refunds in the CoinCircuit MCP to see all listing and detail endpoints.)

List all refunds: GET /api/v1/refunds (returns paginated list) (Call get_endpoint with method get, path /api/v1/refunds in the CoinCircuit MCP for pagination params and response schema.)

Get single refund: GET /api/v1/refunds/{id} (Call get_endpoint with method get, path /api/v1/refunds/{id} in the CoinCircuit MCP for the full response.)

Use these to build a support dashboard showing all refunds with their status, amounts, and transaction details.

6. Customer communication flow

Build email/notification triggers based on webhook events:

Constraints