Перейти к основному содержимому

Edit Service Group API

POST /editServiceGroup

Description

This API endpoint allows users to edit and update an existing service group. The user can modify attributes such as the group's name, description, language, discount tiers, and geolocation restrictions.

Request Body

The request utilizes GraphQL to perform the editServiceGroup mutation.

Mutation:

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

Variables:

{
"id": 0,
"serviceGroup": {
"name": "<Service_Group_Name>",
"description": "<Service_Group_Description>",
"language": "<Language_Code>",
"discount": "<Base_Discount>",
"discount3": "<3_Month_Discount>",
"discount6": "<6_Month_Discount>",
"discount12": "<12_Month_Discount>",
"discount24": "<24_Month_Discount>",
"discount36": "<36_Month_Discount>",
"discountLifetime": "<Lifetime_Discount>",
"gateways": [0],
"allowedGeolocations": [0],
"disAllowedGeolocations": [0]
}
}
  • id (Int): The unique identifier of the service group that needs to be edited.
  • serviceGroup (ServiceGroupEdit Object): An object containing the updated service group details.
    • name (String): The new name for the service group.
    • description (String): The updated description for the service group.
    • language (String): The language code in which the service group is offered.
    • discount (String): The base discount applied to the service group.
    • discount3 (String): The discount applied for a 3-month subscription.
    • discount6 (String): The discount applied for a 6-month subscription.
    • discount12 (String): The discount applied for a 12-month subscription.
    • discount24 (String): The discount applied for a 24-month subscription.
    • discount36 (String): The discount applied for a 36-month subscription.
    • discountLifetime (String): The discount applied for a lifetime subscription.
    • gateways (Array): An array of gateway IDs associated with the service group.
    • allowedGeolocations (Array): An array of allowed geolocation IDs for the service group.
    • disAllowedGeolocations (Array): An array of disallowed geolocation IDs for the service group.

Response:

  • Success (200 OK):

    {
    "data": {
    "editServiceGroup": {
    "id": "<Service_Group_ID>",
    "name": "<Service_Group_Name>",
    "description": "<Service_Group_Description>",
    "language": "<Language_Code>",
    "discount": "<Base_Discount>",
    "discount3": "<3_Month_Discount>",
    "discount6": "<6_Month_Discount>",
    "discount12": "<12_Month_Discount>",
    "discount24": "<24_Month_Discount>",
    "discount36": "<36_Month_Discount>",
    "discountLifetime": "<Lifetime_Discount>"
    }
    }
    }
    • id (String): The unique identifier of the edited service group.
    • name (String): The name of the service group.
    • description (String): The description of the service group.
    • language (String): The language code in which the service group is offered.
    • discount (String): The base discount applied to the service group.
    • discount3 (String): The discount applied for a 3-month subscription.
    • discount6 (String): The discount applied for a 6-month subscription.
    • discount12 (String): The discount applied for a 12-month subscription.
    • discount24 (String): The discount applied for a 24-month subscription.
    • discount36 (String): The discount applied for a 36-month subscription.
    • discountLifetime (String): The discount applied for a lifetime subscription.
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid data, missing required fields, or server errors.

Note:

Ensure that the id corresponds to an existing service group that needs to be edited. All required fields should be provided and correctly formatted. The service group configuration should align with the platform's specifications, particularly in terms of geolocation restrictions and associated gateways.