> 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 a list of SalesPersons on the EC.

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

Only supported when Masterdata is distributed by the EC.

Reference: https://fiftytwo-demo.ferndocs.com/api/master-data/reference/sales-persons/ecstg

## Request

### Path parameters

- `chain` (integer, required) — The Id of the Chain

### Body (application/json)

This endpoint expects a salesPersons.

- `salesPersons` (list of SalesPersonsSalesPersonsItems, required)

## Response

### 202

Accepted

## Errors

### 400 Bad Request Error

Bad Request

- `string`

## Types

### SalesPersonsSalesPersonsItems

- `salesPersonId` (integer, required) — The unique number that will identify the salesperson. The number is a key field that you can't edit later.
- `name` (string, optional) — The name of the sales person.
- `barcode` (integer, optional) — The number of the barcode on the salesperson's ID card.
- `category` (string, optional) — The category determines the salesperson's user rights and consequently which features they're able to use. Categories are defined in cooperation with Fiftywo consultants.
- `allowedTillIds` (list of integer, optional) — Indicate the specific till ids at which the salesperson is authorized and expected to operate during their shift.
- `salesTarget` (integer, optional) — The sales target allocated to the salesperson on a monthly basis
- `initials` (string, optional) — The Salesperson initials.
- `stores` (list of integer, optional) — List of store IDs associated with the salesperson.

## Examples

**Request**

```json
{
  "salesPersons": [
    {
      "salesPersonId": 12345,
      "name": "John Doe",
      "barcode": 1234567890123,
      "category": "A",
      "allowedTillIds": [
        1,
        2,
        3
      ],
      "salesTarget": 50000,
      "initials": "JD",
      "stores": [
        1111,
        2111,
        3111,
        4111
      ]
    },
    {
      "salesPersonId": 67890,
      "name": "Jane Smith",
      "barcode": 9876543210123,
      "category": "B",
      "allowedTillIds": [
        4,
        5
      ],
      "salesTarget": 75000,
      "initials": "JS",
      "stores": [
        4411,
        2431,
        4111
      ]
    }
  ]
}
```

**Response**

```json
{}
```

**SDK Code**

```python SalesPersons_ECSTG_example
import requests

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

payload = { "salesPersons": [
        {
            "salesPersonId": 12345,
            "name": "John Doe",
            "barcode": 1234567890123,
            "category": "A",
            "allowedTillIds": [1, 2, 3],
            "salesTarget": 50000,
            "initials": "JD",
            "stores": [1111, 2111, 3111, 4111]
        },
        {
            "salesPersonId": 67890,
            "name": "Jane Smith",
            "barcode": 9876543210123,
            "category": "B",
            "allowedTillIds": [4, 5],
            "salesTarget": 75000,
            "initials": "JS",
            "stores": [4411, 2431, 4111]
        }
    ] }
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript SalesPersons_ECSTG_example
const url = 'https://api.fiftytwo.com/masterdata/salespersons/v1/chain/1';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"salesPersons":[{"salesPersonId":12345,"name":"John Doe","barcode":1234567890123,"category":"A","allowedTillIds":[1,2,3],"salesTarget":50000,"initials":"JD","stores":[1111,2111,3111,4111]},{"salesPersonId":67890,"name":"Jane Smith","barcode":9876543210123,"category":"B","allowedTillIds":[4,5],"salesTarget":75000,"initials":"JS","stores":[4411,2431,4111]}]}'
};

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

```go SalesPersons_ECSTG_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"salesPersons\": [\n    {\n      \"salesPersonId\": 12345,\n      \"name\": \"John Doe\",\n      \"barcode\": 1234567890123,\n      \"category\": \"A\",\n      \"allowedTillIds\": [\n        1,\n        2,\n        3\n      ],\n      \"salesTarget\": 50000,\n      \"initials\": \"JD\",\n      \"stores\": [\n        1111,\n        2111,\n        3111,\n        4111\n      ]\n    },\n    {\n      \"salesPersonId\": 67890,\n      \"name\": \"Jane Smith\",\n      \"barcode\": 9876543210123,\n      \"category\": \"B\",\n      \"allowedTillIds\": [\n        4,\n        5\n      ],\n      \"salesTarget\": 75000,\n      \"initials\": \"JS\",\n      \"stores\": [\n        4411,\n        2431,\n        4111\n      ]\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 SalesPersons_ECSTG_example
require 'uri'
require 'net/http'

