> ## Documentation Index
> Fetch the complete documentation index at: https://conto.finance/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Delta Smoke Test

> Run the pilot Delta verification flow end to end after Conto activates Delta for your organization

# Delta Smoke Test

This guide validates the live Conto ↔ Delta flow after Conto has activated Delta for your
organization.

<Info>
  Delta access is currently enabled by Conto during onboarding. If your organization does not
  already have Delta, contact [sales@conto.finance](mailto:sales@conto.finance) before using this
  guide.
</Info>

The goal is to prove four things:

1. Conto creates a real approval request when the Delta workflow matches
2. Conto sends the signed `approval.requested` webhook to the pilot Delta verification service
3. Delta calls back with an approval or rejection plus proof metadata
4. Conto records the result and continues the payment flow correctly

## Prerequisites

<Check>Conto has activated Delta for the target organization</Check>
<Check>The organization's dashboard shows the Delta tab</Check>
<Check>The pilot Delta verification service is running and reachable at a public HTTPS URL</Check>
<Check>The pilot Delta verification service and Conto share the same HMAC secret</Check>
<Check>Your test vendor is allowlisted in the pilot Delta verification service</Check>
<Check>Your Conto organization has an approved counterparty for the same vendor address</Check>

## Invoice Context Required by Delta

To trigger the pilot Delta verification service meaningfully, send invoice details in
`context.invoice`.

```json theme={null}
{
  "invoice": {
    "id": "ACME-1003",
    "hash": "acme-1003-sha256-demo",
    "vendorId": "acme-supplies",
    "vendorAddress": "0x1111111111111111111111111111111111111111",
    "expectedAmount": "45",
    "currency": "pathUSD",
    "payload": {
      "invoiceNumber": "ACME-1003",
      "lineItems": [
        {
          "description": "Demo office supplies",
          "amount": "45"
        }
      ]
    }
  }
}
```

## Managed Wallet Flow

Use this flow when Conto executes the payment onchain.

### Step 1: Request the payment

```bash theme={null}
curl -X POST https://conto.finance/api/sdk/payments/request \
  -H "Authorization: Bearer $CONTO_AGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 45,
    "recipientAddress": "0x1111111111111111111111111111111111111111",
    "recipientName": "Acme Supplies",
    "purpose": "Invoice ACME-1003",
    "category": "SUPPLIES",
    "walletId": "wallet_id",
    "idempotencyKey": "delta-smoke-acme-1003",
    "context": {
      "invoice": {
        "id": "ACME-1003",
        "hash": "acme-1003-sha256-demo",
        "vendorId": "acme-supplies",
        "vendorAddress": "0x1111111111111111111111111111111111111111",
        "expectedAmount": "45",
        "currency": "pathUSD",
        "payload": {
          "invoiceNumber": "ACME-1003"
        }
      }
    }
  }'
```

### Expected response

When the Delta workflow matches, expect:

* `status = "REQUIRES_APPROVAL"`
* `approvalRequestId` present
* No `executeUrl` yet

Example:

```json theme={null}
{
  "requestId": "pr_...",
  "status": "REQUIRES_APPROVAL",
  "approvalRequestId": "ar_...",
  "reasons": ["Approval required by workflow \"delta\""]
}
```

### Step 2: Verify Delta receives the webhook

Delta should receive `approval.requested` with:

* `approvalRequestId`
* `paymentDetails`
* `invoice`
* `actionToken.approveToken`
* `actionToken.rejectToken`

### Step 3: Verify the callback

After Delta approves, Conto should:

* Keep the same `approvalRequestId`
* Record proof metadata on the Delta verification record
* Move the payment request out of `PENDING_APPROVAL`

### Step 4: Execute the managed-wallet payment

Once approved, call execute:

```bash theme={null}
curl -X POST https://conto.finance/api/sdk/payments/{requestId}/execute \
  -H "Authorization: Bearer $CONTO_AGENT_KEY"
```

### Step 5: Verify completion

After execution:

* The payment request is executed successfully
* Conto emits `payment.executed`
* Delta can mark the invoice as paid without polling

## External Wallet Flow

Use this flow when the agent or operator controls the signing keys.

### Step 1: Approve the payment request

```bash theme={null}
curl -X POST https://conto.finance/api/sdk/payments/approve \
  -H "Authorization: Bearer $CONTO_AGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 45,
    "chainId": "42431",
    "senderAddress": "0xabc123def456789abc123def456789abc123def4",
    "recipientAddress": "0x1111111111111111111111111111111111111111",
    "recipientName": "Acme Supplies",
    "purpose": "Invoice ACME-1003",
    "category": "SUPPLIES",
    "context": {
      "invoice": {
        "id": "ACME-1003",
        "hash": "acme-1003-sha256-demo",
        "vendorId": "acme-supplies",
        "vendorAddress": "0x1111111111111111111111111111111111111111",
        "expectedAmount": "45",
        "currency": "pathUSD"
      }
    }
  }'
```

### Expected response

When the Delta workflow matches, expect:

* `status = "REQUIRES_APPROVAL"`
* `approvalRequestId` present

### Step 2: Wait for Delta approval

Delta should receive the same `approval.requested` webhook and submit its decision back to Conto.

### Step 3: Send the onchain transfer externally

After approval, submit the transfer with your own signer or wallet integration.

### Step 4: Confirm the transfer in Conto

```bash theme={null}
curl -X POST https://conto.finance/api/sdk/payments/{requestId}/confirm \
  -H "Authorization: Bearer $CONTO_AGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "txHash": "0x..."
  }'
```

## Duplicate Invoice Test

After a successful first approval, resubmit the same vendor invoice ID or invoice hash.

Expected result:

* Delta rejects the request
* Conto records the rejection on the same approval request / Delta verification trail
* The payment does not proceed to execution

## Where To Verify In The Dashboard

Check these areas in Conto:

* **Alerts & Approvals**: the payment should show a real approval request
* **Delta** tab: the verification row should appear with status and proof reference
* **Delta detail view**: invoice context, proof metadata, and approval timeline

## Common Failure Modes

| Symptom                                                   | Likely Cause                                                    |
| --------------------------------------------------------- | --------------------------------------------------------------- |
| No webhook reaches Delta                                  | Webhook URL is private, wrong, or blocked by network policy     |
| Webhook reaches Delta but is rejected                     | Shared HMAC secret does not match                               |
| Request returns `APPROVED` instead of `REQUIRES_APPROVAL` | Delta workflow did not match the org, agent, or payment context |
| Delta rejects immediately                                 | Vendor not allowlisted or invoice failed verifier guardrails    |
| No completion event after execution                       | `payment.executed` delivery is not configured on the Delta side |

## Related Docs

<CardGroup cols={2}>
  <Card title="Delta Verification Setup" icon="sliders" href="/guides/delta-setup">
    Request Delta onboarding and prepare your organization for activation
  </Card>

  <Card title="Payments API" icon="wallet" href="/sdk/payments">
    Request, approve, execute, and confirm payment flows
  </Card>

  <Card title="Notification Channels" icon="tower-broadcast" href="/integrations/notification-channels">
    Review the Delta pilot webhook payload and verification callback contract
  </Card>

  <Card title="External Approval Channels" icon="shield-check" href="/guides/external-approvals">
    General approval-channel behavior outside the Delta-specific flow
  </Card>
</CardGroup>
