New mutations to grant and delete discounts
July 1st, 2024
In API version 2024-10
, we added two new mutations to enable marketplace app developers to grant and delete discounts through the platform API.
Grant discounts
Using the grant_marketplace_app_discount
mutation, you can give discounts through the API.
mutation {
grant_marketplace_app_discount (
input: {
account_slug: "Test",
app_plan_ids: ["Basic"],
app_id: 123456,
days_valid: 30,
discount: 10,
is_recurring: false,
period: MONTHLY
}) {
granted_discount {
account_slug
discount
}
}
}
Delete discounts
Using the delete_marketplace_app_discount
mutation, you can remove discounts through the API.
mutation {
delete_marketplace_app_discount (
input: {
account_slug: "Test",
app_id: 123456
}) {
deleted_discount {
account_slug
app_id
}
}
}