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.

In the office

Take the customer’s request for an alteration on the tailor’s calendar, confirm it so the slot is reserved, and complete it when it happens. The calendar’s resource — the tailor as a bookable person — is set up by the manager; the bookings on it are yours.

Where it starts: the office’s Schedulable resources page.

Schedulable resources — /schedulable-resources
Schedulable resources — /schedulable-resources

Step 1. Add the bookable resource at a location. Open Schedulable resources.

Step 2. Take the request — no capacity is held yet. Open Appointments.

Appointments — /appointments
Appointments — /appointments

Step 3. Confirm it — the capacity check runs and the slot is reserved.

Step 4. Complete it — immutable history; the slot frees.

What you see

The example shop is Linden & Vale; the resources page lists what can be booked — a person, a station, a chair — and the appointments page the bookings against them.

Try it

Walked with screenshots in the stylist’s manual: chapter 4 — Book an alteration with the tailor

For developers — the calls

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

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

Variables:

json
{
  "input": {
    "caption": "Blue jeans",
    "logicalFacilityId": "01900000-0000-7000-8000-10c08c590000",
    "resourceType": "staff"
  }
}

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

Example response

json
{
  "data": {
    "createSchedulableResource": {
      "id": "01900000-0000-7000-8000-6478b3a10000",
      "sysId": "SR-EXMP-0000-000F",
      "type": "SchedulableResource",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-10c08c590000",
      "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",
      "resourceType": "staff",
      "userId": "01900000-0000-7000-8000-e0a63e120000",
      "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

graphql
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:

json
{
  "input": {
    "caption": "Blue jeans",
    "logicalFacilityId": "01900000-0000-7000-8000-10c08c590000",
    "purpose": "service",
    "resourceIds": [
      "01900000-0000-7000-8000-23b0d8150000"
    ],
    "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

json
{
  "data": {
    "createAppointment": {
      "id": "01900000-0000-7000-8000-82f95dda0000",
      "sysId": "AP-EXMP-0000-000F",
      "type": "Appointment",
      "caption": "Blue jeans",
      "status": "requested",
      "parentId": "01900000-0000-7000-8000-10c08c590000",
      "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",
      "organizationId": "01900000-0000-7000-8000-1971e30a0000",
      "purpose": "service",
      "variantId": "01900000-0000-7000-8000-8433b0260000",
      "orderId": "01900000-0000-7000-8000-18e782370000",
      "resourceIds": [
        "01900000-0000-7000-8000-23b0d8150000"
      ],
      "startAt": "2027-01-31T00:00:00.000Z",
      "durationMinutes": 1,
      "noShowAt": "2027-01-31T00:00:00.000Z",
      "successorAppointmentId": "01900000-0000-7000-8000-4fe044820000",
      "predecessorAppointmentId": "01900000-0000-7000-8000-8821035b0000"
    }
  },
  "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

graphql
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:

json
{
  "id": "01900000-0000-7000-8000-82f95dda0000",
  "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

json
{
  "data": {
    "confirmAppointment": {
      "id": "01900000-0000-7000-8000-82f95dda0000",
      "sysId": "AP-EXMP-0000-000F",
      "type": "Appointment",
      "caption": "Blue jeans",
      "status": "confirmed",
      "parentId": "01900000-0000-7000-8000-10c08c590000",
      "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",
      "purpose": "service",
      "variantId": "01900000-0000-7000-8000-8433b0260000",
      "orderId": "01900000-0000-7000-8000-18e782370000",
      "resourceIds": [
        "01900000-0000-7000-8000-23b0d8150000"
      ],
      "startAt": "2027-01-31T00:00:00.000Z",
      "durationMinutes": 1,
      "noShowAt": "2027-01-31T00:00:00.000Z",
      "successorAppointmentId": "01900000-0000-7000-8000-4fe044820000",
      "predecessorAppointmentId": "01900000-0000-7000-8000-8821035b0000"
    }
  },
  "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

graphql
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:

json
{
  "input": {
    "appointmentId": "01900000-0000-7000-8000-82f95dda0000",
    "expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
    "orderId": "01900000-0000-7000-8000-18e782370000"
  }
}

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

Example response

json
{
  "data": {
    "completeAppointment": {
      "id": "01900000-0000-7000-8000-82f95dda0000",
      "sysId": "AP-EXMP-0000-000F",
      "type": "Appointment",
      "caption": "Blue jeans",
      "status": "completed",
      "parentId": "01900000-0000-7000-8000-10c08c590000",
      "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",
      "purpose": "service",
      "variantId": "01900000-0000-7000-8000-8433b0260000",
      "orderId": "01900000-0000-7000-8000-18e782370000",
      "resourceIds": [
        "01900000-0000-7000-8000-23b0d8150000"
      ],
      "startAt": "2027-01-31T00:00:00.000Z",
      "durationMinutes": 1,
      "noShowAt": "2027-01-31T00:00:00.000Z",
      "successorAppointmentId": "01900000-0000-7000-8000-4fe044820000",
      "predecessorAppointmentId": "01900000-0000-7000-8000-8821035b0000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}