url = URI("https://api.fiftytwo.com/masterdata/salespersons/v1/chain/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  \"salesPersons\": [\n    {\n      \"salesPersonId\": 12345,\n      \"name\": \"John Doe\",\n      \"barcode\": 1234567890123,\n      \"category\": \"A\",\n      \"allowedTillIds\": [\n        1,\n        2,\n        3\n      ],\n      \"salesTarget\": 50000,\n      \"initials\": \"JD\",\n      \"stores\": [\n        1111,\n        2111,\n        3111,\n        4111\n      ]\n    },\n    {\n      \"salesPersonId\": 67890,\n      \"name\": \"Jane Smith\",\n      \"barcode\": 9876543210123,\n      \"category\": \"B\",\n      \"allowedTillIds\": [\n        4,\n        5\n      ],\n      \"salesTarget\": 75000,\n      \"initials\": \"JS\",\n      \"stores\": [\n        4411,\n        2431,\n        4111\n      ]\n    }\n  ]\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.fiftytwo.com/masterdata/salespersons/v1/chain/1")
  .header("Content-Type", "application/json")
  .body("{\n  \"salesPersons\": [\n    {\n      \"salesPersonId\": 12345,\n      \"name\": \"John Doe\",\n      \"barcode\": 1234567890123,\n      \"category\": \"A\",\n      \"allowedTillIds\": [\n        1,\n        2,\n        3\n      ],\n      \"salesTarget\": 50000,\n      \"initials\": \"JD\",\n      \"stores\": [\n        1111,\n        2111,\n        3111,\n        4111\n      ]\n    },\n    {\n      \"salesPersonId\": 67890,\n      \"name\": \"Jane Smith\",\n      \"barcode\": 9876543210123,\n      \"category\": \"B\",\n      \"allowedTillIds\": [\n        4,\n        5\n      ],\n      \"salesTarget\": 75000,\n      \"initials\": \"JS\",\n      \"stores\": [\n        4411,\n        2431,\n        4111\n      ]\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.fiftytwo.com/masterdata/salespersons/v1/chain/1', [
  'body' => '{
  "salesPersons": [
    {
      "salesPersonId": 12345,
      "name": "John Doe",
      "barcode": 1234567890123,
      "category": "A",
      "allowedTillIds": [
        1,
        2,
        3
      ],
      "salesTarget": 50000,
      "initials": "JD",
      "stores": [
        1111,
        2111,
        3111,
        4111
      ]
    },
    {
      "salesPersonId": 67890,
      "name": "Jane Smith",
      "barcode": 9876543210123,
      "category": "B",
      "allowedTillIds": [
        4,
        5
      ],
      "salesTarget": 75000,
      "initials": "JS",
      "stores": [
        4411,
        2431,
        4111
      ]
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp SalesPersons_ECSTG_example
using RestSharp;

var client = new RestClient("https://api.fiftytwo.com/masterdata/salespersons/v1/chain/1");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"salesPersons\": [\n    {\n      \"salesPersonId\": 12345,\n      \"name\": \"John Doe\",\n      \"barcode\": 1234567890123,\n      \"category\": \"A\",\n      \"allowedTillIds\": [\n        1,\n        2,\n        3\n      ],\n      \"salesTarget\": 50000,\n      \"initials\": \"JD\",\n      \"stores\": [\n        1111,\n        2111,\n        3111,\n        4111\n      ]\n    },\n    {\n      \"salesPersonId\": 67890,\n      \"name\": \"Jane Smith\",\n      \"barcode\": 9876543210123,\n      \"category\": \"B\",\n      \"allowedTillIds\": [\n        4,\n        5\n      ],\n      \"salesTarget\": 75000,\n      \"initials\": \"JS\",\n      \"stores\": [\n        4411,\n        2431,\n        4111\n      ]\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift SalesPersons_ECSTG_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["salesPersons": [
    [
      "salesPersonId": 12345,
      "name": "John Doe",
      "barcode": 1234567890123,
      "category": "A",
      "allowedTillIds": [1, 2, 3],
      "salesTarget": 50000,
      "initials": "JD",
      "stores": [1111, 2111, 3111, 4111]
    ],
    [
      "salesPersonId": 67890,
      "name": "Jane Smith",
      "barcode": 9876543210123,
      "category": "B",
      "allowedTillIds": [4, 5],
      "salesTarget": 75000,
      "initials": "JS",
      "stores": [4411, 2431, 4111]
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fiftytwo.com/masterdata/salespersons/v1/chain/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()
```