curl --request PUT \
--url https://api.lapyme.com.ar/api/v1/purchases/{purchase_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"voucher_type": 2,
"items": [
{
"quantity": 123,
"unit_cost": 1,
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"subtotal": 1,
"total": 1,
"tax_rate_id": 1,
"is_exempt": true,
"discount_percentage": 50,
"purchase_order_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center1_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center2_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center3_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"import_source_purchase_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customs_dispatch_number": "<string>",
"supplier_invoice_number": "<string>",
"invoice_date": "2023-12-25",
"account_date": "2023-12-25",
"due_date": "2023-12-25",
"payment_term_days": 182,
"vat_perception_amount": 1,
"national_tax_amount": 1,
"gross_income_tax_amount": 1,
"gross_income_tax_breakdown": [
{
"province_id": 123,
"amount": 1
}
],
"municipal_tax_amount": 1,
"internal_tax_amount": 1,
"other_tax_amount": 1,
"warehouse_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"products_received": true,
"update_product_variant_cost": true,
"subtotal": 1,
"tax_amount": 1,
"total": 1,
"discount": 1,
"exempt_amount": 1,
"non_taxed_amount": 1,
"base_amount": 1,
"vat_breakdown": [
{
"tax_rate_id": 1,
"base_amount": 1,
"tax_amount": 1
}
],
"manual_account_allocations": {
"gravado21": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado27": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado105": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado25": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado5": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"non_taxed_amount": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exento": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_amount": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"notes": "<string>",
"exchange_rate": 123,
"pdf_path": "<string>"
}
'import requests
url = "https://api.lapyme.com.ar/api/v1/purchases/{purchase_id}"
payload = {
"voucher_type": 2,
"items": [
{
"quantity": 123,
"unit_cost": 1,
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"subtotal": 1,
"total": 1,
"tax_rate_id": 1,
"is_exempt": True,
"discount_percentage": 50,
"purchase_order_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center1_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center2_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center3_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"import_source_purchase_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customs_dispatch_number": "<string>",
"supplier_invoice_number": "<string>",
"invoice_date": "2023-12-25",
"account_date": "2023-12-25",
"due_date": "2023-12-25",
"payment_term_days": 182,
"vat_perception_amount": 1,
"national_tax_amount": 1,
"gross_income_tax_amount": 1,
"gross_income_tax_breakdown": [
{
"province_id": 123,
"amount": 1
}
],
"municipal_tax_amount": 1,
"internal_tax_amount": 1,
"other_tax_amount": 1,
"warehouse_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"products_received": True,
"update_product_variant_cost": True,
"subtotal": 1,
"tax_amount": 1,
"total": 1,
"discount": 1,
"exempt_amount": 1,
"non_taxed_amount": 1,
"base_amount": 1,
"vat_breakdown": [
{
"tax_rate_id": 1,
"base_amount": 1,
"tax_amount": 1
}
],
"manual_account_allocations": {
"gravado21": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado27": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado105": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado25": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado5": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"non_taxed_amount": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exento": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_amount": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"notes": "<string>",
"exchange_rate": 123,
"pdf_path": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
voucher_type: 2,
items: [
{
quantity: 123,
unit_cost: 1,
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
subtotal: 1,
total: 1,
tax_rate_id: 1,
is_exempt: true,
discount_percentage: 50,
purchase_order_item_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cost_center1_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cost_center2_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cost_center3_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
supplier_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
import_source_purchase_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customs_dispatch_number: '<string>',
supplier_invoice_number: '<string>',
invoice_date: '2023-12-25',
account_date: '2023-12-25',
due_date: '2023-12-25',
payment_term_days: 182,
vat_perception_amount: 1,
national_tax_amount: 1,
gross_income_tax_amount: 1,
gross_income_tax_breakdown: [{province_id: 123, amount: 1}],
municipal_tax_amount: 1,
internal_tax_amount: 1,
other_tax_amount: 1,
warehouse_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
products_received: true,
update_product_variant_cost: true,
subtotal: 1,
tax_amount: 1,
total: 1,
discount: 1,
exempt_amount: 1,
non_taxed_amount: 1,
base_amount: 1,
vat_breakdown: [{tax_rate_id: 1, base_amount: 1, tax_amount: 1}],
manual_account_allocations: {
gravado21: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
gravado27: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
gravado105: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
gravado25: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
gravado5: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
non_taxed_amount: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
exento: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
base_amount: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
notes: '<string>',
exchange_rate: 123,
pdf_path: '<string>'
})
};
fetch('https://api.lapyme.com.ar/api/v1/purchases/{purchase_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.lapyme.com.ar/api/v1/purchases/{purchase_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([
'voucher_type' => 2,
'items' => [
[
'quantity' => 123,
'unit_cost' => 1,
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'subtotal' => 1,
'total' => 1,
'tax_rate_id' => 1,
'is_exempt' => true,
'discount_percentage' => 50,
'purchase_order_item_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'cost_center1_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'cost_center2_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'cost_center3_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'supplier_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'import_source_purchase_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customs_dispatch_number' => '<string>',
'supplier_invoice_number' => '<string>',
'invoice_date' => '2023-12-25',
'account_date' => '2023-12-25',
'due_date' => '2023-12-25',
'payment_term_days' => 182,
'vat_perception_amount' => 1,
'national_tax_amount' => 1,
'gross_income_tax_amount' => 1,
'gross_income_tax_breakdown' => [
[
'province_id' => 123,
'amount' => 1
]
],
'municipal_tax_amount' => 1,
'internal_tax_amount' => 1,
'other_tax_amount' => 1,
'warehouse_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'products_received' => true,
'update_product_variant_cost' => true,
'subtotal' => 1,
'tax_amount' => 1,
'total' => 1,
'discount' => 1,
'exempt_amount' => 1,
'non_taxed_amount' => 1,
'base_amount' => 1,
'vat_breakdown' => [
[
'tax_rate_id' => 1,
'base_amount' => 1,
'tax_amount' => 1
]
],
'manual_account_allocations' => [
'gravado21' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'gravado27' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'gravado105' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'gravado25' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'gravado5' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'non_taxed_amount' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'exento' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'base_amount' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'notes' => '<string>',
'exchange_rate' => 123,
'pdf_path' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.lapyme.com.ar/api/v1/purchases/{purchase_id}"
payload := strings.NewReader("{\n \"voucher_type\": 2,\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_cost\": 1,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"subtotal\": 1,\n \"total\": 1,\n \"tax_rate_id\": 1,\n \"is_exempt\": true,\n \"discount_percentage\": 50,\n \"purchase_order_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center1_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center2_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center3_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"import_source_purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customs_dispatch_number\": \"<string>\",\n \"supplier_invoice_number\": \"<string>\",\n \"invoice_date\": \"2023-12-25\",\n \"account_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"payment_term_days\": 182,\n \"vat_perception_amount\": 1,\n \"national_tax_amount\": 1,\n \"gross_income_tax_amount\": 1,\n \"gross_income_tax_breakdown\": [\n {\n \"province_id\": 123,\n \"amount\": 1\n }\n ],\n \"municipal_tax_amount\": 1,\n \"internal_tax_amount\": 1,\n \"other_tax_amount\": 1,\n \"warehouse_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"products_received\": true,\n \"update_product_variant_cost\": true,\n \"subtotal\": 1,\n \"tax_amount\": 1,\n \"total\": 1,\n \"discount\": 1,\n \"exempt_amount\": 1,\n \"non_taxed_amount\": 1,\n \"base_amount\": 1,\n \"vat_breakdown\": [\n {\n \"tax_rate_id\": 1,\n \"base_amount\": 1,\n \"tax_amount\": 1\n }\n ],\n \"manual_account_allocations\": {\n \"gravado21\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado27\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado105\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado25\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado5\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"non_taxed_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exento\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"base_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"notes\": \"<string>\",\n \"exchange_rate\": 123,\n \"pdf_path\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.lapyme.com.ar/api/v1/purchases/{purchase_id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"voucher_type\": 2,\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_cost\": 1,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"subtotal\": 1,\n \"total\": 1,\n \"tax_rate_id\": 1,\n \"is_exempt\": true,\n \"discount_percentage\": 50,\n \"purchase_order_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center1_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center2_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center3_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"import_source_purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customs_dispatch_number\": \"<string>\",\n \"supplier_invoice_number\": \"<string>\",\n \"invoice_date\": \"2023-12-25\",\n \"account_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"payment_term_days\": 182,\n \"vat_perception_amount\": 1,\n \"national_tax_amount\": 1,\n \"gross_income_tax_amount\": 1,\n \"gross_income_tax_breakdown\": [\n {\n \"province_id\": 123,\n \"amount\": 1\n }\n ],\n \"municipal_tax_amount\": 1,\n \"internal_tax_amount\": 1,\n \"other_tax_amount\": 1,\n \"warehouse_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"products_received\": true,\n \"update_product_variant_cost\": true,\n \"subtotal\": 1,\n \"tax_amount\": 1,\n \"total\": 1,\n \"discount\": 1,\n \"exempt_amount\": 1,\n \"non_taxed_amount\": 1,\n \"base_amount\": 1,\n \"vat_breakdown\": [\n {\n \"tax_rate_id\": 1,\n \"base_amount\": 1,\n \"tax_amount\": 1\n }\n ],\n \"manual_account_allocations\": {\n \"gravado21\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado27\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado105\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado25\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado5\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"non_taxed_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exento\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"base_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"notes\": \"<string>\",\n \"exchange_rate\": 123,\n \"pdf_path\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lapyme.com.ar/api/v1/purchases/{purchase_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voucher_type\": 2,\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_cost\": 1,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"subtotal\": 1,\n \"total\": 1,\n \"tax_rate_id\": 1,\n \"is_exempt\": true,\n \"discount_percentage\": 50,\n \"purchase_order_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center1_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center2_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center3_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"import_source_purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customs_dispatch_number\": \"<string>\",\n \"supplier_invoice_number\": \"<string>\",\n \"invoice_date\": \"2023-12-25\",\n \"account_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"payment_term_days\": 182,\n \"vat_perception_amount\": 1,\n \"national_tax_amount\": 1,\n \"gross_income_tax_amount\": 1,\n \"gross_income_tax_breakdown\": [\n {\n \"province_id\": 123,\n \"amount\": 1\n }\n ],\n \"municipal_tax_amount\": 1,\n \"internal_tax_amount\": 1,\n \"other_tax_amount\": 1,\n \"warehouse_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"products_received\": true,\n \"update_product_variant_cost\": true,\n \"subtotal\": 1,\n \"tax_amount\": 1,\n \"total\": 1,\n \"discount\": 1,\n \"exempt_amount\": 1,\n \"non_taxed_amount\": 1,\n \"base_amount\": 1,\n \"vat_breakdown\": [\n {\n \"tax_rate_id\": 1,\n \"base_amount\": 1,\n \"tax_amount\": 1\n }\n ],\n \"manual_account_allocations\": {\n \"gravado21\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado27\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado105\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado25\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado5\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"non_taxed_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exento\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"base_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"notes\": \"<string>\",\n \"exchange_rate\": 123,\n \"pdf_path\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"object": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"voucher_type": "<string>",
"import_source_purchase_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customs_dispatch_number": "<string>",
"supplier_invoice_number": "<string>",
"invoice_date": "<string>",
"account_date": "<string>",
"due_date": "<string>",
"payment_term_days": 182,
"vat_perception_amount": 1,
"national_tax_amount": 1,
"gross_income_tax_amount": 1,
"gross_income_tax_breakdown": [
{
"province_id": 123,
"amount": 1
}
],
"municipal_tax_amount": 1,
"internal_tax_amount": 1,
"other_tax_amount": 1,
"subtotal": 1,
"tax_amount": 1,
"exempt_amount": 1,
"total": 1,
"balance": 123,
"discount": 1,
"vat_breakdown": [
{
"tax_rate_id": 1,
"base_amount": 1,
"tax_amount": 1
}
],
"notes": "<string>",
"currency": "<string>",
"exchange_rate": "<string>",
"pdf_path": "<string>",
"document": {
"url": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"supplier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"tax_id": "<string>",
"tax_id_type": "<string>",
"tax_category": "<string>",
"address": "<string>",
"city": "<string>",
"province_id": "<string>",
"postal_code": "<string>",
"payment_term_id": "<string>",
"payment_term_days": 182
},
"warehouse": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"quantity": 123,
"unit_cost": 1,
"subtotal": 1,
"tax_rate_id": 1,
"is_exempt": true,
"total": 1,
"discount_percentage": 123,
"purchase_order_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sku": "<string>",
"name": "<string>"
},
"purchase_order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"formatted_order_number": "<string>"
}
}
],
"accounting": {
"object": "<string>",
"journal_entry_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"journal_entries_url": "<string>",
"warnings": [
{
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Solicitud inválida",
"retryable": false,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "API key faltante o inválida",
"retryable": false,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Scopes insuficientes",
"retryable": false,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Compra no encontrada",
"retryable": false,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Precondición de negocio no satisfecha",
"retryable": false,
"details": []
}
}{
"request_id": "req_rate_limit_1",
"error": {
"type": "rate_limit_error",
"code": "RATE_LIMITED",
"message": "The organization request limit was reached. Try again later.",
"retryable": true,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Error interno del servidor",
"retryable": false,
"details": []
}
}Actualizar compra
Actualiza una compra existente y devuelve el detalle persistido. El campo items es requerido y reemplaza los renglones de la compra. Requiere Idempotency-Key.
curl --request PUT \
--url https://api.lapyme.com.ar/api/v1/purchases/{purchase_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"voucher_type": 2,
"items": [
{
"quantity": 123,
"unit_cost": 1,
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"subtotal": 1,
"total": 1,
"tax_rate_id": 1,
"is_exempt": true,
"discount_percentage": 50,
"purchase_order_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center1_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center2_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center3_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"import_source_purchase_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customs_dispatch_number": "<string>",
"supplier_invoice_number": "<string>",
"invoice_date": "2023-12-25",
"account_date": "2023-12-25",
"due_date": "2023-12-25",
"payment_term_days": 182,
"vat_perception_amount": 1,
"national_tax_amount": 1,
"gross_income_tax_amount": 1,
"gross_income_tax_breakdown": [
{
"province_id": 123,
"amount": 1
}
],
"municipal_tax_amount": 1,
"internal_tax_amount": 1,
"other_tax_amount": 1,
"warehouse_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"products_received": true,
"update_product_variant_cost": true,
"subtotal": 1,
"tax_amount": 1,
"total": 1,
"discount": 1,
"exempt_amount": 1,
"non_taxed_amount": 1,
"base_amount": 1,
"vat_breakdown": [
{
"tax_rate_id": 1,
"base_amount": 1,
"tax_amount": 1
}
],
"manual_account_allocations": {
"gravado21": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado27": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado105": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado25": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado5": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"non_taxed_amount": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exento": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_amount": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"notes": "<string>",
"exchange_rate": 123,
"pdf_path": "<string>"
}
'import requests
url = "https://api.lapyme.com.ar/api/v1/purchases/{purchase_id}"
payload = {
"voucher_type": 2,
"items": [
{
"quantity": 123,
"unit_cost": 1,
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"subtotal": 1,
"total": 1,
"tax_rate_id": 1,
"is_exempt": True,
"discount_percentage": 50,
"purchase_order_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center1_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center2_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_center3_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"import_source_purchase_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customs_dispatch_number": "<string>",
"supplier_invoice_number": "<string>",
"invoice_date": "2023-12-25",
"account_date": "2023-12-25",
"due_date": "2023-12-25",
"payment_term_days": 182,
"vat_perception_amount": 1,
"national_tax_amount": 1,
"gross_income_tax_amount": 1,
"gross_income_tax_breakdown": [
{
"province_id": 123,
"amount": 1
}
],
"municipal_tax_amount": 1,
"internal_tax_amount": 1,
"other_tax_amount": 1,
"warehouse_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"products_received": True,
"update_product_variant_cost": True,
"subtotal": 1,
"tax_amount": 1,
"total": 1,
"discount": 1,
"exempt_amount": 1,
"non_taxed_amount": 1,
"base_amount": 1,
"vat_breakdown": [
{
"tax_rate_id": 1,
"base_amount": 1,
"tax_amount": 1
}
],
"manual_account_allocations": {
"gravado21": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado27": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado105": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado25": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gravado5": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"non_taxed_amount": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exento": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_amount": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"notes": "<string>",
"exchange_rate": 123,
"pdf_path": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
voucher_type: 2,
items: [
{
quantity: 123,
unit_cost: 1,
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
subtotal: 1,
total: 1,
tax_rate_id: 1,
is_exempt: true,
discount_percentage: 50,
purchase_order_item_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cost_center1_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cost_center2_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cost_center3_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
supplier_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
import_source_purchase_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customs_dispatch_number: '<string>',
supplier_invoice_number: '<string>',
invoice_date: '2023-12-25',
account_date: '2023-12-25',
due_date: '2023-12-25',
payment_term_days: 182,
vat_perception_amount: 1,
national_tax_amount: 1,
gross_income_tax_amount: 1,
gross_income_tax_breakdown: [{province_id: 123, amount: 1}],
municipal_tax_amount: 1,
internal_tax_amount: 1,
other_tax_amount: 1,
warehouse_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
products_received: true,
update_product_variant_cost: true,
subtotal: 1,
tax_amount: 1,
total: 1,
discount: 1,
exempt_amount: 1,
non_taxed_amount: 1,
base_amount: 1,
vat_breakdown: [{tax_rate_id: 1, base_amount: 1, tax_amount: 1}],
manual_account_allocations: {
gravado21: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
gravado27: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
gravado105: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
gravado25: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
gravado5: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
non_taxed_amount: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
exento: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
base_amount: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
notes: '<string>',
exchange_rate: 123,
pdf_path: '<string>'
})
};
fetch('https://api.lapyme.com.ar/api/v1/purchases/{purchase_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.lapyme.com.ar/api/v1/purchases/{purchase_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([
'voucher_type' => 2,
'items' => [
[
'quantity' => 123,
'unit_cost' => 1,
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'subtotal' => 1,
'total' => 1,
'tax_rate_id' => 1,
'is_exempt' => true,
'discount_percentage' => 50,
'purchase_order_item_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'cost_center1_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'cost_center2_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'cost_center3_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'supplier_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'import_source_purchase_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customs_dispatch_number' => '<string>',
'supplier_invoice_number' => '<string>',
'invoice_date' => '2023-12-25',
'account_date' => '2023-12-25',
'due_date' => '2023-12-25',
'payment_term_days' => 182,
'vat_perception_amount' => 1,
'national_tax_amount' => 1,
'gross_income_tax_amount' => 1,
'gross_income_tax_breakdown' => [
[
'province_id' => 123,
'amount' => 1
]
],
'municipal_tax_amount' => 1,
'internal_tax_amount' => 1,
'other_tax_amount' => 1,
'warehouse_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'products_received' => true,
'update_product_variant_cost' => true,
'subtotal' => 1,
'tax_amount' => 1,
'total' => 1,
'discount' => 1,
'exempt_amount' => 1,
'non_taxed_amount' => 1,
'base_amount' => 1,
'vat_breakdown' => [
[
'tax_rate_id' => 1,
'base_amount' => 1,
'tax_amount' => 1
]
],
'manual_account_allocations' => [
'gravado21' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'gravado27' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'gravado105' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'gravado25' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'gravado5' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'non_taxed_amount' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'exento' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'base_amount' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'notes' => '<string>',
'exchange_rate' => 123,
'pdf_path' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.lapyme.com.ar/api/v1/purchases/{purchase_id}"
payload := strings.NewReader("{\n \"voucher_type\": 2,\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_cost\": 1,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"subtotal\": 1,\n \"total\": 1,\n \"tax_rate_id\": 1,\n \"is_exempt\": true,\n \"discount_percentage\": 50,\n \"purchase_order_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center1_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center2_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center3_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"import_source_purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customs_dispatch_number\": \"<string>\",\n \"supplier_invoice_number\": \"<string>\",\n \"invoice_date\": \"2023-12-25\",\n \"account_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"payment_term_days\": 182,\n \"vat_perception_amount\": 1,\n \"national_tax_amount\": 1,\n \"gross_income_tax_amount\": 1,\n \"gross_income_tax_breakdown\": [\n {\n \"province_id\": 123,\n \"amount\": 1\n }\n ],\n \"municipal_tax_amount\": 1,\n \"internal_tax_amount\": 1,\n \"other_tax_amount\": 1,\n \"warehouse_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"products_received\": true,\n \"update_product_variant_cost\": true,\n \"subtotal\": 1,\n \"tax_amount\": 1,\n \"total\": 1,\n \"discount\": 1,\n \"exempt_amount\": 1,\n \"non_taxed_amount\": 1,\n \"base_amount\": 1,\n \"vat_breakdown\": [\n {\n \"tax_rate_id\": 1,\n \"base_amount\": 1,\n \"tax_amount\": 1\n }\n ],\n \"manual_account_allocations\": {\n \"gravado21\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado27\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado105\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado25\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado5\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"non_taxed_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exento\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"base_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"notes\": \"<string>\",\n \"exchange_rate\": 123,\n \"pdf_path\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.lapyme.com.ar/api/v1/purchases/{purchase_id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"voucher_type\": 2,\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_cost\": 1,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"subtotal\": 1,\n \"total\": 1,\n \"tax_rate_id\": 1,\n \"is_exempt\": true,\n \"discount_percentage\": 50,\n \"purchase_order_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center1_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center2_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center3_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"import_source_purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customs_dispatch_number\": \"<string>\",\n \"supplier_invoice_number\": \"<string>\",\n \"invoice_date\": \"2023-12-25\",\n \"account_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"payment_term_days\": 182,\n \"vat_perception_amount\": 1,\n \"national_tax_amount\": 1,\n \"gross_income_tax_amount\": 1,\n \"gross_income_tax_breakdown\": [\n {\n \"province_id\": 123,\n \"amount\": 1\n }\n ],\n \"municipal_tax_amount\": 1,\n \"internal_tax_amount\": 1,\n \"other_tax_amount\": 1,\n \"warehouse_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"products_received\": true,\n \"update_product_variant_cost\": true,\n \"subtotal\": 1,\n \"tax_amount\": 1,\n \"total\": 1,\n \"discount\": 1,\n \"exempt_amount\": 1,\n \"non_taxed_amount\": 1,\n \"base_amount\": 1,\n \"vat_breakdown\": [\n {\n \"tax_rate_id\": 1,\n \"base_amount\": 1,\n \"tax_amount\": 1\n }\n ],\n \"manual_account_allocations\": {\n \"gravado21\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado27\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado105\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado25\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado5\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"non_taxed_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exento\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"base_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"notes\": \"<string>\",\n \"exchange_rate\": 123,\n \"pdf_path\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lapyme.com.ar/api/v1/purchases/{purchase_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voucher_type\": 2,\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_cost\": 1,\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"subtotal\": 1,\n \"total\": 1,\n \"tax_rate_id\": 1,\n \"is_exempt\": true,\n \"discount_percentage\": 50,\n \"purchase_order_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center1_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center2_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cost_center3_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"import_source_purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customs_dispatch_number\": \"<string>\",\n \"supplier_invoice_number\": \"<string>\",\n \"invoice_date\": \"2023-12-25\",\n \"account_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"payment_term_days\": 182,\n \"vat_perception_amount\": 1,\n \"national_tax_amount\": 1,\n \"gross_income_tax_amount\": 1,\n \"gross_income_tax_breakdown\": [\n {\n \"province_id\": 123,\n \"amount\": 1\n }\n ],\n \"municipal_tax_amount\": 1,\n \"internal_tax_amount\": 1,\n \"other_tax_amount\": 1,\n \"warehouse_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"products_received\": true,\n \"update_product_variant_cost\": true,\n \"subtotal\": 1,\n \"tax_amount\": 1,\n \"total\": 1,\n \"discount\": 1,\n \"exempt_amount\": 1,\n \"non_taxed_amount\": 1,\n \"base_amount\": 1,\n \"vat_breakdown\": [\n {\n \"tax_rate_id\": 1,\n \"base_amount\": 1,\n \"tax_amount\": 1\n }\n ],\n \"manual_account_allocations\": {\n \"gravado21\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado27\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado105\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado25\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"gravado5\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"non_taxed_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exento\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"base_amount\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"notes\": \"<string>\",\n \"exchange_rate\": 123,\n \"pdf_path\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"object": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"voucher_type": "<string>",
"import_source_purchase_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customs_dispatch_number": "<string>",
"supplier_invoice_number": "<string>",
"invoice_date": "<string>",
"account_date": "<string>",
"due_date": "<string>",
"payment_term_days": 182,
"vat_perception_amount": 1,
"national_tax_amount": 1,
"gross_income_tax_amount": 1,
"gross_income_tax_breakdown": [
{
"province_id": 123,
"amount": 1
}
],
"municipal_tax_amount": 1,
"internal_tax_amount": 1,
"other_tax_amount": 1,
"subtotal": 1,
"tax_amount": 1,
"exempt_amount": 1,
"total": 1,
"balance": 123,
"discount": 1,
"vat_breakdown": [
{
"tax_rate_id": 1,
"base_amount": 1,
"tax_amount": 1
}
],
"notes": "<string>",
"currency": "<string>",
"exchange_rate": "<string>",
"pdf_path": "<string>",
"document": {
"url": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"supplier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"tax_id": "<string>",
"tax_id_type": "<string>",
"tax_category": "<string>",
"address": "<string>",
"city": "<string>",
"province_id": "<string>",
"postal_code": "<string>",
"payment_term_id": "<string>",
"payment_term_days": 182
},
"warehouse": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"quantity": 123,
"unit_cost": 1,
"subtotal": 1,
"tax_rate_id": 1,
"is_exempt": true,
"total": 1,
"discount_percentage": 123,
"purchase_order_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sku": "<string>",
"name": "<string>"
},
"purchase_order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"formatted_order_number": "<string>"
}
}
],
"accounting": {
"object": "<string>",
"journal_entry_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"journal_entries_url": "<string>",
"warnings": [
{
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Solicitud inválida",
"retryable": false,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "API key faltante o inválida",
"retryable": false,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Scopes insuficientes",
"retryable": false,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Compra no encontrada",
"retryable": false,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Precondición de negocio no satisfecha",
"retryable": false,
"details": []
}
}{
"request_id": "req_rate_limit_1",
"error": {
"type": "rate_limit_error",
"code": "RATE_LIMITED",
"message": "The organization request limit was reached. Try again later.",
"retryable": true,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Error interno del servidor",
"retryable": false,
"details": []
}
}Authorizations
Incluí tu API key en el header Authorization con el prefijo Bearer.
Headers
Clave estable para deduplicar reintentos de la misma operación.
Path Parameters
ID de la compra
Body
x >= 1Show child attributes
Show child attributes
PES, DOL Rol del comprobante dentro del flujo de importacion.
commercial_invoice, customs_dispatch, customs_dispatch_reversal ID de la factura comercial asociada al despacho aduanero.
Estado de nacionalizacion de la factura comercial de importacion.
pending_nationalization, partially_nationalized, fully_nationalized Numero de despacho aduanero informado por el proveedor. Hasta 32 caracteres.
Numero de comprobante del proveedor. Hasta 120 caracteres.
Fecha del comprobante en formato YYYY-MM-DD.
Fecha contable de la compra en formato YYYY-MM-DD.
Fecha de vencimiento en formato YYYY-MM-DD.
days_7, days_15, days_30, days_45, days_60, days_90, days_30_60, days_30_60_90 Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId.
0 <= x <= 365x >= 0x >= 0x >= 0Show child attributes
Show child attributes
x >= 0x >= 0x >= 0x >= 0x >= 0x >= 0x >= 0x >= 0x >= 0x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
goods, fixed_assets, leases, services Was this page helpful?

