API

Actualizar compra

Changed on

Actualiza una compra existente y devuelve el detalle persistido. El campo items es requerido y reemplaza los renglones de la compra. Requiere Idempotency-Key.

put/api/v1/purchases/{purchase_id}

Request

  • Base URL
    https://api.lapyme.com.ar
  • URL
    https://api.lapyme.com.ar/api/v1/purchases/{purchase_id}
  • Auth
    HTTP bearer

Path parameters

purchase_idstring uuid required

ID de la compra

Headers

Idempotency-Keystring required

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

Request body

supplier_idstring uuid
voucher_typeinteger required
import_document_role'commercial_invoice' | 'customs_dispatch' | 'customs_dispatch_reversal'
import_source_purchase_idstring uuid

ID de la factura comercial asociada al despacho aduanero.

import_nationalization_status'pending_nationalization' | 'partially_nationalized' | 'fully_nationalized'
cost_target_purchase_idstring uuid nullable

Compra recibida a cuyo costo promedio suma este comprobante sin productos. null lo quita.

customs_dispatch_numberstring

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

supplier_invoice_numberstring

Numero de comprobante del proveedor. Hasta 120 caracteres.

invoice_datestring date

Fecha del comprobante en formato YYYY-MM-DD.

account_datestring date

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

due_datestring date

Fecha de vencimiento en formato YYYY-MM-DD.

payment_term_id'days_7' | 'days_15' | 'days_30' | 'days_45' | 'days_60' | 'days_90' | 'days_30_60' | 'days_30_60_90'
payment_term_daysinteger nullable

Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se prefiere sobre paymentTermId.

vat_perception_amountinteger
national_tax_amountinteger
gross_income_tax_amountinteger
municipal_tax_amountinteger
internal_tax_amountinteger
other_tax_amountinteger
warehouse_idstring uuid nullable
products_receivedboolean
products_returnedboolean

If true, a supplier credit note returns product quantities from the selected warehouse. Requires warehouseId. Invalid on non-credit purchases.

update_product_variant_costboolean
subtotalinteger
tax_amountinteger
totalinteger
discountinteger
exempt_amountinteger
non_taxed_amountinteger
base_amountinteger
notesstring
currency'ARS' | 'USD' required
exchange_ratenumber
pdf_pathstring
vat_category'goods' | 'fixed_assets' | 'leases' | 'services'

Response

Compra actualizada exitosamente

request_idstring required

Changes

    • breaking

      removed the enum value DOL of the request property

    • breaking

      removed the enum value PES of the request property

    • breaking

      the request property's minLength was increased from 0 to 1

    • breaking

      the // request property's minLength was increased from 0 to 1

    • breaking

      the request property's minLength was increased from 0 to 1

    • breaking

      the request property's minLength was increased from 0 to 1

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property // became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property // became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property ///// became nullable for the status

    • breaking

      the response property ///// became nullable for the status

    • breaking

      the response property ///// became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property / became nullable for the status

    • warning

      the request property's maxLength was set to 32

    • warning

      the // request property's maxLength was set to 255

    • warning

      the request property's maxLength was set to 1000

    • warning

      the request property's maxLength was set to 2000

    • warning

      the request property's maxLength was set to 120

    • info

      added the new optional request property

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property

    • info

      added the new ARS enum value to the request property

    • info

      added the new USD enum value to the request property

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      response property data/account_date list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/accounting/journal_entries_url list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/customs_dispatch_number list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/document/url list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/due_date list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/invoice_date list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/items/items/discount_percentage list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/items/items/is_exempt list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/items/items/name list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/items/items/product/anyOf[subschema #1]/name list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/items/items/product/anyOf[subschema #1]/sku list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/items/items/purchase_order/anyOf[subschema #1]/formatted_order_number list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/notes list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/pdf_path list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier/anyOf[subschema #1]/address list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier/anyOf[subschema #1]/city list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier/anyOf[subschema #1]/email list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier/anyOf[subschema #1]/name list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier/anyOf[subschema #1]/payment_term_id list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier/anyOf[subschema #1]/phone list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier/anyOf[subschema #1]/postal_code list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier/anyOf[subschema #1]/province_id list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier/anyOf[subschema #1]/tax_category list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier/anyOf[subschema #1]/tax_id list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier/anyOf[subschema #1]/tax_id_type list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      response property data/supplier_invoice_number list-of-types was narrowed by removing types null from media type application/json of response 200

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property /// to the response with the status

    • info

      added the required property /// to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status