<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.komerza.com/stores/{storeId}/reseller/bundles/{bundleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'stacking' => '<string>',
'targetMode' => '<string>',
'targetResellerIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'isEnabled' => true,
'order' => 123,
'items' => [
[
'variantId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 500000
]
],
'description' => '<string>',
'discountPercent' => 50,
'tierId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'startsAt' => '2023-11-07T05:31:56Z',
'endsAt' => '2023-11-07T05:31:56Z',
'perResellerLimit' => 500000,
'totalLimit' => 500000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}