Training Passes

Training Passes offer learners unlimited access to a selection of your training catalog for a pre-determined access period.

For an introduction about the feature and the possibilities it unlocks, see our Support Documentation.

Training Pass Types

In order to use Training Passes, a number of Training Pass Types have to be configured in the TMS, which can then be issued to specific Contacts.

Search

The following example fetches the first page of the published Training Pass Types, including their options, pricing and course content included with the Pass:

Example

query {
  trainingPassTypes(
    filters:[
      {field: lifecycleState, operation: eq, value: "published"}
    ]
  ){
    edges{
      node{
        id 
        name 
        lifecycleState
        content{
          edges{
            node{
              __typename
              ... on CourseTemplate{
                code
              }
              ... on LearningPath{
                name
              }
            }
          }
        }
        options{
          edges{
            node{
              name
              prices{
                edges{
                  node{
                    amount
                    financialUnit{
                      name
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

The response shows the pass type includes one Course and one Learning Path, and has a yearly option priced at USD 120.00:

{
  "data": {
    "trainingPassTypes": {
      "edges": [
        {
          "node": {
            "id": "VHJhaW5pbmdQYXNzVHlwZTox",
            "name": "Gold pass",
            "lifecycleState": "published",
            "content": {
              "edges": [
                {
                  "node": {
                    "__typename": "CourseTemplate",
                    "code": "ABC-123"
                  }
                },
                {
                  "node": {
                    "__typename": "LearningPath",
                    "name": "First Aid"
                  }
                }
              ]
            },
            "options": {
              "edges": [
                {
                  "node": {
                    "name": "Yearly",
                    "prices": {
                      "edges": [
                        {
                          "node": {
                            "amount": "120.00",
                            "financialUnit": {
                              "name": "U.S. Dollars"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      ]
    }
  }
}

Create

The following example creates a new Training Pass Type:

Example

mutation {
  trainingPass{
    createType(input:{
      code: "Silver"
      name: "Silver pass"
    }) {
      trainingPassType{
        id
        lifecycleState
      }
      errors{
        label
        message
        value
      }
    }
  }
}

The response returns the ID of the new pass type and its default draft lifecycle state:

{
  "data": {
    "trainingPass": {
      "createType": {
        "trainingPassType": {
          "id": "VHJhaW5pbmdQYXNzVHlwZToy",
          "lifecycleState": "draft"
        },
        "errors": []
      }
    }
  }
}

For the full range of available create parameters see the TrainingPassTypeInput API Reference.

Content

Courses and Learning Paths can be accessed via the pass type if they are added as pass type content:

Example

mutation {
  trainingPass{
    addContentToPassType(input:{
      trainingPassTypeId: "VHJhaW5pbmdQYXNzVHlwZToy"
      courseIds: ["Q291cnNlVGVtcGxhdGU6MTE="]
      pathIds: ["TGVhcm5pbmdQYXRoOjE="]
    }) {
      errors{
        label
        message
        value
      }
    }
  }
}

These can also be removed at a later date:

Example

mutation {
  trainingPass{
    removeContentFromPassType(input:{
      trainingPassTypeId: "VHJhaW5pbmdQYXNzVHlwZToy"
      courseIds: ["Q291cnNlVGVtcGxhdGU6MTE="]
      pathIds: ["TGVhcm5pbmdQYXRoOjE="]
    }) {
      errors{
        label
        message
        value
      }
    }
  }
}

Pass Options and Pricing

A Training Pass type can have a number of options which are associated with a certain price and specify a default validity period. The following creates a monthly option:

Example

mutation{
  trainingPass{
    createTypeOption(input:{
      trainingPassTypeId: "VHJhaW5pbmdQYXNzVHlwZToy"
      name: "Monthly"
      validityPeriod: {
        unit: months,
        value: 1
      }
    }) {
      trainingPassTypeOption{
        id 
        lifecycleState
      }
      errors {
        label 
        message
        value
      }
    }
  }
}

The response contains the ID of the new option and the default draft lifecycle state:

{
  "data": {
    "trainingPass": {
      "createTypeOption": {
        "trainingPassTypeOption": {
          "id": "VHJhaW5pbmdQYXNzVHlwZU9wdGlvbjoy",
          "lifecycleState": "draft"
        },
        "errors": []
      }
    }
  }
}

Once the option is created, you can define prices for it for each currency and region in your system. The following example creates a price of 99.90 USD in the specified region for the newly create option:

Example

mutation{
  trainingPass{
    createTypeOptionPrice(input:{
      trainingPassTypeOptionId: "VHJhaW5pbmdQYXNzVHlwZU9wdGlvbjoy"
      regionId: "UmVnaW9uOkRS"
      currencyCode: "USD"
      amount: "99.90"
    }) {
      trainingPassTypeOptionPrice{
        id 
      }
      errors {
        label 
        message
        value
      }
    }
  }
}

Once the option is configured with the desired prices, it can be published with

Example

mutation{
  trainingPass{
    updateTypeOption(input:{
      trainingPassTypeOptionId: "VHJhaW5pbmdQYXNzVHlwZU9wdGlvbjoy"
      lifecycleState: published
    }) {
      trainingPassTypeOption{
        id 
        lifecycleState
      }
      errors {
        label 
        message
        value
      }
    }
  }
}

Publish

Once the Training Pass Type is set up with the desired options and pricing, it can be published so it can be issued to Learners.

Example

mutation{
  trainingPass{
    updateType(input:{
      trainingPassTypeId: "VHJhaW5pbmdQYXNzVHlwZToy"
      lifecycleState: published
    }) {
      trainingPassType{
        id 
        lifecycleState
        options{
          edges{
            node{
              name
              prices{
                edges{
                  node{
                    financialUnit{
                      name
                    }
                    amount
                  }
                }
              }
            }
          }
        }
      }
      errors {
        label 
        message
        value
      }
    }
  }
}

The response confirms the new lifecycle state and the options and pricing previously configured:

{
  "data": {
    "trainingPass": {
      "updateType": {
        "trainingPassType": {
          "id": "VHJhaW5pbmdQYXNzVHlwZToy",
          "lifecycleState": "published",
          "options": {
            "edges": [
              {
                "node": {
                  "name": "Monthly",
                  "prices": {
                    "edges": [
                      {
                        "node": {
                          "financialUnit": {
                            "name": "U.S. Dollars"
                          },
                          "amount": "99.90"
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        },
        "errors": []
      }
    }
  }
}

Issuing passes

Once Training Pass Types are set up, these can be issued to Contacts:

Example

mutation {
  trainingPass{
    issuePass(input:{
      trainingPassTypeId: "VHJhaW5pbmdQYXNzVHlwZToy"
      trainingPassTypeOptionId: "VHJhaW5pbmdQYXNzVHlwZU9wdGlvbjoy"
      contactId: "UGVyc29uOjM1"
      validFrom: "2023-05-01T00:00:00Z"
      validUntil: "2023-06-01T00:00:00Z"
    }){
      trainingPass{
        id
        validFrom
        validUntil
      }
      errors{
        label
        message
        value
      }
    }
  }
}

Renewals

A specific Training Pass can be renewed:

Example

mutation {
  trainingPass{
    renewPass(input:{
      trainingPassId: "VHJhaW5pbmdQYXNzOjI="
      trainingPassTypeOptionId: "VHJhaW5pbmdQYXNzVHlwZU9wdGlvbjoy"
      validUntil: "2023-07-01T00:00:00Z"
    }){
      trainingPass{
        id
        validFrom
        validUntil
      }
      errors{
        label
        message
        value
      }
    }
  }
}

Revoke pass

A specific Training Pass can also be revoked:

Example

mutation {
  trainingPass{
    revokePass(input:{
      trainingPassId: "VHJhaW5pbmdQYXNzOjI="
    }){
      trainingPass{
        id
        lifecycleState
        validFrom
        validUntil
      }
      errors{
        label
        message
        value
      }
    }
  }
}

The response confirms the pass has been cancelled:

{
  "data": {
    "trainingPass": {
      "revokePass": {
        "trainingPass": {
          "id": "VHJhaW5pbmdQYXNzOjI=",
          "lifecycleState": "cancelled",
          "validFrom": "2023-05-01T00:00:00Z",
          "validUntil": "2023-07-01T00:00:00Z"
        },
        "errors": []
      }
    }
  }
}