curl -X POST 'https://foodsoul.pro/api/crm/v2/branches.add' \
-H 'Authorization: Bearer fs_api_YOUR_TOKEN' \
-H 'language: en' \
-H 'role: partner' \
-H 'Content-Type: application/json' \
-d '{"branch_id":1,"city_id":1,"branch_name":"Ice cream shop","copy_items":true,"copy_special_offers":true}'
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://foodsoul.pro/api/crm/v2/branches.add', [
'headers' => [
'Authorization' => 'Bearer fs_api_YOUR_TOKEN',
'language' => 'en',
'role' => 'partner',
],
'json' => [
'branch_id' => 1,
'city_id' => 1,
'branch_name' => 'Ice cream shop',
'copy_items' => true,
'copy_special_offers' => true,
],
]);
$data = json_decode((string) $response->getBody(), true);
const response = await fetch("https://foodsoul.pro/api/crm/v2/branches.add", {
method: "POST",
headers: {
"Authorization": "Bearer fs_api_YOUR_TOKEN",
"language": "en",
"role": "partner",
"Content-Type": "application/json"
},
body: JSON.stringify({
"branch_id": 1,
"city_id": 1,
"branch_name": "Ice cream shop",
"copy_items": true,
"copy_special_offers": true
}),
})
const data = await response.json()
import requests
response = requests.request(
"POST",
"https://foodsoul.pro/api/crm/v2/branches.add",
headers={
"Authorization": "Bearer fs_api_YOUR_TOKEN",
"language": "en",
"role": "partner",
},
json={
"branch_id": 1,
"city_id": 1,
"branch_name": "Ice cream shop",
"copy_items": True,
"copy_special_offers": True,
},
)
data = response.json()
Response 200
{
"status": "success",
"data": {
"id": 8794,
"token": "6e0d9c6b6d1b8860348e1a0f313f0a16"
}
}
Requests are sent to foodsoul.pro — the host of this portal; you cannot choose another one.