curl --request PUT \
--url https://api.wegly.com.br/integrations/external/proposals/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lead_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_code": "<string>",
"title": "<string>",
"notes": "<string>",
"discount_value": 1,
"valid_until": "2023-11-07T05:31:56Z",
"approved_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approved_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"custom_fields": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"option_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"option_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"boolean_value": true
}
],
"delivery_schedule": {
"deadlines": [
{
"unit": "DAYS",
"quantity": 18263,
"stage": "<string>",
"notes": "<string>"
}
],
"starts_on": "2023-12-25"
},
"items": [
{
"quantity": 1.001,
"id": "<string>",
"delete": true,
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sku": "<string>",
"name": "<string>",
"description": "<string>",
"unit_price": 1,
"discount_value": 1,
"notes": "<string>",
"internal_notes": "<string>",
"is_recurring_default": true,
"contract_term_months": 2,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"billing_cycles": 2,
"position": 1,
"new_product": {
"name": "<string>",
"active": true,
"code": "<string>",
"description": "<string>",
"cost_price": 123,
"sale_price": 123,
"is_recurring_default": true,
"billing_interval_count_def": 2,
"contract_term_months_def": 2,
"custom_fields": [
{
"name": "<string>",
"position": 1,
"is_required": true,
"is_visible_in_documents": true,
"options": [
"<string>"
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
},
"new_product_client_id": "<string>",
"custom_fields": [
{
"field_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"category_values": [
{
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"billing_interval_count": 2
}
]
}
'import requests
url = "https://api.wegly.com.br/integrations/external/proposals/{id}"
payload = {
"lead_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_code": "<string>",
"title": "<string>",
"notes": "<string>",
"discount_value": 1,
"valid_until": "2023-11-07T05:31:56Z",
"approved_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approved_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"custom_fields": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"option_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"option_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"boolean_value": True
}
],
"delivery_schedule": {
"deadlines": [
{
"unit": "DAYS",
"quantity": 18263,
"stage": "<string>",
"notes": "<string>"
}
],
"starts_on": "2023-12-25"
},
"items": [
{
"quantity": 1.001,
"id": "<string>",
"delete": True,
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sku": "<string>",
"name": "<string>",
"description": "<string>",
"unit_price": 1,
"discount_value": 1,
"notes": "<string>",
"internal_notes": "<string>",
"is_recurring_default": True,
"contract_term_months": 2,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"billing_cycles": 2,
"position": 1,
"new_product": {
"name": "<string>",
"active": True,
"code": "<string>",
"description": "<string>",
"cost_price": 123,
"sale_price": 123,
"is_recurring_default": True,
"billing_interval_count_def": 2,
"contract_term_months_def": 2,
"custom_fields": [
{
"name": "<string>",
"position": 1,
"is_required": True,
"is_visible_in_documents": True,
"options": ["<string>"],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
},
"new_product_client_id": "<string>",
"custom_fields": [
{
"field_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"category_values": [
{
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"billing_interval_count": 2
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
lead_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
deal_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
deal_code: '<string>',
title: '<string>',
notes: '<string>',
discount_value: 1,
valid_until: '2023-11-07T05:31:56Z',
approved_by: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
approved_at: '2023-11-07T05:31:56Z',
archived_at: '2023-11-07T05:31:56Z',
rejected_at: '2023-11-07T05:31:56Z',
custom_fields: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
value: '<string>',
option_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
option_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
boolean_value: true
}
],
delivery_schedule: {
deadlines: [{unit: 'DAYS', quantity: 18263, stage: '<string>', notes: '<string>'}],
starts_on: '2023-12-25'
},
items: [
{
quantity: 1.001,
id: '<string>',
delete: true,
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sku: '<string>',
name: '<string>',
description: '<string>',
unit_price: 1,
discount_value: 1,
notes: '<string>',
internal_notes: '<string>',
is_recurring_default: true,
contract_term_months: 2,
start_date: '2023-11-07T05:31:56Z',
end_date: '2023-11-07T05:31:56Z',
billing_cycles: 2,
position: 1,
new_product: {
name: '<string>',
active: true,
code: '<string>',
description: '<string>',
cost_price: 123,
sale_price: 123,
is_recurring_default: true,
billing_interval_count_def: 2,
contract_term_months_def: 2,
custom_fields: [
{
name: '<string>',
position: 1,
is_required: true,
is_visible_in_documents: true,
options: ['<string>'],
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
]
},
new_product_client_id: '<string>',
custom_fields: [{field_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', value: '<string>'}],
category_values: [{category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', value: '<string>'}],
billing_interval_count: 2
}
]
})
};
fetch('https://api.wegly.com.br/integrations/external/proposals/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wegly.com.br/integrations/external/proposals/{id}",
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([
'lead_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'deal_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'deal_code' => '<string>',
'title' => '<string>',
'notes' => '<string>',
'discount_value' => 1,
'valid_until' => '2023-11-07T05:31:56Z',
'approved_by' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'approved_at' => '2023-11-07T05:31:56Z',
'archived_at' => '2023-11-07T05:31:56Z',
'rejected_at' => '2023-11-07T05:31:56Z',
'custom_fields' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'value' => '<string>',
'option_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'option_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'boolean_value' => true
]
],
'delivery_schedule' => [
'deadlines' => [
[
'unit' => 'DAYS',
'quantity' => 18263,
'stage' => '<string>',
'notes' => '<string>'
]
],
'starts_on' => '2023-12-25'
],
'items' => [
[
'quantity' => 1.001,
'id' => '<string>',
'delete' => true,
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'sku' => '<string>',
'name' => '<string>',
'description' => '<string>',
'unit_price' => 1,
'discount_value' => 1,
'notes' => '<string>',
'internal_notes' => '<string>',
'is_recurring_default' => true,
'contract_term_months' => 2,
'start_date' => '2023-11-07T05:31:56Z',
'end_date' => '2023-11-07T05:31:56Z',
'billing_cycles' => 2,
'position' => 1,
'new_product' => [
'name' => '<string>',
'active' => true,
'code' => '<string>',
'description' => '<string>',
'cost_price' => 123,
'sale_price' => 123,
'is_recurring_default' => true,
'billing_interval_count_def' => 2,
'contract_term_months_def' => 2,
'custom_fields' => [
[
'name' => '<string>',
'position' => 1,
'is_required' => true,
'is_visible_in_documents' => true,
'options' => [
'<string>'
],
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
],
'new_product_client_id' => '<string>',
'custom_fields' => [
[
'field_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'value' => '<string>'
]
],
'category_values' => [
[
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'value' => '<string>'
]
],
'billing_interval_count' => 2
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wegly.com.br/integrations/external/proposals/{id}"
payload := strings.NewReader("{\n \"lead_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_code\": \"<string>\",\n \"title\": \"<string>\",\n \"notes\": \"<string>\",\n \"discount_value\": 1,\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"archived_at\": \"2023-11-07T05:31:56Z\",\n \"rejected_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"option_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"boolean_value\": true\n }\n ],\n \"delivery_schedule\": {\n \"deadlines\": [\n {\n \"unit\": \"DAYS\",\n \"quantity\": 18263,\n \"stage\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"starts_on\": \"2023-12-25\"\n },\n \"items\": [\n {\n \"quantity\": 1.001,\n \"id\": \"<string>\",\n \"delete\": true,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"unit_price\": 1,\n \"discount_value\": 1,\n \"notes\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"is_recurring_default\": true,\n \"contract_term_months\": 2,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"billing_cycles\": 2,\n \"position\": 1,\n \"new_product\": {\n \"name\": \"<string>\",\n \"active\": true,\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"cost_price\": 123,\n \"sale_price\": 123,\n \"is_recurring_default\": true,\n \"billing_interval_count_def\": 2,\n \"contract_term_months_def\": 2,\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"position\": 1,\n \"is_required\": true,\n \"is_visible_in_documents\": true,\n \"options\": [\n \"<string>\"\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n },\n \"new_product_client_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"field_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"category_values\": [\n {\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"billing_interval_count\": 2\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.wegly.com.br/integrations/external/proposals/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lead_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_code\": \"<string>\",\n \"title\": \"<string>\",\n \"notes\": \"<string>\",\n \"discount_value\": 1,\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"archived_at\": \"2023-11-07T05:31:56Z\",\n \"rejected_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"option_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"boolean_value\": true\n }\n ],\n \"delivery_schedule\": {\n \"deadlines\": [\n {\n \"unit\": \"DAYS\",\n \"quantity\": 18263,\n \"stage\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"starts_on\": \"2023-12-25\"\n },\n \"items\": [\n {\n \"quantity\": 1.001,\n \"id\": \"<string>\",\n \"delete\": true,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"unit_price\": 1,\n \"discount_value\": 1,\n \"notes\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"is_recurring_default\": true,\n \"contract_term_months\": 2,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"billing_cycles\": 2,\n \"position\": 1,\n \"new_product\": {\n \"name\": \"<string>\",\n \"active\": true,\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"cost_price\": 123,\n \"sale_price\": 123,\n \"is_recurring_default\": true,\n \"billing_interval_count_def\": 2,\n \"contract_term_months_def\": 2,\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"position\": 1,\n \"is_required\": true,\n \"is_visible_in_documents\": true,\n \"options\": [\n \"<string>\"\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n },\n \"new_product_client_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"field_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"category_values\": [\n {\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"billing_interval_count\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/proposals/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lead_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_code\": \"<string>\",\n \"title\": \"<string>\",\n \"notes\": \"<string>\",\n \"discount_value\": 1,\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"archived_at\": \"2023-11-07T05:31:56Z\",\n \"rejected_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"option_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"boolean_value\": true\n }\n ],\n \"delivery_schedule\": {\n \"deadlines\": [\n {\n \"unit\": \"DAYS\",\n \"quantity\": 18263,\n \"stage\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"starts_on\": \"2023-12-25\"\n },\n \"items\": [\n {\n \"quantity\": 1.001,\n \"id\": \"<string>\",\n \"delete\": true,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"unit_price\": 1,\n \"discount_value\": 1,\n \"notes\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"is_recurring_default\": true,\n \"contract_term_months\": 2,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"billing_cycles\": 2,\n \"position\": 1,\n \"new_product\": {\n \"name\": \"<string>\",\n \"active\": true,\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"cost_price\": 123,\n \"sale_price\": 123,\n \"is_recurring_default\": true,\n \"billing_interval_count_def\": 2,\n \"contract_term_months_def\": 2,\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"position\": 1,\n \"is_required\": true,\n \"is_visible_in_documents\": true,\n \"options\": [\n \"<string>\"\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n },\n \"new_product_client_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"field_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"category_values\": [\n {\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"billing_interval_count\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lead": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"status": 1,
"archived_at": "2023-11-07T05:31:56Z",
"negotiation_mode": 123
},
"deal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"status": 1,
"archived_at": "2023-11-07T05:31:56Z",
"negotiation_mode": 123
},
"code": 123,
"version": 123,
"title": "<string>",
"status": 1,
"notes": "<string>",
"is_primary": true,
"discount_type": 0,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"valid_until": "2023-11-07T05:31:56Z",
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"approved_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"approved_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"notes_format": "MARKDOWN",
"projected_values": {
"6": 123,
"12": 123,
"18": 123,
"24": 123
},
"has_recurring_value": true,
"has_indefinite_recurring_value": true,
"has_rolling_projection": true,
"projection_calculated_at": "2023-11-07T05:31:56Z",
"projection_calculation_version": 123,
"projection_source": "<string>",
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"name": "<string>",
"image": "<string>"
},
"name": "<string>",
"description": "<string>",
"unit": 123,
"quantity": 123,
"unit_price": 123,
"discount_type": 0,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"notes": "<string>",
"internal_notes": "<string>",
"is_recurring_default": true,
"billing_interval_default": 123,
"contract_term_months": 123,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"billing_cycles": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"position": 123,
"billing_interval_count": 123,
"recurring_payment_method": 1,
"custom_fields": [
{
"field_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "TEXT",
"position": 123,
"is_required": true,
"is_visible_in_documents": true,
"options": [
"<string>"
],
"value": "<string>"
}
],
"category_values": [
{
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"category_name": "<string>",
"category_type": "TEXT",
"position": 123,
"options": [
"<string>"
],
"value": "<string>"
}
]
}
],
"payment_options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"position": 123,
"discount_type": 0,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"installments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"position": 123,
"amount": 123,
"percentage": 123,
"due_date": "2023-11-07T05:31:56Z",
"due_in_days": 123,
"notes": "<string>",
"payment_method": 1,
"payment_method_installments": 123,
"card_receipt_mode": 1,
"payment_method_notes": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
],
"custom_fields": [
{
"field_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"field_name": "<string>",
"field_type": 0,
"position": 123,
"is_required": true,
"min_checkbox_selections": 123,
"max_checkbox_selections": 123,
"section_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"section": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"position": 123
},
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"position": 123
}
],
"answers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"option_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"option_value": "<string>",
"boolean_value": true
}
]
}
],
"delivery_schedule": {
"starts_on": "2023-12-25",
"effective_starts_on": "2023-12-25",
"is_dynamic": true,
"timezone": "<string>",
"calculation_version": 123,
"final_qualifier": "EXACT",
"declared_total": "<string>",
"declared_totals": [
{
"quantity": 123,
"unit": "DAYS",
"counting_mode": "CALENDAR"
}
],
"estimated_delivery_date": "2023-12-25",
"estimated_delivery_is_business_day": true,
"suggested_next_business_date": "2023-12-25",
"elapsed_calendar_days": 123,
"business_days_notice": "Dias úteis consideram somente segunda a sexta-feira; feriados não são considerados.",
"deadlines": [
{
"unit": "DAYS",
"quantity": 18263,
"counting_mode": "CALENDAR",
"stage": "<string>",
"qualifier": "EXACT",
"notes": "<string>",
"position": 123,
"cumulative_qualifier": "EXACT",
"estimated_start_date": "2023-12-25",
"estimated_end_date": "2023-12-25",
"estimated_end_is_business_day": true,
"suggested_next_business_date": "2023-12-25"
}
]
}
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Atualização de proposta
Atualiza parcialmente a proposta. Em items: com id atualiza, com id e delete=true remove, sem id adiciona; itens omitidos são preservados e ao menos um deve permanecer. quantity é obrigatória nos itens enviados sem remoção. Se deal_code for enviado, prevalece sobre deal_id. delivery_schedule omitido preserva, objeto substitui integralmente e null remove. custom_fields enviado substitui o conjunto de respostas. Contextos fechados bloqueiam a alteração. Mudança de total com condições de pagamento existentes exige sua revisão no CRM; payment_options não está declarado no DTO externo.
curl --request PUT \
--url https://api.wegly.com.br/integrations/external/proposals/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lead_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_code": "<string>",
"title": "<string>",
"notes": "<string>",
"discount_value": 1,
"valid_until": "2023-11-07T05:31:56Z",
"approved_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approved_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"custom_fields": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"option_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"option_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"boolean_value": true
}
],
"delivery_schedule": {
"deadlines": [
{
"unit": "DAYS",
"quantity": 18263,
"stage": "<string>",
"notes": "<string>"
}
],
"starts_on": "2023-12-25"
},
"items": [
{
"quantity": 1.001,
"id": "<string>",
"delete": true,
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sku": "<string>",
"name": "<string>",
"description": "<string>",
"unit_price": 1,
"discount_value": 1,
"notes": "<string>",
"internal_notes": "<string>",
"is_recurring_default": true,
"contract_term_months": 2,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"billing_cycles": 2,
"position": 1,
"new_product": {
"name": "<string>",
"active": true,
"code": "<string>",
"description": "<string>",
"cost_price": 123,
"sale_price": 123,
"is_recurring_default": true,
"billing_interval_count_def": 2,
"contract_term_months_def": 2,
"custom_fields": [
{
"name": "<string>",
"position": 1,
"is_required": true,
"is_visible_in_documents": true,
"options": [
"<string>"
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
},
"new_product_client_id": "<string>",
"custom_fields": [
{
"field_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"category_values": [
{
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"billing_interval_count": 2
}
]
}
'import requests
url = "https://api.wegly.com.br/integrations/external/proposals/{id}"
payload = {
"lead_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_code": "<string>",
"title": "<string>",
"notes": "<string>",
"discount_value": 1,
"valid_until": "2023-11-07T05:31:56Z",
"approved_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approved_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"custom_fields": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"option_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"option_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"boolean_value": True
}
],
"delivery_schedule": {
"deadlines": [
{
"unit": "DAYS",
"quantity": 18263,
"stage": "<string>",
"notes": "<string>"
}
],
"starts_on": "2023-12-25"
},
"items": [
{
"quantity": 1.001,
"id": "<string>",
"delete": True,
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sku": "<string>",
"name": "<string>",
"description": "<string>",
"unit_price": 1,
"discount_value": 1,
"notes": "<string>",
"internal_notes": "<string>",
"is_recurring_default": True,
"contract_term_months": 2,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"billing_cycles": 2,
"position": 1,
"new_product": {
"name": "<string>",
"active": True,
"code": "<string>",
"description": "<string>",
"cost_price": 123,
"sale_price": 123,
"is_recurring_default": True,
"billing_interval_count_def": 2,
"contract_term_months_def": 2,
"custom_fields": [
{
"name": "<string>",
"position": 1,
"is_required": True,
"is_visible_in_documents": True,
"options": ["<string>"],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
},
"new_product_client_id": "<string>",
"custom_fields": [
{
"field_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"category_values": [
{
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"billing_interval_count": 2
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
lead_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
deal_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
deal_code: '<string>',
title: '<string>',
notes: '<string>',
discount_value: 1,
valid_until: '2023-11-07T05:31:56Z',
approved_by: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
approved_at: '2023-11-07T05:31:56Z',
archived_at: '2023-11-07T05:31:56Z',
rejected_at: '2023-11-07T05:31:56Z',
custom_fields: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
value: '<string>',
option_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
option_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
boolean_value: true
}
],
delivery_schedule: {
deadlines: [{unit: 'DAYS', quantity: 18263, stage: '<string>', notes: '<string>'}],
starts_on: '2023-12-25'
},
items: [
{
quantity: 1.001,
id: '<string>',
delete: true,
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sku: '<string>',
name: '<string>',
description: '<string>',
unit_price: 1,
discount_value: 1,
notes: '<string>',
internal_notes: '<string>',
is_recurring_default: true,
contract_term_months: 2,
start_date: '2023-11-07T05:31:56Z',
end_date: '2023-11-07T05:31:56Z',
billing_cycles: 2,
position: 1,
new_product: {
name: '<string>',
active: true,
code: '<string>',
description: '<string>',
cost_price: 123,
sale_price: 123,
is_recurring_default: true,
billing_interval_count_def: 2,
contract_term_months_def: 2,
custom_fields: [
{
name: '<string>',
position: 1,
is_required: true,
is_visible_in_documents: true,
options: ['<string>'],
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
]
},
new_product_client_id: '<string>',
custom_fields: [{field_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', value: '<string>'}],
category_values: [{category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', value: '<string>'}],
billing_interval_count: 2
}
]
})
};
fetch('https://api.wegly.com.br/integrations/external/proposals/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wegly.com.br/integrations/external/proposals/{id}",
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([
'lead_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'deal_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'deal_code' => '<string>',
'title' => '<string>',
'notes' => '<string>',
'discount_value' => 1,
'valid_until' => '2023-11-07T05:31:56Z',
'approved_by' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'approved_at' => '2023-11-07T05:31:56Z',
'archived_at' => '2023-11-07T05:31:56Z',
'rejected_at' => '2023-11-07T05:31:56Z',
'custom_fields' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'value' => '<string>',
'option_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'option_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'boolean_value' => true
]
],
'delivery_schedule' => [
'deadlines' => [
[
'unit' => 'DAYS',
'quantity' => 18263,
'stage' => '<string>',
'notes' => '<string>'
]
],
'starts_on' => '2023-12-25'
],
'items' => [
[
'quantity' => 1.001,
'id' => '<string>',
'delete' => true,
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'sku' => '<string>',
'name' => '<string>',
'description' => '<string>',
'unit_price' => 1,
'discount_value' => 1,
'notes' => '<string>',
'internal_notes' => '<string>',
'is_recurring_default' => true,
'contract_term_months' => 2,
'start_date' => '2023-11-07T05:31:56Z',
'end_date' => '2023-11-07T05:31:56Z',
'billing_cycles' => 2,
'position' => 1,
'new_product' => [
'name' => '<string>',
'active' => true,
'code' => '<string>',
'description' => '<string>',
'cost_price' => 123,
'sale_price' => 123,
'is_recurring_default' => true,
'billing_interval_count_def' => 2,
'contract_term_months_def' => 2,
'custom_fields' => [
[
'name' => '<string>',
'position' => 1,
'is_required' => true,
'is_visible_in_documents' => true,
'options' => [
'<string>'
],
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
],
'new_product_client_id' => '<string>',
'custom_fields' => [
[
'field_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'value' => '<string>'
]
],
'category_values' => [
[
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'value' => '<string>'
]
],
'billing_interval_count' => 2
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wegly.com.br/integrations/external/proposals/{id}"
payload := strings.NewReader("{\n \"lead_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_code\": \"<string>\",\n \"title\": \"<string>\",\n \"notes\": \"<string>\",\n \"discount_value\": 1,\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"archived_at\": \"2023-11-07T05:31:56Z\",\n \"rejected_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"option_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"boolean_value\": true\n }\n ],\n \"delivery_schedule\": {\n \"deadlines\": [\n {\n \"unit\": \"DAYS\",\n \"quantity\": 18263,\n \"stage\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"starts_on\": \"2023-12-25\"\n },\n \"items\": [\n {\n \"quantity\": 1.001,\n \"id\": \"<string>\",\n \"delete\": true,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"unit_price\": 1,\n \"discount_value\": 1,\n \"notes\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"is_recurring_default\": true,\n \"contract_term_months\": 2,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"billing_cycles\": 2,\n \"position\": 1,\n \"new_product\": {\n \"name\": \"<string>\",\n \"active\": true,\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"cost_price\": 123,\n \"sale_price\": 123,\n \"is_recurring_default\": true,\n \"billing_interval_count_def\": 2,\n \"contract_term_months_def\": 2,\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"position\": 1,\n \"is_required\": true,\n \"is_visible_in_documents\": true,\n \"options\": [\n \"<string>\"\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n },\n \"new_product_client_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"field_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"category_values\": [\n {\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"billing_interval_count\": 2\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.wegly.com.br/integrations/external/proposals/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lead_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_code\": \"<string>\",\n \"title\": \"<string>\",\n \"notes\": \"<string>\",\n \"discount_value\": 1,\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"archived_at\": \"2023-11-07T05:31:56Z\",\n \"rejected_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"option_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"boolean_value\": true\n }\n ],\n \"delivery_schedule\": {\n \"deadlines\": [\n {\n \"unit\": \"DAYS\",\n \"quantity\": 18263,\n \"stage\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"starts_on\": \"2023-12-25\"\n },\n \"items\": [\n {\n \"quantity\": 1.001,\n \"id\": \"<string>\",\n \"delete\": true,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"unit_price\": 1,\n \"discount_value\": 1,\n \"notes\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"is_recurring_default\": true,\n \"contract_term_months\": 2,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"billing_cycles\": 2,\n \"position\": 1,\n \"new_product\": {\n \"name\": \"<string>\",\n \"active\": true,\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"cost_price\": 123,\n \"sale_price\": 123,\n \"is_recurring_default\": true,\n \"billing_interval_count_def\": 2,\n \"contract_term_months_def\": 2,\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"position\": 1,\n \"is_required\": true,\n \"is_visible_in_documents\": true,\n \"options\": [\n \"<string>\"\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n },\n \"new_product_client_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"field_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"category_values\": [\n {\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"billing_interval_count\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/proposals/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lead_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_code\": \"<string>\",\n \"title\": \"<string>\",\n \"notes\": \"<string>\",\n \"discount_value\": 1,\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"archived_at\": \"2023-11-07T05:31:56Z\",\n \"rejected_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"option_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"option_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"boolean_value\": true\n }\n ],\n \"delivery_schedule\": {\n \"deadlines\": [\n {\n \"unit\": \"DAYS\",\n \"quantity\": 18263,\n \"stage\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"starts_on\": \"2023-12-25\"\n },\n \"items\": [\n {\n \"quantity\": 1.001,\n \"id\": \"<string>\",\n \"delete\": true,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"unit_price\": 1,\n \"discount_value\": 1,\n \"notes\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"is_recurring_default\": true,\n \"contract_term_months\": 2,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"billing_cycles\": 2,\n \"position\": 1,\n \"new_product\": {\n \"name\": \"<string>\",\n \"active\": true,\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"cost_price\": 123,\n \"sale_price\": 123,\n \"is_recurring_default\": true,\n \"billing_interval_count_def\": 2,\n \"contract_term_months_def\": 2,\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"position\": 1,\n \"is_required\": true,\n \"is_visible_in_documents\": true,\n \"options\": [\n \"<string>\"\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n },\n \"new_product_client_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"field_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"category_values\": [\n {\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\"\n }\n ],\n \"billing_interval_count\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lead": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"status": 1,
"archived_at": "2023-11-07T05:31:56Z",
"negotiation_mode": 123
},
"deal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"status": 1,
"archived_at": "2023-11-07T05:31:56Z",
"negotiation_mode": 123
},
"code": 123,
"version": 123,
"title": "<string>",
"status": 1,
"notes": "<string>",
"is_primary": true,
"discount_type": 0,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"valid_until": "2023-11-07T05:31:56Z",
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"approved_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"approved_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"notes_format": "MARKDOWN",
"projected_values": {
"6": 123,
"12": 123,
"18": 123,
"24": 123
},
"has_recurring_value": true,
"has_indefinite_recurring_value": true,
"has_rolling_projection": true,
"projection_calculated_at": "2023-11-07T05:31:56Z",
"projection_calculation_version": 123,
"projection_source": "<string>",
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"name": "<string>",
"image": "<string>"
},
"name": "<string>",
"description": "<string>",
"unit": 123,
"quantity": 123,
"unit_price": 123,
"discount_type": 0,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"notes": "<string>",
"internal_notes": "<string>",
"is_recurring_default": true,
"billing_interval_default": 123,
"contract_term_months": 123,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"billing_cycles": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"position": 123,
"billing_interval_count": 123,
"recurring_payment_method": 1,
"custom_fields": [
{
"field_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "TEXT",
"position": 123,
"is_required": true,
"is_visible_in_documents": true,
"options": [
"<string>"
],
"value": "<string>"
}
],
"category_values": [
{
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"category_name": "<string>",
"category_type": "TEXT",
"position": 123,
"options": [
"<string>"
],
"value": "<string>"
}
]
}
],
"payment_options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"position": 123,
"discount_type": 0,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"installments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"position": 123,
"amount": 123,
"percentage": 123,
"due_date": "2023-11-07T05:31:56Z",
"due_in_days": 123,
"notes": "<string>",
"payment_method": 1,
"payment_method_installments": 123,
"card_receipt_mode": 1,
"payment_method_notes": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
],
"custom_fields": [
{
"field_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"field_name": "<string>",
"field_type": 0,
"position": 123,
"is_required": true,
"min_checkbox_selections": 123,
"max_checkbox_selections": 123,
"section_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"section": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"position": 123
},
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"position": 123
}
],
"answers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"option_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"option_value": "<string>",
"boolean_value": true
}
]
}
],
"delivery_schedule": {
"starts_on": "2023-12-25",
"effective_starts_on": "2023-12-25",
"is_dynamic": true,
"timezone": "<string>",
"calculation_version": 123,
"final_qualifier": "EXACT",
"declared_total": "<string>",
"declared_totals": [
{
"quantity": 123,
"unit": "DAYS",
"counting_mode": "CALENDAR"
}
],
"estimated_delivery_date": "2023-12-25",
"estimated_delivery_is_business_day": true,
"suggested_next_business_date": "2023-12-25",
"elapsed_calendar_days": 123,
"business_days_notice": "Dias úteis consideram somente segunda a sexta-feira; feriados não são considerados.",
"deadlines": [
{
"unit": "DAYS",
"quantity": 18263,
"counting_mode": "CALENDAR",
"stage": "<string>",
"qualifier": "EXACT",
"notes": "<string>",
"position": 123,
"cumulative_qualifier": "EXACT",
"estimated_start_date": "2023-12-25",
"estimated_end_date": "2023-12-25",
"estimated_end_is_business_day": true,
"suggested_next_business_date": "2023-12-25"
}
]
}
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Authorizations
Chave de integração com prefixo wegly_, enviada em Authorization: Bearer . Não é JWT. A chave deve estar ativa, não excluída e dentro da validade. Com allowed_domain, Origin (ou Referer na ausência de Origin) precisa informar o hostname permitido. A empresa e as permissões são obtidas pela chave.
Path Parameters
UUID da proposta.
Body
Atualização parcial com PUT. Campos omitidos são preservados. Contextos fechados bloqueiam a edição. Se o total mudar e houver condições de pagamento, o serviço exige revisão dessas condições no CRM.
ID do negócio. Na implementação externa atual, null é convertido em ausência e preserva o negócio existente; não use null para desvincular uma proposta de negócio.
Código público numérico do negócio, enviado como string. Evite enviar junto com deal_id: no POST o ID prevalece; no PUT o código prevalece.
501501 = negociação, 2 = aprovada, 3 = rejeitada, 4 = arquivada, 5 = dispensada.
1, 2, 3, 4, 5 0 = percentual, 1 = valor fixo.
0, 1 x >= 0Must be a multiple of 0.01UUID da pessoa aprovadora vinculada à empresa; não é o ID de usuário do CRM.
Conjunto completo de respostas de proposta, validado contra campos ativos e obrigatórios. No PUT, omitir preserva; enviar substitui o conjunto e [] só é válido se não houver obrigatórios pendentes.
Show child attributes
Show child attributes
Quando omitido, preserva o cronograma; quando null, remove todos os prazos.
Show child attributes
Show child attributes
Mutações incrementais: id atualiza, id com delete=true remove, sem id cria. Itens omitidos e items=[] preservam os itens existentes. quantity é exigida em cada item enviado que não seja remoção.
No POST, cria itens. No PUT, sem id adiciona, com id atualiza e com id + delete=true remove; itens omitidos são preservados. Ao menos um item deve permanecer. quantity é obrigatória nos itens enviados que não sejam remoções.
- Option 1
- Option 2
Show child attributes
Show child attributes
Response
Proposta atualizada.
Retorno de POST, PUT e GET por ID. Inclui itens, condições de pagamento, campos personalizados e cronograma; não inclui items_count nem payment_options_count.
Lead ou negócio de origem da proposta.
Show child attributes
Show child attributes
Lead ou negócio de origem da proposta.
Show child attributes
Show child attributes
1 = negociação, 2 = aprovada, 3 = rejeitada, 4 = arquivada, 5 = dispensada.
1, 2, 3, 4, 5 0 = percentual, 1 = valor fixo.
0, 1 Show child attributes
Show child attributes
Show child attributes
Show child attributes
Formato resolvido das observações. Ao enviar notes pela API externa, o serviço detecta HTML; caso contrário usa MARKDOWN.
MARKDOWN, HTML Projeções para horizontes de 6, 12, 18 e 24 meses. Registros de cálculo legado usam total como fallback.
Show child attributes
Show child attributes
Origem do cálculo, por exemplo DIRECT_ITEMS ou LEGACY_CURRENT_VALUE.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Todas as definições ativas de proposta, mesmo quando answers está vazio.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
