Skip to main content
POST
/
api
/
v1
/
purchase-orders
Crear orden de compra
curl --request POST \
  --url https://api.lapyme.com.ar/api/v1/purchase-orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "order_date": "2023-12-25",
  "warehouse_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "items": [
    {
      "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "ordered_quantity": 1,
      "expected_unit_cost": 4503599627370495
    }
  ],
  "expected_date": "2023-12-25",
  "notes": "<string>"
}
'
{
  "request_id": "<string>",
  "data": {
    "purchase_order": {
      "object": "purchase_order",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "order_number": 0,
      "formatted_order_number": "<string>",
      "status": "draft",
      "order_date": "2023-12-25",
      "expected_date": "2023-12-25",
      "currency": "<string>",
      "supplier": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "description": "<string>",
        "email": "<string>",
        "phone": "<string>",
        "tax_id_type": "<string>",
        "tax_id": "<string>",
        "tax_category": "<string>",
        "payment_term_id": "<string>",
        "address": "<string>",
        "apartment": "<string>",
        "city": "<string>",
        "province": "<string>",
        "postal_code": "<string>"
      },
      "warehouse": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>"
      },
      "created_at": "2023-11-07T05:31:56Z",
      "warehouse_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "notes": "<string>",
      "items": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "ordered_quantity": 123,
          "received_quantity": 123,
          "expected_unit_cost": 4503599627370495,
          "product": {
            "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "name": "<string>",
            "sku": "<string>",
            "product_type": "product",
            "variant_options": {},
            "option_names": [
              "<string>"
            ]
          }
        }
      ]
    },
    "idempotent_replay": true
  },
  "warnings": [
    "<unknown>"
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.lapyme.com.ar/llms.txt

Use this file to discover all available pages before exploring further.

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.

Body

application/json
supplier_id
string<uuid>
required
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)$
order_date
string<date>
required
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])))$
warehouse_id
string<uuid>
required
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)$
items
object[]
required
Required array length: 1 - 500 elements
expected_date
string<date>
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])))$
notes
string
Maximum string length: 4000

Response

Orden de compra creada exitosamente

request_id
string
required
data
object
required
warnings
any[]
required