cURL
curl -X PATCH "$EXSITED_BASE_URL/api/v4/settings/discount_profiles/231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"discount_profile": {
"description": "Ten percent off launch orders"
}
}'from exsited import build_client
client = build_client()
response = client.settings.update_settings_discount_profile(
"231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d",
{"discount_profile": {"description": "Ten percent off launch orders"}},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.settings.updateSettingsDiscountProfile('231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d', {
discount_profile: {description: 'Ten percent off launch orders'},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->settings->updateSettingsDiscountProfile('231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d', [
'discount_profile' => ['description' => 'Ten percent off launch orders'],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.settings.settings_dto.SettingsDto.SettingsDiscountProfileRead;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<SettingsDiscountProfileRead> response = client.settings().updateSettingsDiscountProfile(
"231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d",
Map.of("discount_profile", Map.of("description", "Ten percent off launch orders")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Settings.UpdateSettingsDiscountProfileAsync(
"231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d",
new Dictionary<string, object?>
{
["discount_profile"] = new Dictionary<string, object?>
{
["description"] = "Ten percent off launch orders",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.settings.updateSettingsDiscountProfile(
'231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d',
{
'discount_profile': {'description': 'Ten percent off launch orders'},
},
);
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.Settings().UpdateSettingsDiscountProfile(context.Background(), "231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d", map[string]any{
"discount_profile": map[string]any{
"description": "Ten percent off launch orders",
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"discount_profile": {
"accounting_code": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"created_by": "<unknown>",
"created_on": "<string>",
"description": "<string>",
"discount_type": "<string>",
"display_name": "<string>",
"end_time": "<string>",
"fixed_amount": 123,
"href": "<string>",
"id": "<string>",
"invoice_note": "<string>",
"last_updated_by": "<unknown>",
"last_updated_on": "<string>",
"max_use_per_account": 123,
"max_use_per_order": 123,
"max_use_total": 123,
"name": "<string>",
"object": "<string>",
"owner_type": "<string>",
"percentage_amount": 123,
"price_is_inclusive_of_discount": true,
"priority": 123,
"redemption_required": true,
"stackable": true,
"start_time": "<string>",
"status": "<string>",
"tax_code": {
"href": "<string>",
"id": "<string>",
"object": "<string>"
},
"version": 123
}
}Instance settings
Update a discount profile
Changes the fields you send on a discount profile and returns it under discount_profile.
PATCH
/
settings
/
discount_profiles
/
{discount_profile_id}
cURL
curl -X PATCH "$EXSITED_BASE_URL/api/v4/settings/discount_profiles/231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"discount_profile": {
"description": "Ten percent off launch orders"
}
}'from exsited import build_client
client = build_client()
response = client.settings.update_settings_discount_profile(
"231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d",
{"discount_profile": {"description": "Ten percent off launch orders"}},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.settings.updateSettingsDiscountProfile('231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d', {
discount_profile: {description: 'Ten percent off launch orders'},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->settings->updateSettingsDiscountProfile('231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d', [
'discount_profile' => ['description' => 'Ten percent off launch orders'],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.settings.settings_dto.SettingsDto.SettingsDiscountProfileRead;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<SettingsDiscountProfileRead> response = client.settings().updateSettingsDiscountProfile(
"231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d",
Map.of("discount_profile", Map.of("description", "Ten percent off launch orders")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Settings.UpdateSettingsDiscountProfileAsync(
"231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d",
new Dictionary<string, object?>
{
["discount_profile"] = new Dictionary<string, object?>
{
["description"] = "Ten percent off launch orders",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.settings.updateSettingsDiscountProfile(
'231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d',
{
'discount_profile': {'description': 'Ten percent off launch orders'},
},
);
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.Settings().UpdateSettingsDiscountProfile(context.Background(), "231b2c3d4e5f4a6b8c7d9e0f1a2b3c4d", map[string]any{
"discount_profile": map[string]any{
"description": "Ten percent off launch orders",
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"discount_profile": {
"accounting_code": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"created_by": "<unknown>",
"created_on": "<string>",
"description": "<string>",
"discount_type": "<string>",
"display_name": "<string>",
"end_time": "<string>",
"fixed_amount": 123,
"href": "<string>",
"id": "<string>",
"invoice_note": "<string>",
"last_updated_by": "<unknown>",
"last_updated_on": "<string>",
"max_use_per_account": 123,
"max_use_per_order": 123,
"max_use_total": 123,
"name": "<string>",
"object": "<string>",
"owner_type": "<string>",
"percentage_amount": 123,
"price_is_inclusive_of_discount": true,
"priority": 123,
"redemption_required": true,
"stackable": true,
"start_time": "<string>",
"status": "<string>",
"tax_code": {
"href": "<string>",
"id": "<string>",
"object": "<string>"
},
"version": 123
}
}Send the fields to change under
discount_profile, such as description. Times use the same YYYY-MM-DD HH:mm form as a create.
The SDK samples get their client from credentials your app registers once when it starts, as shown in Authentication. To try the call here, click Try it, set
host to your Exsited API host name and paste an access token from Get an access token. To send a raw JSON body instead of filling in fields, copy the cURL sample and edit its -d payload.Authorizations
An access token from POST /api/v4/oauth2/token. The SDKs get and renew it for you.
Path Parameters
The discount profile's id, as a listing or a create returns it.
Body
application/json
Show child attributes
Show child attributes
Response
200 - application/json
The updated discount profile, under discount_profile.
Show child attributes
Show child attributes