AlmondTill/G3N API

refundTender

mutation · in the family Refunds and payment corrections

What it does

Refund a specific payment on an order (the record-only lane for cash/external tenders).

cancelOrder refuses CONFLICT/TENDERED while net tendered > 0 — refund-then-cancel. Requires the unrestricted capability.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

Capability area: Refunds and payment corrections — Refunds, corrective notes and voiding invoices.

Roles that may call it:

Careful

Money out, recorded forever.

Arguments

NameTypeRequiredNotes
inputRefundTenderInput RefundTenderInput!yesRefund-input for refundTender: a positive magnitude (the port stamps the negative sign); cap = the net tendered (CONFLICT/OVER_TENDERED); cash is live; the stored-value types joined.

Concurrency

Send the record’s current revision from your last read as expectedRevision. A stale revision is refused as CONFLICT/REVISION_STALE — read the record again and retry with the new value.

Returns

Tender Tender! — Posted only by applyTender, refundTender, and the refund writers (refundReturn/posReturn method=cash) — each in ONE transaction with the Order rollup stamp (+ the drawer entries for cash).

Example request

graphql
mutation ExampleRefundTender($input: RefundTenderInput!) {
  refundTender(input: $input) {
    id
    type
    caption
    status
    parentId
    rootId
    tenderType
    appliedMinor
    currency
    collectedMinor
    changeMinor
    tipMinor
    roundingDeltaMinor
    paymentId
    instrumentId
    orgCustomerId
    returnId
    tillSessionId
    reason
    refs
    createdAt
    updatedAt
    revision
    revisionNum
  }
}

Variables:

json
{
  "input": {
    "orderId": "01900000-0000-7000-8000-18e782370000",
    "expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
    "tenderType": "cash",
    "amountMinor": 1250,
    "tillSessionId": "01900000-0000-7000-8000-4ed885220000",
    "reason": "Correcting a miscount."
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "refundTender": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "type": "<type>",
      "caption": "Blue jeans",
      "status": "<status>",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "tenderType": "cash",
      "appliedMinor": -1250,
      "currency": "USD",
      "collectedMinor": 1250,
      "changeMinor": 0,
      "tipMinor": 0,
      "roundingDeltaMinor": 0,
      "paymentId": null,
      "instrumentId": null,
      "orgCustomerId": null,
      "returnId": null,
      "tillSessionId": "01900000-0000-7000-8000-4ed885220000",
      "reason": "Correcting a miscount.",
      "refs": [
        "<refs>"
      ],
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "revisionNum": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in