ONE orders:pay
← Receivers

orders:pay

orders family

kind 'refund': refund a card order the workspace sold, in full or in part, on the Stripe account the charge ran on; ONE's fee is refunded with it, and a full refund of a booking deposit dissolves the booking and takes paid off the lead

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.
Idempotent
yes
Safe to retry as-is.

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/orders:pay \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "kind": "refund", "slug": "acme-movers", "oid": "ord_1" }}'

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.

  • kind refund required refund = send a card order's money back to its buyer. Required: no kind is a default and none moves money; any other is refused as bad_kind after the caller's authority is checked
  • slug string required The workspace that sold the order — yours, or one you hold role owner on directly (an agency above it may not refund)
  • oid string required The order id (orders.oid)
  • amount_cents number optional Whole cents to refund; omitted = everything not yet refunded
  • reason requested_by_customer | duplicate | fraudulent optional Stripe's refund reason; default requested_by_customer
  • 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
  • oid string
  • refund_id string
  • status string | null
  • amount_cents number
  • refunded_total_cents number
  • fully_refunded boolean
  • charge_type direct | destination
  • account string
  • application_fee_refunded boolean
  • recorded boolean
  • booking_dissolved boolean
  • test_mode boolean
  • error string forbidden · bad_kind · not_found · not_refundable · not_a_card_order · already_refunded · exceeds_order · mode_mismatch · charge_not_found · stripe_refused · refund_failed · stripe_unavailable

Traffic

Every call to orders: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 orders: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 2
  • one.ie/web/src/lib/receiver-index.generated.ts:281
  • one.ie/web/src/lib/resolvers/_shared.ts:201
→

Answered by

orders:pay one.ie/web/src/lib/resolvers/_shared.ts:210 Dispatched through POST /api/ask/orders:pay, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "refund"
      ],
      "description": "refund = send a card order's money back to its buyer. Required: no kind is a default and none moves money; any other is refused as bad_kind after the caller's authority is checked"
    },
    "slug": {
      "type": "string",
      "description": "The workspace that sold the order — yours, or one you hold role owner on directly (an agency above it may not refund)"
    },
    "oid": {
      "type": "string",
      "description": "The order id (orders.oid)"
    },
    "amount_cents": {
      "description": "Whole cents to refund; omitted = everything not yet refunded",
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "reason": {
      "description": "Stripe's refund reason; default requested_by_customer",
      "type": "string",
      "enum": [
        "requested_by_customer",
        "duplicate",
        "fraudulent"
      ]
    },
    "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": [
    "kind",
    "slug",
    "oid"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "oid": {
      "type": "string"
    },
    "refund_id": {
      "type": "string"
    },
    "status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "amount_cents": {
      "type": "number"
    },
    "refunded_total_cents": {
      "type": "number"
    },
    "fully_refunded": {
      "type": "boolean"
    },
    "charge_type": {
      "type": "string",
      "enum": [
        "direct",
        "destination"
      ]
    },
    "account": {
      "type": "string"
    },
    "application_fee_refunded": {
      "type": "boolean"
    },
    "recorded": {
      "type": "boolean"
    },
    "booking_dissolved": {
      "type": "boolean"
    },
    "test_mode": {
      "type": "boolean"
    },
    "error": {
      "description": "forbidden · bad_kind · not_found · not_refundable · not_a_card_order · already_refunded · exceeds_order · mode_mismatch · charge_not_found · stripe_refused · refund_failed · stripe_unavailable",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}