AlmondTill/G3N API

Set warranty terms and handle a claim

Define what coverage a product carries so every sale of it can carry a warranty, and when a customer claims, file the claim on the active warranty — it links the customer-service case and the warranty flips to claimed.

Selling · a play in 3 steps.

In the office

Where it starts: the office’s Warranty terms page.

Step 1. Define the coverage a product carries, and edit the terms as they change. Open Warranty terms.

Step 2. File the claim on the active warranty — the case records it; the warranty flips to claimed. Open Warranties.

Step 3. Keep the warranty record current.

For developers — the calls

The steps

  1. Define the coverage a product carries, and edit the terms as they change. — createWarrantyTerms, updateWarrantyTerms
  2. File the claim on the active warranty — the case records it; the warranty flips to claimed. — fileClaimWarranty
  3. Keep the warranty record current. — updateWarranty

The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

createWarrantyTerms

createWarrantyTerms — mutation · Create a new warranty terms — what coverage a product carries at your organization.

Example request

graphql
mutation ExampleCreateWarrantyTerms($input: NewWarrantyTermsInput!) {
  createWarrantyTerms(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    provider
    durationDays
    coverage
    productId
    manufacturerId
  }
}

Variables:

json
{
  "input": {
    "caption": "Blue jeans",
    "provider": "manufacturer",
    "durationDays": 1
  }
}

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

Example response

json
{
  "data": {
    "createWarrantyTerms": {
      "id": "01900000-0000-7000-8000-63c8e3d40000",
      "sysId": "WT-EXMP-0000-000F",
      "type": "WarrantyTerms",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 0,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "provider": "manufacturer",
      "durationDays": 1,
      "coverage": "<coverage>",
      "productId": "01900000-0000-7000-8000-529c60cc0000",
      "manufacturerId": "01900000-0000-7000-8000-7897bed00000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

updateWarrantyTerms

updateWarrantyTerms — mutation · Edit warranty terms — what coverage a product carries — change its details.

Example request

graphql
mutation ExampleUpdateWarrantyTerms($id: ID!, $revision: ID!, $input: EditWarrantyTermsInput!) {
  updateWarrantyTerms(id: $id, revision: $revision, input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    provider
    durationDays
    coverage
    productId
    manufacturerId
  }
}

Variables:

json
{
  "id": "01900000-0000-7000-8000-63c8e3d40000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "input": {
    "caption": "Blue jeans"
  }
}

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

Example response

json
{
  "data": {
    "updateWarrantyTerms": {
      "id": "01900000-0000-7000-8000-63c8e3d40000",
      "sysId": "WT-EXMP-0000-000F",
      "type": "WarrantyTerms",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "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",
      "provider": "manufacturer",
      "durationDays": 1,
      "coverage": "<coverage>",
      "productId": "01900000-0000-7000-8000-529c60cc0000",
      "manufacturerId": "01900000-0000-7000-8000-7897bed00000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

fileClaimWarranty

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

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
        }
      }
    }
  }
}

updateWarranty

updateWarranty — mutation · Edit warranty terms on what you sell — change its details.

Example request

graphql
mutation ExampleUpdateWarranty($id: ID!, $revision: ID!, $input: EditWarrantyInput!) {
  updateWarranty(id: $id, revision: $revision, 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
{
  "id": "01900000-0000-7000-8000-9f906bed0000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "input": {
    "serialNumber": "<serial number>"
  }
}

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

Example response

json
{
  "data": {
    "updateWarranty": {
      "id": "01900000-0000-7000-8000-9f906bed0000",
      "sysId": "WR-EXMP-0000-000F",
      "type": "Warranty",
      "caption": "Blue jeans",
      "status": "active",
      "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
        }
      }
    }
  }
}