Skip to content

ProgramMembership

A ProgramMembership is one member's membership of a program: a gym, a club, a subscription with a member card. It names the member (Person or Organization), who runs it (hostingOrganization, an Organization or a local business Place), the MemberProgram and tier, the membershipNumber, the points earned and since and until when it is valid. A Reservation made with it names it in programMembershipUsed. A private record: it has no JSON-LD document.

Modeled on schema.org/ProgramMembership · JSON Schema · ABAC object type ProgramMembership

Example

Create one with POST /programmemberships:

{
  "member": {
    "at_id": "https://apis.objectsgrid.com/persons/8e9f0a1b-2c3d-4e5f-8a6b-7c8d9e0f1a2b"
  },
  "hostingOrganization": {
    "at_id": "https://apis.objectsgrid.com/places/4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a"
  },
  "membershipNumber": "G-0042",
  "validFrom": "2027-01-01T00:00:00+01:00",
  "validThrough": "2027-12-31T23:59:59+01:00"
}

Fields

Required: member.

Field Type Required Description
at_context https://schema.org JSON-LD @context, always https://schema.org.
at_type ProgramMembership JSON-LD @type, the object's type name.
at_id URL The object's ObjectsGrid URL, https://apis.objectsgrid.com/<path>/<id>, its JSON-LD @id: what References to it hold. Assigned by ObjectsGrid.
id string The object's id. Assigned by ObjectsGrid when the object is created.
identifier string The object's id, as Schema.org identifier. Assigned by ObjectsGrid.
url URL The object's own URL, https://apis.objectsgrid.com/<path>/<id>. Assigned by ObjectsGrid.
member Reference to Person or Organization Yes The member: a Person or Organization
hostingOrganization Reference to Organization or Place Who runs the program: an Organization, or a local business (Place)
program Reference to MemberProgram The program, when it is a MemberProgram
programName list of LanguageTaggedString The program's name, when it has no MemberProgram
memberTier Reference to MemberProgramTier The member's tier. ObjectsGrid's own field.
membershipNumber string The member's number, e.g. on the member card
membershipPointsEarned number The points the member has earned
validFrom date-time When the membership starts. ObjectsGrid's own field.
validThrough date-time When the membership ends. ObjectsGrid's own field.
tags list of Tag Tags your ABAC policy decides on. Created empty when not sent, kept by a PUT that leaves them out, cleared by null or [].
meta ObjectMeta Read-only metadata: version, type, creation and last update.
checkIns computed: list of CheckInAction Its check-ins. Computed, read-only: the objects whose CheckInAction.object points to this object, listed from that type; never stored or written. ObjectsGrid's, beyond Schema.org: attendance as a list; left out of JSON-LD documents.

REST API

Base URL https://apis.objectsgrid.com. Every request sends the X-ObjectsGrid-AccessPoint and Authorization: Bearer <access token> headers; see the REST API guide.

Operation Request
Create POST /programmemberships
List and search GET /programmemberships
Create up to 100 at once POST /programmemberships/batch
Retrieve GET /programmemberships/{id}
Replace PUT /programmemberships/{id}
Update some fields PATCH /programmemberships/{id}
Delete DELETE /programmemberships/{id}

ProgramMembership objects have no JSON-LD document: asked for one (Accept: application/ld+json), GET answers 406.

The OpenAPI contract, with every parameter and response: ProgramMemberships (JSON).

GraphQL

Endpoint POST https://apis.objectsgrid.com/graphql; see the GraphQL guide.

Operation Field
Query programMembership(id: ID!, version: String): ProgramMembership
Query programMemberships(where: ProgramMembershipWhereInput, orderBy: [ProgramMembershipOrderByInput!], first: Int, after: String): ProgramMembershipConnection!
Query programMembershipsGroupBy(by: [ProgramMembershipGroupByField!]!, where: ProgramMembershipWhereInput, having: ProgramMembershipHavingInput, orderBy: [ProgramMembershipGroupByOrderByInput!], first: Int, after: String): ProgramMembershipGroupByConnection!
Mutation createProgramMembership(input: CreateProgramMembershipInput!): ProgramMembership!
Mutation updateProgramMembership(input: UpdateProgramMembershipInput!, expectedVersion: String): ProgramMembership!
Mutation deleteProgramMembership(id: ID!, expectedVersion: String): Boolean!

Webhook events

Subscribe to these events in your webhook configuration to be called when a ProgramMembership changes:

ProgramMembershipCreated, ProgramMembershipUpdated, ProgramMembershipPatched, ProgramMembershipDeleted.