> This page is for API Reference.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fiftytwo-demo.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fiftytwo-demo.ferndocs.com/_mcp/server.

# Insert/update list of sales groups for specific store

POST https://api.fiftytwo.com/masterdata/salesgroups/v1/chain/{chain}/store/{store}
Content-Type: application/json

Not supported when master data is distributed by the 52ViKING enterprise service.

Reference: https://fiftytwo-demo.ferndocs.com/api/master-data/reference/sales-groups/insert-update-list-of-sales-groups-for-specific-store

## Request

### Path parameters

- `chain` (integer, required) — The ID of the chain
- `store` (integer, required) — The ID of the store

### Body (application/json)

This endpoint expects a salesGroups.

- `salesGroups` (list of SalesGroupsSalesGroupsItems, required)

## Response

### 202

Accepted

## Errors

### 400 Bad Request Error

Bad Request

- `string`

## Types

### SalesGroupsSalesGroupsItems

- `salesGroupId` (integer, required) — The ID of the sales group.
- `description` (string, optional) — A description of the sales group.
- `maximumQuantity` (integer, optional) — The maximum quantity of articles in this sales group that can be sold in one purchase.
- `textReference` (integer, optional) — A reference to a text segment that will be shown to shop assistants if maximumQuantity is exceeded. Text segments are maintained internally. Ask your Fiftytwo consultant if you're in doubt.

## Examples

**Request**

```json
{
  "salesGroups": [
    {
      "salesGroupId": 10,
      "description": "Salesgroup 10",
      "maximumQuantity": 10,
      "textReference": 1234
    },
    {
      "salesGroupId": 11,
      "description": "Salesgroup 11",
      "maximumQuantity": 11,
      "textReference": 4321
    }
  ]
}
```

**Response**

```json
{}
```

**SDK Code**

```python SalesGroups_insertUpdateListOfSalesGroupsForSpecificStore_example
import requests

url = "https://api.fiftytwo.com/masterdata/salesgroups/v1/chain/1/store/1"

payload = { "salesGroups": [
        {
            "salesGroupId": 10,
            "description": "Salesgroup 10",
            "maximumQuantity": 10,
            "textReference": 1234
        },
        {
            "salesGroupId": 11,
            "description": "Salesgroup 11",
            "maximumQuantity": 11,
            "textReference": 4321
        }
    ] }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript SalesGroups_insertUpdateListOfSalesGroupsForSpecificStore_example
const url = 'https://api.fiftytwo.com/masterdata/salesgroups/v1/chain/1/store/1';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"salesGroups":[{"salesGroupId":10,"description":"Salesgroup 10","maximumQuantity":10,"textReference":1234},{"salesGroupId":11,"description":"Salesgroup 11","maximumQuantity":11,"textReference":4321}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go SalesGroups_insertUpdateListOfSalesGroupsForSpecificStore_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fiftytwo.com/masterdata/salesgroups/v1/chain/1/store/1"

	payload := strings.NewReader("{\n  \"salesGroups\": [\n    {\n      \"salesGroupId\": 10,\n      \"description\": \"Salesgroup 10\",\n      \"maximumQuantity\": 10,\n      \"textReference\": 1234\n    },\n    {\n      \"salesGroupId\": 11,\n      \"description\": \"Salesgroup 11\",\n      \"maximumQuantity\": 11,\n      \"textReference\": 4321\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby SalesGroups_insertUpdateListOfSalesGroupsForSpecificStore_example
require 'uri'
require 'net/http'

url = URI("https://api.fiftytwo.com/masterdata/salesgroups/v1/chain/1/store/1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"salesGroups\": [\n    {\n      \"salesGroupId\": 10,\n      \"description\": \"Salesgroup 10\",\n      \"maximumQuantity\": 10,\n      \"textReference\": 1234\n    },\n    {\n      \"salesGroupId\": 11,\n      \"description\": \"Salesgroup 11\",\n      \"maximumQuantity\": 11,\n      \"textReference\": 4321\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java SalesGroups_insertUpdateListOfSalesGroupsForSpecificStore_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.fiftytwo.com/masterdata/salesgroups/v1/chain/1/store/1")
  .header("Content-Type", "application/json")
  .body("{\n  \"salesGroups\": [\n    {\n      \"salesGroupId\": 10,\n      \"description\": \"Salesgroup 10\",\n      \"maximumQuantity\": 10,\n      \"textReference\": 1234\n    },\n    {\n      \"salesGroupId\": 11,\n      \"description\": \"Salesgroup 11\",\n      \"maximumQuantity\": 11,\n      \"textReference\": 4321\n    }\n  ]\n}")
  .asString();
```

```php SalesGroups_insertUpdateListOfSalesGroupsForSpecificStore_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.fiftytwo.com/masterdata/salesgroups/v1/chain/1/store/1', [
  'body' => '{
  "salesGroups": [
    {
      "salesGroupId": 10,
      "description": "Salesgroup 10",
      "maximumQuantity": 10,
      "textReference": 1234
    },
    {
      "salesGroupId": 11,
      "description": "Salesgroup 11",
      "maximumQuantity": 11,
      "textReference": 4321
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp SalesGroups_insertUpdateListOfSalesGroupsForSpecificStore_example
using RestSharp;

var client = new RestClient("https://api.fiftytwo.com/masterdata/salesgroups/v1/chain/1/store/1");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"salesGroups\": [\n    {\n      \"salesGroupId\": 10,\n      \"description\": \"Salesgroup 10\",\n      \"maximumQuantity\": 10,\n      \"textReference\": 1234\n    },\n    {\n      \"salesGroupId\": 11,\n      \"description\": \"Salesgroup 11\",\n      \"maximumQuantity\": 11,\n      \"textReference\": 4321\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift SalesGroups_insertUpdateListOfSalesGroupsForSpecificStore_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["salesGroups": [
    [
      "salesGroupId": 10,
      "description": "Salesgroup 10",
      "maximumQuantity": 10,
      "textReference": 1234
    ],
    [
      "salesGroupId": 11,
      "description": "Salesgroup 11",
      "maximumQuantity": 11,
      "textReference": 4321
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fiftytwo.com/masterdata/salesgroups/v1/chain/1/store/1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```