curl --request POST \
--url https://api.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_date": "2023-12-25",
"calculation_base": 1,
"is_inscripto": true,
"exclude_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exchange_rate": 123,
"applications": [
{
"purchase_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"applied_amount": 123
}
],
"journal_line_applications": [
{
"journal_line_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"applied_amount": 123
}
]
}
'import requests
url = "https://api.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias"
payload = {
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_date": "2023-12-25",
"calculation_base": 1,
"is_inscripto": True,
"exclude_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exchange_rate": 123,
"applications": [
{
"purchase_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"applied_amount": 123
}
],
"journal_line_applications": [
{
"journal_line_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"applied_amount": 123
}
]
}
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({
supplier_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
payment_date: '2023-12-25',
calculation_base: 1,
is_inscripto: true,
exclude_payment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
exchange_rate: 123,
applications: [{purchase_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', applied_amount: 123}],
journal_line_applications: [{journal_line_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', applied_amount: 123}]
})
};
fetch('https://api.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias', 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/supplier-payments/preview-ganancias",
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([
'supplier_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'payment_date' => '2023-12-25',
'calculation_base' => 1,
'is_inscripto' => true,
'exclude_payment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'exchange_rate' => 123,
'applications' => [
[
'purchase_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'applied_amount' => 123
]
],
'journal_line_applications' => [
[
'journal_line_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'applied_amount' => 123
]
]
]),
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.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias"
payload := strings.NewReader("{\n \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_date\": \"2023-12-25\",\n \"calculation_base\": 1,\n \"is_inscripto\": true,\n \"exclude_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exchange_rate\": 123,\n \"applications\": [\n {\n \"purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\n }\n ],\n \"journal_line_applications\": [\n {\n \"journal_line_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\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.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_date\": \"2023-12-25\",\n \"calculation_base\": 1,\n \"is_inscripto\": true,\n \"exclude_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exchange_rate\": 123,\n \"applications\": [\n {\n \"purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\n }\n ],\n \"journal_line_applications\": [\n {\n \"journal_line_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias")
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 \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_date\": \"2023-12-25\",\n \"calculation_base\": 1,\n \"is_inscripto\": true,\n \"exclude_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exchange_rate\": 123,\n \"applications\": [\n {\n \"purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\n }\n ],\n \"journal_line_applications\": [\n {\n \"journal_line_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"object": "supplier_payment_ganancias_preview",
"should_withhold": true,
"calculation_base": 123,
"accumulated_base_total": 123,
"minimum_non_taxable": 123,
"taxable_amount": 123,
"rate": 123,
"gross_withholding": 123,
"previous_withholdings": 123,
"net_withholding": 123,
"minimum_threshold": 123,
"final_withholding": 123,
"supplier_name": "<string>",
"is_inscripto_en_ganancias": true,
"person_type": "FISICA",
"breakdown": [
{
"label": "<string>",
"value": 123,
"formatted_value": "<string>"
}
],
"exempt_reason": "<string>",
"progressive_scale_details": {
"bracket": "<string>",
"fixed_amount": 123,
"rate": 123,
"excess_over": 123
}
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Datos inválidos",
"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": "Proveedor o compras aplicadas no encontrados",
"retryable": false,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Condición ARCA sin resolver",
"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",
"retryable": false,
"details": []
}
}{
"request_id": "req_auth_capacity_1",
"error": {
"type": "api_error",
"code": "INTERNAL_ERROR",
"message": "La verificación de credenciales está ocupada. Reintentá más tarde.",
"retryable": true,
"details": []
}
}Calcular retención de Ganancias sin registrar un pago
Operación de solo lectura. No requiere Idempotency-Key ni emite certificados. Usa los pagos elegibles del mes. Enviá las mismas aplicaciones, moneda y tipo de cambio que el pago: sin calculation_base, la base se calcula con las compras aplicadas y se devuelve en calculation_base junto a final_withholding. Sin calculation_base, devuelve 400 con detalle GANANCIAS_CALCULATION_BASE_REQUIRED cuando no hay aplicaciones o alguna aplica un saldo que no es una compra. No recibe créditos: para un pago que también los aplica, enviá calculation_base. Una compra en otra moneda que currency devuelve 400 con detalle GANANCIAS_INVALID_INPUT. Crear el pago recalcula con un bloqueo mensual; un cambio que desbalancea los medios de pago devuelve 409 STATE_CONFLICT con detalle GANANCIAS_CALCULATION_MISMATCH. Un fallo ARCA devuelve 422 BUSINESS_REQUIREMENT_UNMET con detalle GANANCIAS_STATUS_UNRESOLVED, salvo override explícito is_inscripto.
curl --request POST \
--url https://api.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_date": "2023-12-25",
"calculation_base": 1,
"is_inscripto": true,
"exclude_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exchange_rate": 123,
"applications": [
{
"purchase_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"applied_amount": 123
}
],
"journal_line_applications": [
{
"journal_line_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"applied_amount": 123
}
]
}
'import requests
url = "https://api.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias"
payload = {
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_date": "2023-12-25",
"calculation_base": 1,
"is_inscripto": True,
"exclude_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exchange_rate": 123,
"applications": [
{
"purchase_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"applied_amount": 123
}
],
"journal_line_applications": [
{
"journal_line_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"applied_amount": 123
}
]
}
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({
supplier_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
payment_date: '2023-12-25',
calculation_base: 1,
is_inscripto: true,
exclude_payment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
exchange_rate: 123,
applications: [{purchase_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', applied_amount: 123}],
journal_line_applications: [{journal_line_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', applied_amount: 123}]
})
};
fetch('https://api.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias', 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/supplier-payments/preview-ganancias",
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([
'supplier_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'payment_date' => '2023-12-25',
'calculation_base' => 1,
'is_inscripto' => true,
'exclude_payment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'exchange_rate' => 123,
'applications' => [
[
'purchase_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'applied_amount' => 123
]
],
'journal_line_applications' => [
[
'journal_line_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'applied_amount' => 123
]
]
]),
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.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias"
payload := strings.NewReader("{\n \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_date\": \"2023-12-25\",\n \"calculation_base\": 1,\n \"is_inscripto\": true,\n \"exclude_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exchange_rate\": 123,\n \"applications\": [\n {\n \"purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\n }\n ],\n \"journal_line_applications\": [\n {\n \"journal_line_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\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.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_date\": \"2023-12-25\",\n \"calculation_base\": 1,\n \"is_inscripto\": true,\n \"exclude_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exchange_rate\": 123,\n \"applications\": [\n {\n \"purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\n }\n ],\n \"journal_line_applications\": [\n {\n \"journal_line_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lapyme.com.ar/api/v1/supplier-payments/preview-ganancias")
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 \"supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_date\": \"2023-12-25\",\n \"calculation_base\": 1,\n \"is_inscripto\": true,\n \"exclude_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"exchange_rate\": 123,\n \"applications\": [\n {\n \"purchase_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\n }\n ],\n \"journal_line_applications\": [\n {\n \"journal_line_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"applied_amount\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"object": "supplier_payment_ganancias_preview",
"should_withhold": true,
"calculation_base": 123,
"accumulated_base_total": 123,
"minimum_non_taxable": 123,
"taxable_amount": 123,
"rate": 123,
"gross_withholding": 123,
"previous_withholdings": 123,
"net_withholding": 123,
"minimum_threshold": 123,
"final_withholding": 123,
"supplier_name": "<string>",
"is_inscripto_en_ganancias": true,
"person_type": "FISICA",
"breakdown": [
{
"label": "<string>",
"value": 123,
"formatted_value": "<string>"
}
],
"exempt_reason": "<string>",
"progressive_scale_details": {
"bracket": "<string>",
"fixed_amount": 123,
"rate": 123,
"excess_over": 123
}
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Datos inválidos",
"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": "Proveedor o compras aplicadas no encontrados",
"retryable": false,
"details": []
}
}{
"request_id": "req_error_1",
"error": {
"type": "invalid_request_error",
"code": "INVALID_REQUEST",
"message": "Condición ARCA sin resolver",
"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",
"retryable": false,
"details": []
}
}{
"request_id": "req_auth_capacity_1",
"error": {
"type": "api_error",
"code": "INTERNAL_ERROR",
"message": "La verificación de credenciales está ocupada. Reintentá más tarde.",
"retryable": true,
"details": []
}
}Authorizations
Body
Was this page helpful?

