Marketplace app discounts

Marketplace developers can grant app subscription discounts to attract and retain users. These can be managed, created, and deleted through both the Developer Center and the platform API.

Queries

You can use the marketplace_app_discounts query to retrieve an app's marketplace discount data via the API.

  • Only works for app collaborators
  • Returns an array containing metadata about a specific app discount
  • Can only be queried directly at the root; can't be nested within another query
query {
  marketplace_app_discounts(app_id: 123456) {
    account_slug
    discount
    valid_until  	
  }
}
import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });

const query = "query ($appId: ID!) { marketplace_app_discounts (app_id: $appId) { account_slug discount valid_until  	} }"
const variables = {
  appId: 123456
};

Arguments

You can use the following argument to reduce the number of results returned in your marketplace_app_discounts query.

ArgumentDescription
app_id ID!The app's unique identifier.

Fields

You can use the following fields to specify what information your marketplace_app_discounts query will return.

Field

Description

Enum Values

account_id ID!

The account's unique identifier.

account_slug String!

The account's slug.

app_plan_ids [String!]!

The app plan IDs.

created_at String!

The discount's creation date.

discount Int!

The discount's percentage.

is_recurring Boolean!

Whether the discount is recurring.

period DiscountPeriod

The discount's period. If it returns null, the discount applies to both yearly and monthly plans.

MONTHLY
YEARLY

valid_until String!

The date the discount is valid until.

Mutations

The API allows you to grant and delete discounts using the following mutations.

Grant marketplace app discount

The grant_marketplace_app_discount mutation grants a discount for a new marketplace app subscription via the API. You can specify which fields to return in the mutation response.

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
    }
  }
}
import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });

const query = "mutation ($slug: String!, $appId: ID!, $appPlanIds: [String!]!, $days: Int!, $discountPercent: Int!, $recurring: Boolean!, $period: DiscountPeriod) { grant_marketplace_app_discount ( account_slug: $slug, app_id: $appId, data: {app_plan_ids: $appPlanIds, days_valid: $days, discount: $discountPercent, is_recurring: $recurring, period: $period }) { granted_discount { app_id period discount } } }"
const variables = {
  appId: 123456,
  slug: "my-team-monday",
  appPlanIds: ["Basic"], 
  days: 30, 
  discountPercent: 10, 
  recurring: false, 
  period: "MONTHLY" 
};
const response = await mondayApiClient.request(query, variables);

Arguments

You can use the following arguments to specify which discount to grant.

Argument

Description

Supported Fields

account_slug String!

The account's slug.

app_id ID!

The app's unique identifier.

data GrantMarketplaceAppDiscountData!

The discount's details.

app_plan_ids [String!]!
days_valid Int!
discount Int!
is_recurring Boolean!
period DiscountPeriod

Delete marketplace app discount

The delete_marketplace_app_discount mutation deletes an existing discount for a marketplace app subscription via the API. You can specify which fields to return in the mutation response.

mutation {
  delete_marketplace_app_discount(
    account_slug: "Test", 
    app_id: 123456
  ) {
    deleted_discount {
      account_slug
      app_id
    }
  }
}
import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });

const query =
  "mutation ($slug: String!, $appId: ID!) { delete_marketplace_app_discount ( account_slug: $slug, app_id: $appId ) { deleted_discount { account_slug app_id } } }";
const variables = {
  appId: 123456,
  slug: "my-team-monday",
};
const response = await mondayApiClient.request(query, variables);

Arguments

You can use the following arguments to specify which discount to delete.

ArgumentDescription
account_slug String!The account's slug.
app_id ID!The app's unique identifier.