curl --request PUT \
--url https://api.example.com/api/sale-estimates/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"customerId": 1,
"estimateDate": "2021-01-01",
"expirationDate": "2021-01-01",
"reference": "123456",
"exchangeRate": 1,
"warehouseId": 1,
"branchId": 1,
"entries": [
{
"index": 1,
"itemId": 1,
"description": "This is a description",
"quantity": 100,
"cost": 100
}
],
"note": "This is a note",
"termsConditions": "This is a terms and conditions",
"sendToEmail": "[email protected]",
"attachments": [
{
"key": "123456"
}
],
"pdfTemplateId": 1,
"discount": 1,
"discountType": "amount",
"adjustment": 1
}
'import requests
url = "https://api.example.com/api/sale-estimates/{id}"
payload = {
"customerId": 1,
"estimateDate": "2021-01-01",
"expirationDate": "2021-01-01",
"reference": "123456",
"exchangeRate": 1,
"warehouseId": 1,
"branchId": 1,
"entries": [
{
"index": 1,
"itemId": 1,
"description": "This is a description",
"quantity": 100,
"cost": 100
}
],
"note": "This is a note",
"termsConditions": "This is a terms and conditions",
"sendToEmail": "[email protected]",
"attachments": [{ "key": "123456" }],
"pdfTemplateId": 1,
"discount": 1,
"discountType": "amount",
"adjustment": 1
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerId: 1,
estimateDate: '2021-01-01',
expirationDate: '2021-01-01',
reference: '123456',
exchangeRate: 1,
warehouseId: 1,
branchId: 1,
entries: [
{
index: 1,
itemId: 1,
description: 'This is a description',
quantity: 100,
cost: 100
}
],
note: 'This is a note',
termsConditions: 'This is a terms and conditions',
sendToEmail: '[email protected]',
attachments: [{key: '123456'}],
pdfTemplateId: 1,
discount: 1,
discountType: 'amount',
adjustment: 1
})
};
fetch('https://api.example.com/api/sale-estimates/{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.example.com/api/sale-estimates/{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([
'customerId' => 1,
'estimateDate' => '2021-01-01',
'expirationDate' => '2021-01-01',
'reference' => '123456',
'exchangeRate' => 1,
'warehouseId' => 1,
'branchId' => 1,
'entries' => [
[
'index' => 1,
'itemId' => 1,
'description' => 'This is a description',
'quantity' => 100,
'cost' => 100
]
],
'note' => 'This is a note',
'termsConditions' => 'This is a terms and conditions',
'sendToEmail' => '[email protected]',
'attachments' => [
[
'key' => '123456'
]
],
'pdfTemplateId' => 1,
'discount' => 1,
'discountType' => 'amount',
'adjustment' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"organization-id: <organization-id>"
],
]);
$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.example.com/api/sale-estimates/{id}"
payload := strings.NewReader("{\n \"customerId\": 1,\n \"estimateDate\": \"2021-01-01\",\n \"expirationDate\": \"2021-01-01\",\n \"reference\": \"123456\",\n \"exchangeRate\": 1,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"description\": \"This is a description\",\n \"quantity\": 100,\n \"cost\": 100\n }\n ],\n \"note\": \"This is a note\",\n \"termsConditions\": \"This is a terms and conditions\",\n \"sendToEmail\": \"[email protected]\",\n \"attachments\": [\n {\n \"key\": \"123456\"\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 1,\n \"discountType\": \"amount\",\n \"adjustment\": 1\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
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.example.com/api/sale-estimates/{id}")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": 1,\n \"estimateDate\": \"2021-01-01\",\n \"expirationDate\": \"2021-01-01\",\n \"reference\": \"123456\",\n \"exchangeRate\": 1,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"description\": \"This is a description\",\n \"quantity\": 100,\n \"cost\": 100\n }\n ],\n \"note\": \"This is a note\",\n \"termsConditions\": \"This is a terms and conditions\",\n \"sendToEmail\": \"[email protected]\",\n \"attachments\": [\n {\n \"key\": \"123456\"\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 1,\n \"discountType\": \"amount\",\n \"adjustment\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/sale-estimates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": 1,\n \"estimateDate\": \"2021-01-01\",\n \"expirationDate\": \"2021-01-01\",\n \"reference\": \"123456\",\n \"exchangeRate\": 1,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"description\": \"This is a description\",\n \"quantity\": 100,\n \"cost\": 100\n }\n ],\n \"note\": \"This is a note\",\n \"termsConditions\": \"This is a terms and conditions\",\n \"sendToEmail\": \"[email protected]\",\n \"attachments\": [\n {\n \"key\": \"123456\"\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 1,\n \"discountType\": \"amount\",\n \"adjustment\": 1\n}"
response = http.request(request)
puts response.read_bodyEdit the given sale estimate.
curl --request PUT \
--url https://api.example.com/api/sale-estimates/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"customerId": 1,
"estimateDate": "2021-01-01",
"expirationDate": "2021-01-01",
"reference": "123456",
"exchangeRate": 1,
"warehouseId": 1,
"branchId": 1,
"entries": [
{
"index": 1,
"itemId": 1,
"description": "This is a description",
"quantity": 100,
"cost": 100
}
],
"note": "This is a note",
"termsConditions": "This is a terms and conditions",
"sendToEmail": "[email protected]",
"attachments": [
{
"key": "123456"
}
],
"pdfTemplateId": 1,
"discount": 1,
"discountType": "amount",
"adjustment": 1
}
'import requests
url = "https://api.example.com/api/sale-estimates/{id}"
payload = {
"customerId": 1,
"estimateDate": "2021-01-01",
"expirationDate": "2021-01-01",
"reference": "123456",
"exchangeRate": 1,
"warehouseId": 1,
"branchId": 1,
"entries": [
{
"index": 1,
"itemId": 1,
"description": "This is a description",
"quantity": 100,
"cost": 100
}
],
"note": "This is a note",
"termsConditions": "This is a terms and conditions",
"sendToEmail": "[email protected]",
"attachments": [{ "key": "123456" }],
"pdfTemplateId": 1,
"discount": 1,
"discountType": "amount",
"adjustment": 1
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerId: 1,
estimateDate: '2021-01-01',
expirationDate: '2021-01-01',
reference: '123456',
exchangeRate: 1,
warehouseId: 1,
branchId: 1,
entries: [
{
index: 1,
itemId: 1,
description: 'This is a description',
quantity: 100,
cost: 100
}
],
note: 'This is a note',
termsConditions: 'This is a terms and conditions',
sendToEmail: '[email protected]',
attachments: [{key: '123456'}],
pdfTemplateId: 1,
discount: 1,
discountType: 'amount',
adjustment: 1
})
};
fetch('https://api.example.com/api/sale-estimates/{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.example.com/api/sale-estimates/{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([
'customerId' => 1,
'estimateDate' => '2021-01-01',
'expirationDate' => '2021-01-01',
'reference' => '123456',
'exchangeRate' => 1,
'warehouseId' => 1,
'branchId' => 1,
'entries' => [
[
'index' => 1,
'itemId' => 1,
'description' => 'This is a description',
'quantity' => 100,
'cost' => 100
]
],
'note' => 'This is a note',
'termsConditions' => 'This is a terms and conditions',
'sendToEmail' => '[email protected]',
'attachments' => [
[
'key' => '123456'
]
],
'pdfTemplateId' => 1,
'discount' => 1,
'discountType' => 'amount',
'adjustment' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"organization-id: <organization-id>"
],
]);
$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.example.com/api/sale-estimates/{id}"
payload := strings.NewReader("{\n \"customerId\": 1,\n \"estimateDate\": \"2021-01-01\",\n \"expirationDate\": \"2021-01-01\",\n \"reference\": \"123456\",\n \"exchangeRate\": 1,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"description\": \"This is a description\",\n \"quantity\": 100,\n \"cost\": 100\n }\n ],\n \"note\": \"This is a note\",\n \"termsConditions\": \"This is a terms and conditions\",\n \"sendToEmail\": \"[email protected]\",\n \"attachments\": [\n {\n \"key\": \"123456\"\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 1,\n \"discountType\": \"amount\",\n \"adjustment\": 1\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
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.example.com/api/sale-estimates/{id}")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": 1,\n \"estimateDate\": \"2021-01-01\",\n \"expirationDate\": \"2021-01-01\",\n \"reference\": \"123456\",\n \"exchangeRate\": 1,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"description\": \"This is a description\",\n \"quantity\": 100,\n \"cost\": 100\n }\n ],\n \"note\": \"This is a note\",\n \"termsConditions\": \"This is a terms and conditions\",\n \"sendToEmail\": \"[email protected]\",\n \"attachments\": [\n {\n \"key\": \"123456\"\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 1,\n \"discountType\": \"amount\",\n \"adjustment\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/sale-estimates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": 1,\n \"estimateDate\": \"2021-01-01\",\n \"expirationDate\": \"2021-01-01\",\n \"reference\": \"123456\",\n \"exchangeRate\": 1,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"description\": \"This is a description\",\n \"quantity\": 100,\n \"cost\": 100\n }\n ],\n \"note\": \"This is a note\",\n \"termsConditions\": \"This is a terms and conditions\",\n \"sendToEmail\": \"[email protected]\",\n \"attachments\": [\n {\n \"key\": \"123456\"\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 1,\n \"discountType\": \"amount\",\n \"adjustment\": 1\n}"
response = http.request(request)
puts response.read_bodyHeaders
Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.
"Bearer bc_1234567890abcdef"
Required if Authorization is a JWT token. The organization ID to operate within.
Path Parameters
The sale estimate id
Body
The id of the customer
1
The date of the estimate
"2021-01-01"
The expiration date of the estimate
"2021-01-01"
The reference of the estimate
"123456"
The exchange rate of the estimate
1
The id of the warehouse
1
The id of the branch
1
The entries of the estimate
[
{
"index": 1,
"itemId": 1,
"description": "This is a description",
"quantity": 100,
"cost": 100
}
]
The note of the estimate
"This is a note"
The terms and conditions of the estimate
"This is a terms and conditions"
The email to send the estimate to
The attachments of the estimate
[{ "key": "123456" }]
The id of the pdf template
1
The discount of the estimate
1
The type of the discount
"amount"
The adjustment of the estimate
1
Response
Sale estimate edited successfully