Orders

This describes the order resource in the Provet Dropship API.



Order Properties

Name Type Writeable Required Description
Id string N/A The Provet Id of the Order
Status string N/A The status of the Order as one of the following:
  • Ordered placed in the system
  • Sent sent to the warehouse
  • Picking currently being picked
  • AwaitingStock one or more lines cannot be fulfilled
  • Shipped order has been shipped
  • Cancelled order has been cancelled
Date Date N/A The date the order was submitted
Specified in UTC standard.
PurchaseOrderNumber string POST No The purchase order number
CustomerTitle string POST No
CustomerName string POST Yes
CompanyName string POST No
AddressLine1 string POST Yes
AddressLine2 string POST No
Suburb string POST Yes
State string POST Yes
Postcode string POST Yes
Country string POST Yes
DeliveryInstructions string POST No
CustomerEmail string POST Yes
CustomerPhone string POST Yes
OrderLines array of OrderLine POST Yes


Order Line Properties

Name Type Writeable Required Description
ProductCode string POST Yes The Provet product code of the item to order
Quantity integer POST Yes The quantity of the item to order (must be > 0)
ShippedQuantity integer False N/A The shipped quantity of the item to order


Create an Order

Post JSON body with Content-Type application/json to:

POST ~/api/orders

Returns the order resource including the Provet Id and the order status.

Sample request:

{
    "CustomerName": "Joe Smith",
    "AddressLine1": "123 Address Street",
    "Suburb": "Suburb",
    "State": "NSW",
    "Postcode": "2222",
    "Country": "Australia",
    "CustomerEmail": "joe.smith@email.com",
    "CustomerPhone": "0412345678",
    "OrderLines": [
        {
            "ProductCode": "fron 01",
            "Quantity": 4
        }
    ]
}

Sample response:

{
    "id": 464,
    "status": "Ordered",
    "date": "2017-08-07T03:25:20.1235600Z",
    "orderLines": [
        {
            "productCode": "FRON 01",
            "quantity": 4,
            "shippedQuantity": 0,
            "status": null
        }
    ],
    "purchaseOrderNumber": null,
    "customerTitle": null,
    "customerName": "Joe Smith",
    "companyName": null,
    "addressLine1": "123 Address Street",
    "addressLine2": null,
    "suburb": "Suburb",
    "state": "NSW",
    "postcode": "2222",
    "country": "Australia",
    "deliveryInstructions": null,
    "customerEmail": "joe.smith@email.com",
    "customerPhone": "0412345678"
}


Get an Order

Gets the order with the specified Id.
This is most useful for getting the status of an order that has been previously sent to Provet.

GET ~/api/orders/{id}

Returns a 404 - Not Found if the id is invalid.

Sample response:

{
    "id": 464,
    "status": "Picking",
    "date": "2017-08-07T03:25:20.1230000Z",
    "orderLines": [
        {
            "productCode": "FRON 01",
            "quantity": 4,
            "shippedQuantity": 0,
            "status": null
        }
    ],
    "purchaseOrderNumber": null,
    "customerTitle": null,
    "customerName": "Joe Smith",
    "companyName": null,
    "addressLine1": "123 Address Street",
    "addressLine2": null,
    "suburb": "Suburb",
    "state": "NSW",
    "postcode": "2222",
    "country": "Australia",
    "deliveryInstructions": null,
    "customerEmail": "joe.smith@email.com",
    "customerPhone": "0412345678"
}


List all Orders

GET ~/api/orders
Name Type Description
DateFrom Date The date to start the order list from
DateTo Date The date to end the order list on
Status String Status of the order
PurchaseOrderNumber String

Returns a collection of all the orders that have been posted, newest to oldest.

Sample response:

[
    {
        "id": 464,
        "status": "Picking",
        "date": "2017-08-07T03:25:20.1230000Z",
        "orderLines": [
            {
                "productCode": "FRON 01",
                "quantity": 4,
                "shippedQuantity": 0,
                "status": null
            }
        ],
        "purchaseOrderNumber": null,
        "customerTitle": null,
        "customerName": "Joe Smith",
        "companyName": null,
        "addressLine1": "123 Address Street",
        "addressLine2": null,
        "suburb": "Suburb",
        "state": "NSW",
        "postcode": "2222",
        "country": "Australia",
        "deliveryInstructions": null,
        "customerEmail": "joe.smith@email.com",
        "customerPhone": "0412345678"
    },

	// more orders here ...

]


Testing Sandbox only

Orders will automatically have their status progressed every 10 minutes.

Although Dropship handles the status updates, you can get the sandbox to change the status to Cancelled or Awaiting Stock by using the following data during order creation.


Testing a Cancelled Order

To test a cancelled order, place the word cancel in the DeliveryInstructions field.
Note: Orders cannot be cancelled from a client request. This is to simulate an order being cancelled from Provet.

{ "DeliveryInstructions": "cancel" }

Testing Awaiting Stock

To test a line that cannot be fulfilled (out of stock), order a quantity greater than or equal to 1000. The system will recognise this amount and notify via the status Awaiting Stock.

{ "Quantity": "1000" }