added

New mutations to grant and delete discounts

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 (
      account_slug: "Test",  
      app_id: 123456,
    	data: {
    		app_plan_ids: ["Basic"],
      	days_valid: 30, 
      	discount: 10, 
      	is_recurring: false, 
      	period: MONTHLY
    }) {
    granted_discount {
        app_id
      	period
      	discount
    }
  }
}

Delete discounts

Using the delete_marketplace_app_discount mutation, you can remove discounts through the API.

mutation {
  delete_marketplace_app_discount (
    account_slug: "Test", 
    app_id: 123456
  ) {
    deleted_discount {
      account_slug
      app_id
    }
  }
}