Skip to main content
PUT
/
api
/
v1
/
purchases
/
{purchase_id}
Actualizar compra
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",
  "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>"
}
'
{
  "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>",
    "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>",
    "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>"
    },
    "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>"
        }
      ]
    }
  }
}

Authorizations

Authorization
string
header
required

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

Headers

Idempotency-Key
string
required

Clave estable para deduplicar reintentos de la misma operación.

Path Parameters

purchase_id
string<uuid>
required

ID de la compra

Body

application/json
voucher_type
integer
required
Required range: x >= 1
items
object[]
required
currency
enum<string>
required
Available options:
PES,
DOL
supplier_id
string<uuid>
import_document_role
enum<string> | null

Rol del comprobante dentro del flujo de importacion.

Available options:
commercial_invoice,
customs_dispatch,
customs_dispatch_reversal
import_source_purchase_id
string<uuid>

ID de la factura comercial asociada al despacho aduanero.

import_nationalization_status
enum<string> | null

Estado de nacionalizacion de la factura comercial de importacion.

Available options:
pending_nationalization,
partially_nationalized,
fully_nationalized
customs_dispatch_number
string

Numero de despacho aduanero informado por el proveedor. Hasta 32 caracteres.

supplier_invoice_number
string

Numero de comprobante del proveedor. Hasta 120 caracteres.

invoice_date
string<date>

Fecha del comprobante en formato YYYY-MM-DD.

account_date
string<date>

Fecha contable de la compra en formato YYYY-MM-DD.

due_date
string<date>

Fecha de vencimiento en formato YYYY-MM-DD.

payment_term_id
enum<string> · null · null
Available options:
days_7,
days_15,
days_30,
days_45,
days_60,
days_90,
days_30_60,
days_30_60_90
vat_perception_amount
integer
Required range: x >= 0
national_tax_amount
integer
Required range: x >= 0
gross_income_tax_amount
integer
Required range: x >= 0
gross_income_tax_breakdown
object[]
municipal_tax_amount
integer
Required range: x >= 0
internal_tax_amount
integer
Required range: x >= 0
other_tax_amount
integer
Required range: x >= 0
warehouse_id
string<uuid> | null
products_received
boolean
update_product_variant_cost
boolean
subtotal
integer
Required range: x >= 0
tax_amount
integer
Required range: x >= 0
total
integer
Required range: x >= 0
discount
integer
Required range: x >= 0
exempt_amount
integer
Required range: x >= 0
non_taxed_amount
integer
Required range: x >= 0
base_amount
integer
Required range: x >= 0
vat_breakdown
object[]
manual_account_allocations
object
notes
string
exchange_rate
number
pdf_path
string
vat_category
enum<string> | null
Available options:
goods,
fixed_assets,
leases,
services

Response

Compra actualizada exitosamente

request_id
string
required
data
object
required