Create/Update Purchase Orders in batch
Create or replace existing Purchase Orders with updates. Can be done in batch. Max size 500. All dates must be in range 1970-01-01 00:00:00 and 2105-12-31 23:59:59 or null (where applicable)
Body Required
externalPONo is required when updating/replacing a PurchaseOrder
-
cancelledDate string
-
completedDate string
-
deliveryStatus number
Status of the Delivery (0: Not Delivered, 1: PartiallyDelivered, 2: FullyDelivered, 3: Cancelled)
Default value is
0
. -
deliveryWindow string
Delivery Window of the Purchase Order
-
externalComment string
Any relevant comment
-
externalPurchaseNo string
External Purchase No
-
factory string
Factory of the Purchase Order
-
id integer
Maddens Purcher Order id
-
items array[object]
The items on the Purchase Order
-
label string
External Description/Label of PO
-
Date that the Purchase Order was created
-
orderType string
Order Type of the Purchase Order
-
transportMethod string
Transport Method of the Purchase Order
POST /v1/purchaseorders/batch
curl \
-X POST https://ma-api.maddenanalytics.com/v1/purchaseorders/batch \
-H "Authorization: $API_KEY" \
-d '[{"cancelledDate":"2021-07-19T14:05:22.257Z","completedDate":"2021-07-19T14:05:22.257Z","deliveryStatus":10,"deliveryWindow":"SS24","externalComment":"AW21 - Footwear","externalPurchaseNo":"PO-14534","factory":"Factory B","id":42,"items":[{"brandName":"Acme","deliveries":[{"deliveryDate":"2021-10-13T09:05:14.113Z","deliveryID":"RP-14534","quantity":4}],"deliveryDate":"2021-07-19T14:05:22.257Z","departureDate":"2021-07-19T14:05:22.257Z","ean":"7340192703345","externalRowID":"21020","externalWarehouseID":"ecom","key":"7340192703345","productName":"Petter","quantity":4,"revisedDeliveryDate":"2021-07-19T14:05:22.257Z","revisedDepartureDate":"2021-07-19T14:05:22.257Z","sku":"123456-001-43","supplier":"Factory B","totalPriceCurrency":"EUR","totalPriceNet":180,"totalPriceVat":0}],"label":"string","orderDate":"2021-03-19T14:05:22.257Z","orderType":"Standard","transportMethod":"Air"}]'
Request example
[
{
"cancelledDate": "2021-07-19T14:05:22.257Z",
"completedDate": "2021-07-19T14:05:22.257Z",
"deliveryStatus": 10,
"deliveryWindow": "SS24",
"externalComment": "AW21 - Footwear",
"externalPurchaseNo": "PO-14534",
"factory": "Factory B",
"id": 42,
"items": [
{
"brandName": "Acme",
"deliveries": [
{
"deliveryDate": "2021-10-13T09:05:14.113Z",
"deliveryID": "RP-14534",
"quantity": 4
}
],
"deliveryDate": "2021-07-19T14:05:22.257Z",
"departureDate": "2021-07-19T14:05:22.257Z",
"ean": "7340192703345",
"externalRowID": "21020",
"externalWarehouseID": "ecom",
"key": "7340192703345",
"productName": "Petter",
"quantity": 4,
"revisedDeliveryDate": "2021-07-19T14:05:22.257Z",
"revisedDepartureDate": "2021-07-19T14:05:22.257Z",
"sku": "123456-001-43",
"supplier": "Factory B",
"totalPriceCurrency": "EUR",
"totalPriceNet": 180,
"totalPriceVat": 0
}
],
"label": "string",
"orderDate": "2021-03-19T14:05:22.257Z",
"orderType": "Standard",
"transportMethod": "Air"
}
]
Response examples (200)
[
{
"message": "Missing BrandName",
"reference": "123456-001-43",
"referenceField": "key",
"statusCode": 400
}
]
Response examples (default)
[
{
"message": "Missing BrandName",
"reference": "123456-001-43",
"referenceField": "key",
"statusCode": 400
}
]