AlmondTill/G3N API

fileClaimWarranty

mutation · in the family Selling

What it does

File a claim on an active warranty — link the customer-service case and the warranty flips to claimed.

File a claim on an active Warranty: links a warranty_claim CsCase both ways in ONE transaction (the warranty’s caseId + the case’s warrantyId); the maker/supplier routing is the snapshotted provider. Refuses CONFLICT/EXPIRED on an expired warranty, CONFLICT/REF_STATE on a non-warranty or closed/cancelled case, CONFLICT/REVISION_STALE on a stale expectedRevision; a claimed warranty declares no further edge (claim resolution is the deferred sub-flow).

Before you call

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

Capability area: Selling — Ringing sales, serving customers and issuing invoices.

Roles that may call it:

What happens

The case records the claim; the warranty stays claimed (resolution with the maker or supplier is handled on the case).

Arguments

NameTypeRequiredNotes
inputClaimWarrantyInput ClaimWarrantyInput!yesClaim-input for fileClaimWarranty.

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

Warranty Warranty! — A Warranty — the warranty instance: one sold order line under one WarrantyTerms template. Born by the platform when the sale completes (paid AND delivered) for every variant line whose product carries an active product-attached template or whose variant names a manufacturer carrying an active manufacturer-attached template (one warranty per matching template); never created on the wire. The policy is snapshotted at birth (provider · durationDays → expiresAt = startsAt + durationDays), so later template edits never rewrite an issued warranty. active → expired is the scheduler’s over expiresAt; active → claimed is fileClaimWarranty (a warranty_claim CsCase linked both ways). The serial number is optional and stamped through updateWarranty. Listings keep expired warranties as coverage history (the settled-payment class — a status filter narrows to active); every warranty stays reachable by id from the order line’s warrantyIds.

Example request

graphql
mutation ExampleFileClaimWarranty($input: ClaimWarrantyInput!) {
  fileClaimWarranty(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationId
    orderLineNo
    variantId
    productId
    warrantyTermsId
    provider
    durationDays
    quantity
    startsAt
    expiresAt
    consumerId
    serialNumber
    caseId
  }
}

Variables:

json
{
  "input": {
    "warrantyId": "01900000-0000-7000-8000-9f906bed0000",
    "expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
    "caseId": "01900000-0000-7000-8000-1b5184d10000",
    "reason": "Correcting a miscount."
  }
}

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

Example response

json
{
  "data": {
    "fileClaimWarranty": {
      "id": "01900000-0000-7000-8000-9f906bed0000",
      "sysId": "WR-EXMP-0000-000F",
      "type": "Warranty",
      "caption": "Blue jeans",
      "status": "claimed",
      "parentId": "01900000-0000-7000-8000-18e782370000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "organizationId": "01900000-0000-7000-8000-1971e30a0000",
      "orderLineNo": 1,
      "variantId": "01900000-0000-7000-8000-8433b0260000",
      "productId": "01900000-0000-7000-8000-529c60cc0000",
      "warrantyTermsId": "01900000-0000-7000-8000-63c8e3d40000",
      "provider": "manufacturer",
      "durationDays": 1,
      "quantity": "2",
      "startsAt": "2027-01-31T00:00:00.000Z",
      "expiresAt": "2028-01-31T00:00:00.000Z",
      "consumerId": "01900000-0000-7000-8000-3cbb3ce90000",
      "serialNumber": "<serial number>",
      "caseId": "01900000-0000-7000-8000-1b5184d10000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in