Create Service Group API

Create new service groups with pricing tiers, discounts, and geolocation configurations

Group Management

Create Service Group API

Define service groups that organize subscription plans. Configure pricing tiers, multi-duration discounts, gateway assignments, and geolocation restrictions.

Service Organization

Group related subscription plans together.

Discount Tiers

Configure duration-based discount percentages.

Geo Controls

Restrict or allow specific geographic regions.


Endpoint Overview

MUTATION/graphql

Create a new service group with customizable attributes including name, description, language, discount tiers for various subscription durations, and geolocation restrictions.

Authentication:Bearer Token
Required scopes:admin

Request Parameters

nameString!Required

The name of the service group (e.g., "Premium Plans", "Business Tier").

descriptionString

A detailed description of the service group.

languageString

Language code for the service group content (e.g., "en", "fa").

discountFloat

Base discount percentage for monthly plans.

discount3Float

Discount percentage for 3-month subscriptions.

discount6Float

Discount percentage for 6-month subscriptions.

discount12Float

Discount percentage for annual subscriptions.

discount24Float

Discount percentage for 2-year subscriptions.

discount36Float

Discount percentage for 3-year subscriptions.

discountLifetimeFloat

Discount percentage for lifetime subscriptions.

gateways[Int]

Array of gateway IDs available for this service group.

allowedGeolocations[Int]

Array of geolocation IDs where this service group is available.

disAllowedGeolocations[Int]

Array of geolocation IDs where this service group is blocked.


GraphQL Mutation

mutation createServiceGroup($serviceGroup: ServiceGroupEdit!) {
  createServiceGroup(serviceGroup: $serviceGroup) {
    id
    name
    description
    language
    discount
    discount3
    discount6
    discount12
    discount24
    discount36
    discountLifetime
  }
}

Variables:

{
  "serviceGroup": {
    "name": "Premium Plans",
    "description": "Premium VPN service with priority support",
    "language": "en",
    "discount": 0,
    "discount3": 10,
    "discount6": 20,
    "discount12": 30,
    "discount24": 40,
    "discount36": 50,
    "discountLifetime": 60,
    "gateways": [1, 2, 3],
    "allowedGeolocations": [1, 2, 3, 4, 5]
  }
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -d '{
    "query": "mutation createServiceGroup($serviceGroup: ServiceGroupEdit!) { createServiceGroup(serviceGroup: $serviceGroup) { id name description discount12 } }",
    "variables": {
      "serviceGroup": {
        "name": "Premium Plans",
        "description": "Premium VPN service",
        "discount12": 30
      }
    }
  }'

Response

200Service Group Created Successfully
{
  "data": {
    "createServiceGroup": {
      "id": "5",
      "name": "Premium Plans",
      "description": "Premium VPN service with priority support",
      "language": "en",
      "discount": 0,
      "discount3": 10,
      "discount6": 20,
      "discount12": 30,
      "discount24": 40,
      "discount36": 50,
      "discountLifetime": 60
    }
  }
}
400Name Already Exists
{
  "errors": [
    {
      "message": "A service group with this name already exists",
      "path": ["createServiceGroup"],
      "extensions": {
        "code": "DUPLICATE_NAME"
      }
    }
  ],
  "data": null
}

Discount Tier Example

Monthly: 0%

No discount on monthly plans - full price.

3 Months: 10%

Small discount for quarterly commitment.

6 Months: 20%

Better savings for half-year plans.

Annual: 30%

Significant savings for yearly commitment.


Best Practices

Progressive Discounts

Increase discount percentages with longer subscription durations.

Clear Naming

Use descriptive names that help users understand the tier.

Geo Restrictions

Carefully configure geographic restrictions based on licensing.

Gateway Planning

Assign appropriate gateways based on service tier quality.



Service Group Hierarchy

Service Groups contain multiple Groups (subscription plans). Create the service group first, then add individual groups within it using the Create Group API.

Add Subscription Plans

After creating a service group, add individual subscription groups (plans) within it.

Create Group API