Skip to main content
POST
/
api
/
v1
/
orders
Crear pedido
curl --request POST \
  --url https://api.lapyme.com.ar/api/v1/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "assigned_warehouse_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "totals": {
    "subtotal": 1,
    "tax_amount": 1,
    "total": 1
  },
  "lines": [
    {
      "product_name_snapshot": "<string>",
      "sku_snapshot": "<string>",
      "ordered_quantity": 123,
      "unit_price": 1,
      "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "tax_rate_id": 123,
      "discount_amount": 1,
      "discount_percentage": 50
    }
  ],
  "order_date": "2023-11-07T05:31:56Z",
  "notes": "<string>",
  "discount_amount": 1
}
'
{
  "request_id": "<string>",
  "data": {
    "order": {
      "object": "<string>",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "order_number": "<string>",
      "raw_order_number": 123,
      "order_date": "2023-11-07T05:31:56Z",
      "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "customer_name": "<string>",
      "customer_tax_id": "<string>",
      "items_count": 123,
      "total_units": 123,
      "discount_amount": 1,
      "subtotal": 1,
      "tax_amount": 1,
      "total": 1,
      "notes": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "created_by_name": "<string>",
      "created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "line_items": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "line_number": 123,
          "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "product_name": "<string>",
          "sku": "<string>",
          "ordered_quantity": 123,
          "allocated_quantity": 123,
          "fulfilled_quantity": 123,
          "invoiced_quantity": 123,
          "cancelled_quantity": 123,
          "unit_price": 1,
          "tax_rate_id": 123,
          "discount_amount": 123,
          "discount_percentage": 123,
          "subtotal": 1
        }
      ],
      "active_warehouses": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "name": "<string>",
          "is_default": true
        }
      ],
      "pending_preparation_warehouse_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "preparations": [
        {
          "object": "<string>",
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "prepared_at": "2023-11-07T05:31:56Z",
          "warehouse_name": "<string>",
          "remito_delivery_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "formatted_remito_number": "<string>",
          "lines": [
            {
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "order_line_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "product_name": "<string>",
              "sku": "<string>",
              "variant_options": {},
              "option_names": [
                "<string>"
              ],
              "quantity": 123,
              "ordered_quantity": 123,
              "unit_price": 1,
              "discount_percentage": 123
            }
          ]
        }
      ],
      "invoices": [
        {
          "object": "<string>",
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "formatted_invoice_number": "<string>",
          "invoice_date": "<string>",
          "created_at": "2023-11-07T05:31:56Z",
          "items_count": 123,
          "total_units": 123,
          "total": 1
        }
      ]
    },
    "idempotent_replay": true,
    "result": "<unknown>"
  },
  "warnings": [
    "<unknown>"
  ]
}

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
customer_id
string<uuid>
required
assigned_warehouse_id
string<uuid>
required
totals
object
required
lines
object[]
required
Minimum array length: 1
delivery_method
enum<string>
Available options:
shipping,
local_delivery,
pickup
order_date
string<date-time>
currency
enum<string>
Available options:
PES,
DOL
notes
string
discount_amount
integer
Required range: x >= 0

Response

Pedido creado exitosamente

request_id
string
required
data
object
required
warnings
any[]
required