GolfManager Logo V3 API
Version 2025-12-15

Create a stock order

Allows to create a stock order with its lines in a single API call.

POST https://eu.golfmanager.com/api/stock/createOrder.json

Parameters

{
    "supplier": "int?",
    "date": "date?",
    "estimatedDeliveryDate": "date?",
    "globalDiscount": "float?",
    "comments": "string?",
    "lines": "array"
}

Example request with numeric product IDs:

{
    "supplier": 1,
    "date": "2025-01-20",
    "estimatedDeliveryDate": "2025-01-25",
    "globalDiscount": 5,
    "comments": "Pedido de emergencia",
    "lines": [
        {
            "product": 123,
            "amount": 10,
            "grossUnitCost": 15.50,
            "discount": 2
        },
        {
            "product": 456,
            "amount": 5,
            "grossUnitCost": 20.00
        }
    ]
}

Example request with product object (creates or finds by barcode):

{
    "supplier": 1,
    "date": "2025-01-20",
    "comments": "Pedido con productos nuevos",
    "lines": [
        {
            "product": {
                "barcode": "7501234567890",
                "name": "Producto Nuevo",
                "price": 25.00,
                "useStock": true
            },
            "amount": 5,
            "grossUnitCost": 20.00
        }
    ]
}

Response

Returns the complete order with all lines loaded from the database:

{
   "id": 42,
   "number": "PED-001",
   "supplier": 1,
   "date": "2025-01-20T00:00:00Z",
   "estimatedDeliveryDate": "2025-01-25T00:00:00Z",
   "globalDiscount": 5,
   "comments": "Pedido de emergencia",
   "status": 0,
   "amount": 15,
   "total": 229.25,
   "lines": [
      {
         "id": 100,
         "stockOrder": 42,
         "product": 123,
         "productName": "Producto A",
         "grossUnitCost": 15.50,
         "amount": 10,
         "discount": 2,
         "total": 147.00
      },
      {
         "id": 101,
         "stockOrder": 42,
         "product": 456,
         "productName": "Producto B",
         "grossUnitCost": 20.00,
         "amount": 5,
         "discount": 0,
         "total": 95.00
      }
   ]
}

Notes