Skip to main content

Create a product association

Important

The GraphQL API for Product Associations is currently in Preview status for customers on the AWS-US cluster. For more information, see GraphQL API policy.

Use the createProductEditionAssociations mutation to create a new product association between a specific edition of a product, and one or more editions of different products that must also be purchased at the same time. This mutation creates a ProductEditionAssociation object for the product edition, listing all the products it requires.

The products linked by a ProductEditionAssociation must already be published on the marketplace. You cannot include products that are under development in the staging catalog.

Each product edition can have a only one ProductEditionAssociation at a time, and that ProductEditionAssociation cannot be modified. If you need to add or remove products from the list of requirements, you must delete the existing ProductEditionAssociation for the edition, and create a new one that includes the new list of requirements.

To use the API, you must be able to supply the product ID and edition ID for each edition involved in the product association. You must include the IDs for the product edition being linked (the "parent"), and for each of the product editions being listed among its requirements.

Mutation

mutation createProductEditionAssociations($input: CreateProductEditionAssociationsInput!) {
createProductEditionAssociations(input: $input) {
associations {
id
productEdition {
code
id
product {
addon
allowMultiplePurchases
editions
}
}
requiresAllOf {
id
requiresAnyOf {
code
id
product {
addon
allowMultiplePurchases
editions
}
}
}
}
productEdition {
code
id
product {
addon
allowMultiplePurchases
editions
}
}
userErrors
}
}

Variables

{
"input": {
"productEdition": {
"productEditionId": "4a25fd5b-08b7-43c3-b92a-05e417bf8f97",
"productId": "a37ef09b-0bd5-4c2b-a69e-dca471c5e88a"
},
"requiresAnyOf": [{
"productEditionId": "28669807-c2dc-4560-b747-f335b3d09767",
"productId": "d77d00e7-58f2-4bff-8cf4-fda99c15e8fe"
}]
}
}

Was this page helpful?