ONE invoice:pay
← Receivers

invoice:pay

invoice family

mcp

Charge the customer's SAVED card for a sent invoice, off-session. Only a card the customer agreed to save at checkout can be charged. Needs your explicit confirm:true and amountCents equal to the invoice total (without them the answer is a preview and nothing is charged); capped at $1,000 a charge. A card that needs 3-D Secure answers authentication_required with a pay link to send instead. Test money until the store is live.

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
owner
The class of authority the caller must already hold, decided from the attested context with no round trip.
Cost
free
What one call costs, so you can budget before acting.
Reversible
no
This cannot be undone. Dry-run it first where the contract allows.
Settles
offchain
Moves real value off chain — a balance changes.
Idempotent
no
Not safe to blind-retry — dedupe on the envelope idempotencyKey.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/invoice:pay \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "id": <string> }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • workspace string optional Defaults to the attested caller's own; the caller must control it
  • id string required The invoice id (inv_…)
  • cardId string optional A saved card of THIS workspace; default: the customer's newest active card. A card saved by another customer is refused card_not_this_customer
  • amountCents number optional Must equal the invoice total, so a stale screen cannot charge a figure you did not see (amount_mismatch)
  • confirm boolean optional true is the explicit yes; absent answers confirmation_required with a preview
  • contract any optional WORK-AST s-expression (JSON arrays) — `["contract", ["workflow", name, ["signal", ["to", "<this receiver>"]], …]]`. Required from an agent key on a value-moving receiver, and it must name THIS receiver in a `signal` node; validated against the schema-generated grammar before the resolver runs (@oneie/sdk/work-contract).
  • contractScope object optional The scope the contract is validated against. Must travel with `contract` (half a declaration is refused).

Response

What comes back from the call.

  • ok boolean
  • id string
  • chargeId string
  • paymentIntent string
  • amountCents number
  • status string
  • testMode boolean
  • card object
  • payUrl string On authentication_required or too_many_attempts: the hosted pay link to send the customer
  • preview object
  • detail string
  • error string sign_in_required · not_your_workspace · not_found · not_an_invoice · invoice_not_sent · invoice_paid · invoice_void · confirmation_required · amount_mismatch · amount_over_cap · card_cap_24h · card_rate_limit · checkout_open · no_saved_card · card_not_this_customer · card_revoked · mode_mismatch · card_account_changed · charge_in_flight · too_many_attempts · stripe_not_configured · seller_payments_not_ready · card_declined · authentication_required · charge_failed · store_unavailable · no_db

Traffic

Every call to invoice:pay, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names invoice:pay, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

API route 4
  • one.ie/web/src/lib/pay/customer-invoice-pay.ts:196
  • one.ie/web/src/lib/receiver-index.generated.ts:251
  • one.ie/web/src/lib/resolvers/_shared.ts:244
  • one.ie/web/src/lib/resolvers/customer-invoice.ts:287
CLI 2
  • packages/cli/src/invoice.ts:176
  • packages/cli/src/lib/money-receivers.ts:26
→

Answered by

invoice:pay one.ie/web/src/lib/resolvers/customer-invoice.ts:315 Dispatched through POST /api/ask/invoice:pay, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspace": {
      "description": "Defaults to the attested caller's own; the caller must control it",
      "type": "string"
    },
    "id": {
      "type": "string",
      "description": "The invoice id (inv_…)"
    },
    "cardId": {
      "description": "A saved card of THIS workspace; default: the customer's newest active card. A card saved by another customer is refused card_not_this_customer",
      "type": "string"
    },
    "amountCents": {
      "description": "Must equal the invoice total, so a stale screen cannot charge a figure you did not see (amount_mismatch)",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "confirm": {
      "description": "true is the explicit yes; absent answers confirmation_required with a preview",
      "type": "boolean"
    },
    "contract": {
      "description": "WORK-AST s-expression (JSON arrays) — `[\"contract\", [\"workflow\", name, [\"signal\", [\"to\", \"<this receiver>\"]], …]]`. Required from an agent key on a value-moving receiver, and it must name THIS receiver in a `signal` node; validated against the schema-generated grammar before the resolver runs (@oneie/sdk/work-contract)."
    },
    "contractScope": {
      "description": "The scope the contract is validated against. Must travel with `contract` (half a declaration is refused).",
      "type": "object",
      "properties": {
        "agent": {
          "type": "string",
          "description": "Overridden server-side by the attested actor (ctx.actorId) for a bare key."
        },
        "workspace": {
          "type": "string",
          "description": "Overridden server-side for a bare key: at a value-moving receiver, the workspace the call moves value in (its declared movesIn field, else the caller's attested ownerSlug — exactly what the resolver debits); elsewhere the key's attested home."
        },
        "granted": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Capabilities the contract may use (workflow:define · step:<kind> · track:mark · signal:<receiver> …). For a bare key this is a REQUEST: it is intersected with the bare-key ceiling plus the key's attested grant rows. A value-moving capability (signal:<receiver> for a `moves: \"value\"` receiver) is held only through an `agents:approve` row the workspace owner wrote — it cannot be self-granted here. step:sell is a step kind in the ceiling: a sell step only mints a checkout."
        }
      },
      "required": [
        "agent",
        "workspace",
        "granted"
      ]
    }
  },
  "required": [
    "id"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "id": {
      "type": "string"
    },
    "chargeId": {
      "type": "string"
    },
    "paymentIntent": {
      "type": "string"
    },
    "amountCents": {
      "type": "number"
    },
    "status": {
      "type": "string"
    },
    "testMode": {
      "type": "boolean"
    },
    "card": {
      "type": "object",
      "properties": {
        "brand": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "last4": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "brand",
        "last4"
      ]
    },
    "payUrl": {
      "description": "On authentication_required or too_many_attempts: the hosted pay link to send the customer",
      "type": "string"
    },
    "preview": {
      "type": "object",
      "properties": {
        "amountCents": {
          "type": "number"
        },
        "number": {
          "type": "string"
        },
        "customer": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "card": {
          "type": "object",
          "properties": {
            "brand": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "last4": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "brand",
            "last4"
          ]
        }
      },
      "required": [
        "amountCents",
        "number",
        "customer",
        "card"
      ]
    },
    "detail": {
      "type": "string"
    },
    "error": {
      "description": "sign_in_required · not_your_workspace · not_found · not_an_invoice · invoice_not_sent · invoice_paid · invoice_void · confirmation_required · amount_mismatch · amount_over_cap · card_cap_24h · card_rate_limit · checkout_open · no_saved_card · card_not_this_customer · card_revoked · mode_mismatch · card_account_changed · charge_in_flight · too_many_attempts · stripe_not_configured · seller_payments_not_ready · card_declined · authentication_required · charge_failed · store_unavailable · no_db",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}