Discovery API - Test
Example - Place order for product which requires extra data
1. Use Orders API to list products for a property
Example request
curl --request GET \
--location 'https://test.api.servictoria.io/ddp/orders/v1/products?propertyPfi=203487790' \
--header 'customer-id: example123' \
--header 'Authorization: Bearer ******'
Example response (truncated)
Take note of the "extraData" field, the elements in this array indicate which extra data types this product requires. In this example, the "vendors" is the required extra data to be provided when ordering this Planning Certificate Express product.
{
"products": [
...
{
"productCode": "PlanningCertificate2",
"productIds": {
"propertyPfi": "203487790",
"authorityId": 373
},
"productName": "Planning Certificate Express",
"productDescription": "Planning Certificate as per Schedule 1 Section 199(2) Planning and Environment Act 1987 Provides information regarding the planning scheme as it affects a property at a given date. May include: zoning of the land and, if applicable, overlay planning controls; reservations that affect the land; classified roads abutting the land; and proposals contained in an exhibited amendment to the planning scheme.For most areas of Victoria the certificate issuing authority is the local council. However, in most of the metropolitan area the Minister administering the Planning and Environment Act 1987, is the responsible authority for issuing certificates.",
"productAvailability": "AVAILABLE",
"authorityName": "Department of Environment, Land, Water & Planning",
"price": 782,
"gst": 0,
"turnaroundTime": 1,
"turnaroundTimeUnit": "DAY",
"customerWarning": "Planning certificates takes longer to return if: 1) multiple lot / plan numbers are supplied, or 2) the lot / plan number is not supplied",
"extraData": [
{
"key": "vendors"
}
]
},
...
]
}
2. Submit order with extra data
Example request
Note: The "vendors" extra data has a required format which can be found in the Orders API Specification, Orders API -> Specification -> Types -> Extra Data.
curl --request POST \
--location 'https://test.api.servictoria.io/ddp/orders/v1' \
--header 'customer-id: example123' \
--header 'customer-reference: Example customer reference' \
--header 'Authorization: Bearer ******' \
--data-raw '{
"products": [
{
"productCode": "PlanningCertificate2",
"productIds": {
"propertyPfi": "203487790",
"authorityId": 373
},
"isWarningAcknowledged": true,
"extraData": {
"vendors": [
{
"vendorType": "INDIVIDUAL",
"firstName": "John",
"lastName": "Citizen"
}
]
}
}
],
"deliveryPreference": "EMAIL",
"email": "john.citizen@example.com",
"contactName": "John Citizen"
}'
Example response
{
"orderId": "11839134",
"totalPrice": 782,
"totalGst": 0,
"itemsOrdered": [
{
"orderItemNumber": 1,
"productCode": "PlanningCertificate2",
"productIds": {
"propertyPfi": "203487790",
"authorityId": 373
},
"productName": "Planning Certificate Express",
"authorityName": "Department of Environment, Land, Water & Planning",
"price": 782,
"gst": 0,
"discounts": []
}
]
}