Skip to main content
POST
/
api
/
v1
/
sales
Crear nueva venta
curl --request POST \
  --url https://api.lapyme.com.ar/api/v1/sales \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "voucherType": 48,
  "pointOfSaleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceDate": "2023-12-25",
  "items": [
    {
      "quantity": 4503599627370496,
      "unitPrice": 4503599627370495,
      "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "warehouseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "taxRateId": 6,
      "unitCost": 4503599627370495,
      "discountPercentage": 50
    }
  ],
  "subtotal": 4503599627370495,
  "taxAmount": 4503599627370495,
  "total": 4503599627370495,
  "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "dueDate": "2023-12-25",
  "exemptAmount": 4503599627370495,
  "nonTaxedAmount": 4503599627370495,
  "discountType": "percentage",
  "discountValue": 1,
  "discountAmount": 4503599627370495,
  "notes": "<string>",
  "paymentMethods": [
    {
      "methodId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "amount": 4503599627370496,
      "description": "<string>",
      "reference": "<string>",
      "registerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "safeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  ],
  "integrationSource": "<string>",
  "integrationId": "<string>"
}
'
{
  "success": true,
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "invoiceNumber": 123,
    "formattedInvoiceNumber": "<string>",
    "invoiceDate": "2023-12-25",
    "dueDate": "2023-12-25",
    "serviceFrom": "2023-12-25",
    "serviceTo": "2023-12-25",
    "currency": "<string>",
    "subtotal": 123,
    "taxAmount": 123,
    "total": 123,
    "balance": 123,
    "concept": 123,
    "notes": "<string>",
    "fiscalNotes": "<string>",
    "integrationSource": "<string>",
    "integrationId": "<string>",
    "customer": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "email": "jsmith@example.com",
      "phone": "<string>",
      "taxId": "<string>",
      "address": "<string>",
      "apartment": "<string>",
      "city": "<string>",
      "province": "<string>"
    },
    "items": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "quantity": 123,
        "unitPrice": 123,
        "unitCost": 123,
        "taxRateId": 123,
        "discountPercentage": "<string>",
        "product": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "name": "<string>",
          "sku": "<string>"
        },
        "warehouse": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "name": "<string>"
        }
      }
    ],
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Incluí tu API key en el header Authorization con el prefijo Bearer

Body

application/json
voucherType
integer
required

Tipo de comprobante AFIP (ej: 1=FA, 6=FB, 11=FC, 90=Presupuesto)

Required range: 1 <= x <= 95
pointOfSaleId
string<uuid>
required

ID del punto de venta

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
invoiceDate
string<date>
required

Fecha de la venta (YYYY-MM-DD, no puede ser futura)

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
items
object[]
required

Ítems de la venta

Minimum array length: 1
subtotal
integer
required

Subtotal en centavos (compatibilidad: no autoritativo, el backend persiste el valor canónico)

Required range: 0 <= x <= 9007199254740991
taxAmount
integer
required

Monto de IVA en centavos (compatibilidad: no autoritativo, el backend persiste el valor canónico)

Required range: 0 <= x <= 9007199254740991
total
integer
required

Total en centavos (compatibilidad: no autoritativo, el backend persiste el valor canónico)

Required range: 0 <= x <= 9007199254740991
customerId
string<uuid>

ID del cliente (opcional, usa cliente por defecto si no se especifica)

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
dueDate
string<date>

Fecha de vencimiento (YYYY-MM-DD)

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
exemptAmount
integer

Monto exento en centavos (compatibilidad: no autoritativo, el backend persiste el valor canónico)

Required range: 0 <= x <= 9007199254740991
nonTaxedAmount
integer

Monto no gravado en centavos (compatibilidad: no autoritativo, el backend persiste el valor canónico)

Required range: 0 <= x <= 9007199254740991
discountType
enum<string>

Tipo de descuento global ('fixed' para monto fijo)

Available options:
percentage,
fixed
discountValue
number

Valor del descuento

Required range: x >= 0
discountAmount
integer

Monto de descuento en centavos

Required range: 0 <= x <= 9007199254740991
notes
string

Notas de la venta

Maximum string length: 1000
paymentMethods
object[]

Métodos de pago (opcional, si no se especifica la venta queda pendiente de pago)

integrationSource
string

Fuente de integración externa (ej: 'MI_ERP')

Maximum string length: 50
integrationId
string

ID de referencia de la integración externa

Maximum string length: 100

Response

Venta creada exitosamente

success
enum<boolean>
required
Available options:
true
data
object
required