curl --request POST \
--url https://api.wegly.com.br/integrations/external/proposals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deal_code": "1032",
"title": "Proposta comercial CRM Enterprise",
"notes": "Validade de 15 dias.",
"valid_until": "2026-05-05T23:59:59.000Z",
"items": [
{
"sku": "CRM-ENT-001",
"quantity": 1,
"unit_price": 2499.9,
"name": "Licença CRM Enterprise"
}
]
}
'import requests
url = "https://api.wegly.com.br/integrations/external/proposals"
payload = {
"deal_code": "1032",
"title": "Proposta comercial CRM Enterprise",
"notes": "Validade de 15 dias.",
"valid_until": "2026-05-05T23:59:59.000Z",
"items": [
{
"sku": "CRM-ENT-001",
"quantity": 1,
"unit_price": 2499.9,
"name": "Licença CRM Enterprise"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
deal_code: '1032',
title: 'Proposta comercial CRM Enterprise',
notes: 'Validade de 15 dias.',
valid_until: '2026-05-05T23:59:59.000Z',
items: [
{
sku: 'CRM-ENT-001',
quantity: 1,
unit_price: 2499.9,
name: 'Licença CRM Enterprise'
}
]
})
};
fetch('https://api.wegly.com.br/integrations/external/proposals', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'deal_code' => '1032',
'title' => 'Proposta comercial CRM Enterprise',
'notes' => 'Validade de 15 dias.',
'valid_until' => '2026-05-05T23:59:59.000Z',
'items' => [
[
'sku' => 'CRM-ENT-001',
'quantity' => 1,
'unit_price' => 2499.9,
'name' => 'Licença CRM Enterprise'
]
]
]),
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"
payload := strings.NewReader("{\n \"deal_code\": \"1032\",\n \"title\": \"Proposta comercial CRM Enterprise\",\n \"notes\": \"Validade de 15 dias.\",\n \"valid_until\": \"2026-05-05T23:59:59.000Z\",\n \"items\": [\n {\n \"sku\": \"CRM-ENT-001\",\n \"quantity\": 1,\n \"unit_price\": 2499.9,\n \"name\": \"Licença CRM Enterprise\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.wegly.com.br/integrations/external/proposals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deal_code\": \"1032\",\n \"title\": \"Proposta comercial CRM Enterprise\",\n \"notes\": \"Validade de 15 dias.\",\n \"valid_until\": \"2026-05-05T23:59:59.000Z\",\n \"items\": [\n {\n \"sku\": \"CRM-ENT-001\",\n \"quantity\": 1,\n \"unit_price\": 2499.9,\n \"name\": \"Licença CRM Enterprise\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/proposals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"deal_code\": \"1032\",\n \"title\": \"Proposta comercial CRM Enterprise\",\n \"notes\": \"Validade de 15 dias.\",\n \"valid_until\": \"2026-05-05T23:59:59.000Z\",\n \"items\": [\n {\n \"sku\": \"CRM-ENT-001\",\n \"quantity\": 1,\n \"unit_price\": 2499.9,\n \"name\": \"Licença CRM Enterprise\"\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>"
},
"deal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
},
"code": 123,
"version": 123,
"title": "<string>",
"notes": "<string>",
"is_primary": true,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"items_count": 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",
"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_value": 123,
"subtotal": 123,
"total": 123,
"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"
}
]
}Criação de proposta
Cria uma proposta comercial usando o usuário criador da chave como ator da operação. - items é obrigatório e deve conter ao menos um item válido. - deal_id e deal_code são formas alternativas de apontar o negócio de contexto. - Quando sku é informado em um item sem product_id, a API resolve o produto pelo código interno. - A criação é bloqueada quando o negócio selecionado já possui produtos associados.
curl --request POST \
--url https://api.wegly.com.br/integrations/external/proposals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deal_code": "1032",
"title": "Proposta comercial CRM Enterprise",
"notes": "Validade de 15 dias.",
"valid_until": "2026-05-05T23:59:59.000Z",
"items": [
{
"sku": "CRM-ENT-001",
"quantity": 1,
"unit_price": 2499.9,
"name": "Licença CRM Enterprise"
}
]
}
'import requests
url = "https://api.wegly.com.br/integrations/external/proposals"
payload = {
"deal_code": "1032",
"title": "Proposta comercial CRM Enterprise",
"notes": "Validade de 15 dias.",
"valid_until": "2026-05-05T23:59:59.000Z",
"items": [
{
"sku": "CRM-ENT-001",
"quantity": 1,
"unit_price": 2499.9,
"name": "Licença CRM Enterprise"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
deal_code: '1032',
title: 'Proposta comercial CRM Enterprise',
notes: 'Validade de 15 dias.',
valid_until: '2026-05-05T23:59:59.000Z',
items: [
{
sku: 'CRM-ENT-001',
quantity: 1,
unit_price: 2499.9,
name: 'Licença CRM Enterprise'
}
]
})
};
fetch('https://api.wegly.com.br/integrations/external/proposals', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'deal_code' => '1032',
'title' => 'Proposta comercial CRM Enterprise',
'notes' => 'Validade de 15 dias.',
'valid_until' => '2026-05-05T23:59:59.000Z',
'items' => [
[
'sku' => 'CRM-ENT-001',
'quantity' => 1,
'unit_price' => 2499.9,
'name' => 'Licença CRM Enterprise'
]
]
]),
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"
payload := strings.NewReader("{\n \"deal_code\": \"1032\",\n \"title\": \"Proposta comercial CRM Enterprise\",\n \"notes\": \"Validade de 15 dias.\",\n \"valid_until\": \"2026-05-05T23:59:59.000Z\",\n \"items\": [\n {\n \"sku\": \"CRM-ENT-001\",\n \"quantity\": 1,\n \"unit_price\": 2499.9,\n \"name\": \"Licença CRM Enterprise\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.wegly.com.br/integrations/external/proposals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deal_code\": \"1032\",\n \"title\": \"Proposta comercial CRM Enterprise\",\n \"notes\": \"Validade de 15 dias.\",\n \"valid_until\": \"2026-05-05T23:59:59.000Z\",\n \"items\": [\n {\n \"sku\": \"CRM-ENT-001\",\n \"quantity\": 1,\n \"unit_price\": 2499.9,\n \"name\": \"Licença CRM Enterprise\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/proposals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"deal_code\": \"1032\",\n \"title\": \"Proposta comercial CRM Enterprise\",\n \"notes\": \"Validade de 15 dias.\",\n \"valid_until\": \"2026-05-05T23:59:59.000Z\",\n \"items\": [\n {\n \"sku\": \"CRM-ENT-001\",\n \"quantity\": 1,\n \"unit_price\": 2499.9,\n \"name\": \"Licença CRM Enterprise\"\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>"
},
"deal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
},
"code": 123,
"version": 123,
"title": "<string>",
"notes": "<string>",
"is_primary": true,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"items_count": 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",
"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_value": 123,
"subtotal": 123,
"total": 123,
"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"
}
]
}Authorizations
Utilize o token de integração no header Authorization: Bearer {token}. O domínio de origem (Origin/Referer) deve respeitar allowed_domain, quando configurado na chave.
Body
1Show child attributes
Show child attributes
501501 = negociação, 2 = aprovada, 3 = rejeitada, 4 = arquivada, 5 = dispensada.
1, 2, 3, 4, 5 0 = percentual, 1 = valor fixo.
0, 1 x >= 0Response
Proposta criada com sucesso.
Show child attributes
Show child attributes
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
Show child attributes
Show child attributes
