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>"
    }
  ],
  "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": "[email protected]",
      "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

invoiceDate
string<date>
required

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

items
object[]
required

Ítems de la venta

Minimum array length: 1
subtotal
integer
required

Subtotal en centavos (sin IVA)

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

Monto de IVA en centavos

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

Total en centavos

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

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

dueDate
string<date>

Fecha de vencimiento (YYYY-MM-DD)

exemptAmount
integer

Monto exento en centavos

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

Monto no gravado en centavos

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,
false
data
object
required