Set the X-Project-Access-Token
in the headers and POST the query to the API.
# Subscription by input argument OR X-Subscription-Token in headers
mutation {
createOrderedProduct(
input: {
subscriptionId: 1234,
orderedProduct: {
productId: 555,
quantity: 1
}
}
) {
subscription {
monthlyAmountCents
token
orderedProducts {
id
product {
title
}
}
}
errors {
attribute
message
}
}
}
Since this is a mutation, it’s recommended to have the errors
returned in case something is off.
More information on the createOrderedProduct
mutation and the input paramaters can be found in the API documentation.
https://developer.firmhouse.com/graphql/mutations/createOrderedProduct