AlmondTill/G3N API

Offer appointments on a bookable resource

Add the resource appointments book against — a person, a station, a chair — take the request, confirm it so the slot is reserved, and complete it when it happens.

Selling · a play in 4 steps.

The steps

  1. Add the bookable resource at a location. — createSchedulableResource
  2. Take the request — no capacity is held yet. — createAppointment
  3. Confirm it — the capacity check runs and the slot is reserved. — confirmAppointment
  4. Complete it — immutable history; the slot frees. — completeAppointment

The calls

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

createSchedulableResource

createSchedulableResource — mutation · Add a bookable resource — a staff member, station or chair/equipment appointments book against, at one location.

Example request

mutation ExampleCreateSchedulableResource($input: NewSchedulableResourceInput!) {
  createSchedulableResource(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    resourceType
    userId
    capacity
    code
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans",
    "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
    "resourceType": "staff"
  }
}

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

Example response

{
  "data": {
    "createSchedulableResource": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "SR-EXMP-0000-000F",
      "type": "SchedulableResource",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "resourceType": "staff",
      "userId": "01900000-0000-7000-8000-11f967df0000",
      "capacity": 1,
      "code": "BJ-001"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

createAppointment

createAppointment — mutation · Request an appointment — a service booking (names the service product) or an order pickup (names the order), against one or more resources at a location.

Example request

mutation ExampleCreateAppointment($input: NewAppointmentInput!) {
  createAppointment(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationId
    purpose
    variantId
    orderId
    resourceIds
    startAt
    durationMinutes
    noShowAt
    successorAppointmentId
    predecessorAppointmentId
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans",
    "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
    "purpose": "service",
    "resourceIds": [
      "01900000-0000-7000-8000-0fbb2cf90000"
    ],
    "startAt": "2027-01-31T00:00:00.000Z",
    "durationMinutes": 1
  }
}

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

Example response

{
  "data": {
    "createAppointment": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "AP-EXMP-0000-000F",
      "type": "Appointment",
      "caption": "Blue jeans",
      "status": "requested",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "organizationId": "01900000-0000-7000-8000-44b781470000",
      "purpose": "service",
      "variantId": "01900000-0000-7000-8000-8415e73b0000",
      "orderId": "01900000-0000-7000-8000-f6d8263a0000",
      "resourceIds": [
        "01900000-0000-7000-8000-0fbb2cf90000"
      ],
      "startAt": "2027-01-31T00:00:00.000Z",
      "durationMinutes": 1,
      "noShowAt": "2027-01-31T00:00:00.000Z",
      "successorAppointmentId": "01900000-0000-7000-8000-66ae038f0000",
      "predecessorAppointmentId": "01900000-0000-7000-8000-c8b7f8160000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

confirmAppointment

confirmAppointment — mutation · Confirm a requested appointment — the capacity check runs and the slot is reserved on every booked resource.

Example request

mutation ExampleConfirmAppointment($id: ID!, $revision: ID!, $reason: String) {
  confirmAppointment(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationId
    purpose
    variantId
    orderId
    resourceIds
    startAt
    durationMinutes
    noShowAt
    successorAppointmentId
    predecessorAppointmentId
  }
}

Variables:

{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}

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

Example response

{
  "data": {
    "confirmAppointment": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "AP-EXMP-0000-000F",
      "type": "Appointment",
      "caption": "Blue jeans",
      "status": "requested",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "organizationId": "01900000-0000-7000-8000-44b781470000",
      "purpose": "service",
      "variantId": "01900000-0000-7000-8000-8415e73b0000",
      "orderId": "01900000-0000-7000-8000-f6d8263a0000",
      "resourceIds": [
        "01900000-0000-7000-8000-0fbb2cf90000"
      ],
      "startAt": "2027-01-31T00:00:00.000Z",
      "durationMinutes": 1,
      "noShowAt": "2027-01-31T00:00:00.000Z",
      "successorAppointmentId": "01900000-0000-7000-8000-66ae038f0000",
      "predecessorAppointmentId": "01900000-0000-7000-8000-c8b7f8160000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

completeAppointment

completeAppointment — mutation · Complete an in-progress appointment — optionally linking the billing order at the last legal moment.

Example request

mutation ExampleCompleteAppointment($input: CompleteAppointmentInput!) {
  completeAppointment(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationId
    purpose
    variantId
    orderId
    resourceIds
    startAt
    durationMinutes
    noShowAt
    successorAppointmentId
    predecessorAppointmentId
  }
}

Variables:

{
  "input": {
    "appointmentId": "01900000-0000-7000-8000-d4398f970000",
    "expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
    "orderId": "01900000-0000-7000-8000-f6d8263a0000"
  }
}

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

Example response

{
  "data": {
    "completeAppointment": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "AP-EXMP-0000-000F",
      "type": "Appointment",
      "caption": "Blue jeans",
      "status": "requested",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "organizationId": "01900000-0000-7000-8000-44b781470000",
      "purpose": "service",
      "variantId": "01900000-0000-7000-8000-8415e73b0000",
      "orderId": "01900000-0000-7000-8000-f6d8263a0000",
      "resourceIds": [
        "01900000-0000-7000-8000-0fbb2cf90000"
      ],
      "startAt": "2027-01-31T00:00:00.000Z",
      "durationMinutes": 1,
      "noShowAt": "2027-01-31T00:00:00.000Z",
      "successorAppointmentId": "01900000-0000-7000-8000-66ae038f0000",
      "predecessorAppointmentId": "01900000-0000-7000-8000-c8b7f8160000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}