Create new purchase order

End Point

'CreateOrUpdate' API end point is used to create new purchase orders.

POST https://{tenant_name}.p4warehouse.com/api/PurchaseOrderApi/CreateOrUpdate

Headers

Name
Type
Description

ApiKey*

String

System API key

Request Body

Name
Type
Description

"VendorCode"*

String

User assigned vendor number

"PurchaseOrderNumber"

String

Pick ticket number. Number will be generated automatically if the field is empty

"WarehouseCode"*

String

User assigned warehouse number

{
    "$id": "1",
    "PurchaseOrderNumber": "PO-0000033",
    "PurchaseOrderStateEnum": 0,
    "PurchaseOrderState": "Draft",
    "Carrier": null,
    "ReferenceNumber": null,
    "Reference1": null,
    "Reference2": null,
    "Reference3": null,
    "Container": null,
    "Comments": null,
    "CancelDate": null,
    "RequiredDate": null,
    "ReleaseDate": null,
    "ReceivingStarted": null,
    "ReceivingCompleted": null,
    "CloseDate": null,
    "UploadDate": null,
    "UploadedSuceeded": null,
    "UploadMessage": null,
    "AppointmentNumber": null,
    "AppointmentDate": null,
    "ParentBackOrderId": null,
    "ParentBackOrder": null,
    "BackOrders": null,
    "DockDoorId": null,
    "DockDoor": null,
    "WarehouseId": "1ab1f713-a451-4019-9e3c-25624374508c",
    "Warehouse": {
        "$id": "2",
        "WarehouseCode": "01",
        "IsDiscontinued": false,
        "Name": "Warehouse1",
        "Description": "Demo_Warehouse_1",
        "Phone": "708-519-0932",
        "ReferenceNumber": null,
        "Reference1": null,
        "Reference2": null,
        "Reference3": null,
        "Zones": [],
        "DefaultUsers": [],
        "DockDoors": [],
        "MinMax": [],
        "PurchaseOrders": [
            {
                "$ref": "1"
            }
        ],
        "ProductionOrders": [],
        "CustomerReturns": [],
        "TruckLoads": [],
        "Address1": "3607 Hog Camp Road",
        "Address2": "2",
        "City": "Burr Ridge",
        "StateProvince": "IL",
        "ZipPostalCode": "61257",
        "Country": "US",
        "AddressHash": "3607 Hog Camp Road2Burr RidgeIL61257US",
        "Id": "1ab1f713-a451-4019-9e3c-25624374508c",
        "DateCreated": "2022-05-04T17:22:29.5472225+00:00",
        "TypeName": "Pro4Soft.TenantData.Entities.Business.Warehousing.Warehouse",
        "TypeNameShort": "Warehouse"
    },
    "ClientId": null,
    "Client": null,
    "VendorId": "a69a50b4-4116-4525-8d35-43be41822250",
    "Vendor": {
        "$id": "3",
        "VendorCode": "AB01",
        "PurchaseOrders": [
            {
                "$ref": "1"
            }
        ],
        "ClientId": null,
        "Client": null,
        "CompanyName": "A and B Supplier",
        "ProductExpiryAllowance": null,
        "Description": "DemoVendor01",
        "Logo": null,
        "ReceivingSlipDisclaimer": null,
        "IsGeneratePoBackOrder": null,
        "ContactPerson": "Jane Brown",
        "Email": "anbcontact@domain.com",
        "Phone": "872226517",
        "Info1": null,
        "Info2": null,
        "Info3": null,
        "Info4": null,
        "Info5": null,
        "Info6": null,
        "Info7": null,
        "Info8": null,
        "Info9": null,
        "Info10": null,
        "IsEmailReceivingSlips": false,
        "Address1": "4310 N Whipple",
        "Address2": "5",
        "City": "Chicago",
        "StateProvince": "IL",
        "ZipPostalCode": "60618",
        "Country": "United States",
        "AddressHash": "4310 N Whipple5ChicagoIL60618United States",
        "Id": "a69a50b4-4116-4525-8d35-43be41822250",
        "DateCreated": "2022-07-13T17:07:08.2188395+00:00",
        "TypeName": "Pro4Soft.TenantData.Entities.Business.Purchasing.Vendor",
        "TypeNameShort": "Vendor"
    },
    "IsWarehouseTransfer": false,
    "WarehouseTransferPickTicketId": null,
    "WarehouseTransferPickTicket": null,
    "Lines": [],
    "AssignedUserId": null,
    "AssignedUser": null,
    "Tag1": null,
    "Tag2": null,
    "Tag3": null,
    "Tag4": null,
    "Tag5": null,
    "Info1": null,
    "Info2": null,
    "Info3": null,
    "Info4": null,
    "Info5": null,
    "Info6": null,
    "Info7": null,
    "Info8": null,
    "Info9": null,
    "Info10": null,
    "Id": "1f263997-ad5a-46d4-819e-52bc1b6834c5",
    "DateCreated": "2023-08-18T16:29:46.343921+00:00",
    "TypeName": "Pro4Soft.TenantData.Entities.Business.Purchasing.PurchaseOrder",
    "TypeNameShort": "PurchaseOrder"
}
```

JSON Example

Here is an example of a JSON payload to create new purchase order with PO number, vendor code, reference number, and item lines.

{
   "VendorCode":"AB01",
   "WarehouseCode":"01",
   "PurchaseOrderNumber":"0001",
   "ReferenceNumber":"123456789",
   "Lines":[{
        "Sku":"PRODUCT_A",
        "OrderedQuantity":5
    },
    {
        "Sku":"PRODUCT_B",
        "OrderedQuantity":5
    }
    ]
}