# How to create Ordered Products on an existing subscription

**URL:** <https://devcommunity.firmhouse.com/t/how-to-create-ordered-products-on-an-existing-subscription/27>\
**Category:** Integration and Automation\
**Created:** [March 24, 2023, 6:32am UTC](https://devcommunity.firmhouse.com/t/how-to-create-ordered-products-on-an-existing-subscription/27 "2023-03-24T06:32:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeroen](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@jeroen](https://devcommunity.firmhouse.com/u/jeroen)\
**Post date:** [March 24, 2023, 6:32am UTC](https://devcommunity.firmhouse.com/t/how-to-create-ordered-products-on-an-existing-subscription/27/1 "2023-03-24T06:32:21Z")

</div>

Set the `X-Project-Access-Token` in the headers and POST the query to the API.

```auto
# 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](https://developer.firmhouse.com/graphql/mutations/createOrderedProduct)
