curl --request POST \
--url https://api.lapyme.com.ar/api/v1/sales \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"customer_id": "550e8400-e29b-41d4-a716-446655440101",
"voucher_type": 1,
"point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
"invoice_date": "2026-08-21",
"currency": "ARS",
"items": [
{
"product_id": "9c692e8b-0f9a-4f7c-8b99-061a2eb188ae",
"warehouse_id": "550e8400-e29b-41d4-a716-446655440010",
"quantity": 1,
"unit_price": 10000,
"tax_rate_id": 5
}
],
"total": 12100
}
'{
"request_id": "req_sale_commit_1",
"data": {
"sale": {
"sale_id": "cf19b3ae-4c08-48be-b9d7-e6f2f5baf609",
"customer_id": null,
"voucher_type": "90",
"point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
"invoice_number": 84,
"formatted_invoice_number": "PRES-00001-00000084",
"invoice_status": "not_required",
"invoice_date": "2026-04-18",
"due_date": "2026-04-18",
"currency": "ARS",
"subtotal": 8264,
"tax_amount": 1736,
"total": 10000,
"exempt_amount": 0,
"non_taxed_amount": 0,
"tributes_amount": 0,
"discount_amount": 0,
"balance": 10000,
"created_at": "2026-04-18T12:00:00.000Z"
},
"normalized_sale": {
"customer_id": null,
"customer_tax_category_override": null,
"voucher_type": 90,
"point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
"register_id": null,
"operator_id": null,
"invoice_date": "2026-04-18",
"due_date": "2026-04-18",
"service_from": null,
"service_to": null,
"currency": "ARS",
"exchange_rate": null,
"same_currency_payment": false,
"notes": null,
"subtotal": 8264,
"tax_amount": 1736,
"total": 10000,
"exempt_amount": 0,
"non_taxed_amount": 0,
"tributes_amount": 0,
"national_perception_amount": 0,
"gross_income_perception_amount": 0,
"gross_income_tax_breakdown": [],
"municipal_perception_amount": 0,
"internal_tribute_amount": 0,
"uncategorized_vat_perception_amount": 0,
"other_tribute_amount": 0,
"discount_type": null,
"discount_value": null,
"discount_amount": 0,
"balance": 10000,
"is_full_amount_pending": false,
"items": [
{
"product_id": null,
"product_name": null,
"sku": null,
"warehouse_id": null,
"name": "Technical service",
"product_type": "service",
"quantity": 1,
"unit_price": 10000,
"unit_cost": null,
"tax_rate_id": 5,
"is_exempt": false,
"discount": null,
"notes": null,
"account_id": null,
"cost_center1_id": null,
"cost_center2_id": null,
"cost_center3_id": null
}
],
"payment_methods": []
},
"projected_effects": {
"inventory": {
"will_affect_stock": false,
"warehouse_ids": [],
"product_line_count": 0,
"total_quantity": 0
},
"accounting": {
"will_create_sale_entry": true,
"will_create_payment_entry": false
},
"fiscal": {
"invoice_status": "not_required"
},
"payments": {
"will_create_payments": false,
"payment_method_count": 0,
"total_amount": 0,
"pending_amount": 10000
}
},
"idempotent_replay": false
},
"warnings": []
}{
"request_id": "req_sale_1",
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid request for creating sales",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_sale_1",
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "API key is required in the Authorization header",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_sale_1",
"error": {
"code": "FORBIDDEN",
"message": "Your API key does not have permission for this operation",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_sale_1",
"error": {
"code": "IDEMPOTENCY_CONFLICT",
"message": "The same Idempotency-Key was already used with a different sale.",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_sale_1",
"error": {
"code": "PRECONDITION_FAILED",
"message": "The sale could not be created because a business precondition failed.",
"retryable": false,
"details": [
{
"field": "input.payment_methods",
"code": "VALIDATION",
"message": "You cannot send payment_methods when is_full_amount_pending=true"
}
],
"type": "invalid_request_error"
}
}{
"request_id": "req_sale_total_mismatch_1",
"error": {
"type": "business_error",
"code": "BUSINESS_REQUIREMENT_UNMET",
"message": "The declared total does not match the calculated total.",
"retryable": false,
"details": [
{
"field": "input.total",
"code": "TOTAL_MISMATCH",
"message": "The declared total does not match the calculated total.",
"metadata": {
"expected": 12100,
"received": 10000
}
}
]
}
}{
"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_sale_1",
"error": {
"code": "INTERNAL_ERROR",
"message": "Could not process the sale transaction",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}Crear venta
Registra una venta y devuelve sus efectos fiscales, de stock, pagos y contabilidad. Enviá Lapyme-Version: 2026-08-20 para usar el contrato estricto: total es obligatorio, unit_price es neto para comprobantes A y final para comprobantes a consumidor final, y los importes derivados se calculan una sola vez. Omitir el header conserva los campos históricos, total opcional y la configuración de precios con IVA de la organización, de forma deprecada. Ambos contratos calculan el IVA una sola vez. Idempotency-Key solo protege reintentos; si necesitás guardar una referencia externa visible, enviá integration_source e integration_id en el cuerpo.
curl --request POST \
--url https://api.lapyme.com.ar/api/v1/sales \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"customer_id": "550e8400-e29b-41d4-a716-446655440101",
"voucher_type": 1,
"point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
"invoice_date": "2026-08-21",
"currency": "ARS",
"items": [
{
"product_id": "9c692e8b-0f9a-4f7c-8b99-061a2eb188ae",
"warehouse_id": "550e8400-e29b-41d4-a716-446655440010",
"quantity": 1,
"unit_price": 10000,
"tax_rate_id": 5
}
],
"total": 12100
}
'{
"request_id": "req_sale_commit_1",
"data": {
"sale": {
"sale_id": "cf19b3ae-4c08-48be-b9d7-e6f2f5baf609",
"customer_id": null,
"voucher_type": "90",
"point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
"invoice_number": 84,
"formatted_invoice_number": "PRES-00001-00000084",
"invoice_status": "not_required",
"invoice_date": "2026-04-18",
"due_date": "2026-04-18",
"currency": "ARS",
"subtotal": 8264,
"tax_amount": 1736,
"total": 10000,
"exempt_amount": 0,
"non_taxed_amount": 0,
"tributes_amount": 0,
"discount_amount": 0,
"balance": 10000,
"created_at": "2026-04-18T12:00:00.000Z"
},
"normalized_sale": {
"customer_id": null,
"customer_tax_category_override": null,
"voucher_type": 90,
"point_of_sale_id": "550e8400-e29b-41d4-a716-446655440002",
"register_id": null,
"operator_id": null,
"invoice_date": "2026-04-18",
"due_date": "2026-04-18",
"service_from": null,
"service_to": null,
"currency": "ARS",
"exchange_rate": null,
"same_currency_payment": false,
"notes": null,
"subtotal": 8264,
"tax_amount": 1736,
"total": 10000,
"exempt_amount": 0,
"non_taxed_amount": 0,
"tributes_amount": 0,
"national_perception_amount": 0,
"gross_income_perception_amount": 0,
"gross_income_tax_breakdown": [],
"municipal_perception_amount": 0,
"internal_tribute_amount": 0,
"uncategorized_vat_perception_amount": 0,
"other_tribute_amount": 0,
"discount_type": null,
"discount_value": null,
"discount_amount": 0,
"balance": 10000,
"is_full_amount_pending": false,
"items": [
{
"product_id": null,
"product_name": null,
"sku": null,
"warehouse_id": null,
"name": "Technical service",
"product_type": "service",
"quantity": 1,
"unit_price": 10000,
"unit_cost": null,
"tax_rate_id": 5,
"is_exempt": false,
"discount": null,
"notes": null,
"account_id": null,
"cost_center1_id": null,
"cost_center2_id": null,
"cost_center3_id": null
}
],
"payment_methods": []
},
"projected_effects": {
"inventory": {
"will_affect_stock": false,
"warehouse_ids": [],
"product_line_count": 0,
"total_quantity": 0
},
"accounting": {
"will_create_sale_entry": true,
"will_create_payment_entry": false
},
"fiscal": {
"invoice_status": "not_required"
},
"payments": {
"will_create_payments": false,
"payment_method_count": 0,
"total_amount": 0,
"pending_amount": 10000
}
},
"idempotent_replay": false
},
"warnings": []
}{
"request_id": "req_sale_1",
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid request for creating sales",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_sale_1",
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "API key is required in the Authorization header",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_sale_1",
"error": {
"code": "FORBIDDEN",
"message": "Your API key does not have permission for this operation",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_sale_1",
"error": {
"code": "IDEMPOTENCY_CONFLICT",
"message": "The same Idempotency-Key was already used with a different sale.",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_sale_1",
"error": {
"code": "PRECONDITION_FAILED",
"message": "The sale could not be created because a business precondition failed.",
"retryable": false,
"details": [
{
"field": "input.payment_methods",
"code": "VALIDATION",
"message": "You cannot send payment_methods when is_full_amount_pending=true"
}
],
"type": "invalid_request_error"
}
}{
"request_id": "req_sale_total_mismatch_1",
"error": {
"type": "business_error",
"code": "BUSINESS_REQUIREMENT_UNMET",
"message": "The declared total does not match the calculated total.",
"retryable": false,
"details": [
{
"field": "input.total",
"code": "TOTAL_MISMATCH",
"message": "The declared total does not match the calculated total.",
"metadata": {
"expected": 12100,
"received": 10000
}
}
]
}
}{
"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_sale_1",
"error": {
"code": "INTERNAL_ERROR",
"message": "Could not process the sale transaction",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}Authorizations
Incluí tu API key en el header Authorization con el prefijo Bearer.
Headers
Versión fechada del contrato de creación de ventas. Usá 2026-08-20 en integraciones nuevas. Omitirla conserva el contrato de entrada histórico deprecado; ambos contratos calculan el IVA una sola vez.
2026-08-20 Clave única para evitar duplicados al reintentar la misma creación de venta.
1 - 255ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.
1 - 255Body
Crea una venta. El tipo de comprobante define cómo se lee items[].unitPrice: neto sin IVA para comprobantes A (1, 2 y 3) y final con IVA incluido para comprobantes a consumidor final como B (6, 7 y 8). total se compara con el total canónico y la venta se rechaza si no coinciden.
1 <= x <= 95ARS, USD 1Show child attributes
Show child attributes
Total final esperado en centavos. La API lo compara con el total canónico antes de crear la venta o cualquier efecto durable.
x >= 01 - 120Fuente de integracion externa para buscar/conciliar la venta. Debe enviarse junto con integrationId.
1 - 120ID de referencia externa visible en la venta. Debe enviarse junto con integrationSource; no se deriva del header Idempotency-Key.
1 - 2551000percentage, amount x >= 0x >= 0x >= 0Show child attributes
Show child attributes
x >= 0x >= 0x >= 0x >= 0Show child attributes
Show child attributes
Was this page helpful?

