🚚
Steadfast - Integration
  • Introduction
  • Authentication
  • Order API
  • Order Status API
    • Using Endpoint
    • Using Webhook
  • Stock Quantity API
Powered by GitBook
On this page

Was this helpful?

Order API

A new Order can be created using Order API. Integration partners will call the endpoint given below to send an order. When an order is sent, a new order is created into Steadfast systems.

Order API URL is different for different integration partners and it is shared with each customer separately.

2.1 Order Endpoint

The order endpoint will look like the one below.

Order API

POST https://middleware.podapp.com.au/passthrough/customerorder

Headers

Name
Type
Description

X-Steadfast-Api-Key

string

API Key Name that must be passed in request headers

Request Body

Name
Type
Description

request body

json

Please see below.

{
    "Message": "Ok",
    "ResponseMessage": {
        "Success": true,
        "TokenChanged": false,
        "ErrorMessage": "",
        "NewToken": "00000000000000000000000000000000"
    },
    "TotalQueryRows": 0
}
{
    "StatusCode": 401,
    "Message": "Authentication failed. Invalid Api Key."
}
{
    "StatusCode": 401,
    "Message": "No Api Key is provided. Api Key is missing in request headers."
}
{
    "StatusCode": 404,
    "Message": "Endpoint gerardorder Not Found. Api in Not Active."
}
{
    "StatusCode": 404,
    "Message": "Endpoint gerardorder1 Not Found. No Api is configured at gerardorder1."
}
{
    "StatusCode": 500,
    "Message": "There is error while calling Outbound API."
}

2.2 Order Request

{
  "CusRef": "XYRX1",
  "UserName": "XYRX1",
  "Email": "rhys@steadfast.com.au",
  "OrderDate": "2022-04-27T17:39+02",
  "ReceiverName": "Rhys Davies",
  "ReceiverAddress":
  {
      "Address1": "Business Name",
      "Address2": "3 Rundle Street",
      "Suburb": "Adelaide",
      "State": "SA",
      "Postcode": "5000",
      "Country": "AUSTRALIA"
  },
  "Depot": "5W",
  "SrvCode": "ROAD",
  "ColCode": "5W",
  "Weight": 9,
  "Items": [
    {
      "ProductCode": "1000662",
      "Quantity": 2
    }
  ]
}
{
    "CusRef": "72906",
    "UserName": "72906",
    "Email": "rhys@steadfast.net.au",
    "OrderDate": "25/04/2021 13:56",
    "ReceiverName": "Rhys Davies",
    "ReceiverAddress":
    {
        "Address1": "15 Duffy Street",
        "Address2": "Unit 1",
        "Suburb": "ESSENDON NORTH",
        "State": "VIC",
        "Postcode": "3041",
        "Country": "AUSTRALIA"
    },
    "Depot": "5W",
    "DelInstructions": "Deliver to side entrance",
    "Value": 349.99,
    "SrvCode": "PRIORITY",
    "ColCode": "5W",
    "Phone": "0410111304",
    "Items" : [
        {
            "ProductCode": "1000662",
            "Quantity": 1
        }
    ]
}
{
    "CusRef": "72906",
    "UserName": "72906",
    "OrderDate": "25/04/2021 13:56",
    "ReceiverCode": null,
    "ReceiverName": "Rhys Davies",
    "ReceiverAddress":
    {
        "Address1": "15 Duffy Street",
        "Address2": "Unit 1",
        "Suburb": "ESSENDON NORTH",
        "State": "VIC",
        "Postcode": "3041",
        "Country": "AUSTRALIA"
    },
    "Depot": "5W",
    "PromoName": null,
    "PromoCodes": null,
    "Instructions": null,
    "DelInstructions": "Deliver to side entrance",
    "DelReference": null,
    "InsReference": null,
    "Value": 349.99,
    "DriverCode" : null,
    "SrvCode": "PRIORITY",
    "ConsReference": null,
    "ColCode": "5W",
    "Ncases": null,
    "Weight": null,
    "Cubic": null,
    "Phone": "0410111304",
    "Email": "rhys@steadfast.net.au",
    "Items" : [
        {
            "ProductCode": "1000662",
            "Quantity": 1
        }
    ]
}

2.3 Order data validation

Order data will be validated and any validation errors will be sent back in response. Which-ever data field is required and is not present in the request, it will be added to the errors list in response.

Order data should follow these rules

  • Fields that are shown null are optional fields. Optional fields can be missed from the order object and the system will not validate those missing fields.

  • Example Request 2 shows JSON request body only mandatory fields.

  • OrderDate should be in ISO8601 format

  • ReceiverAddress should be passed as a JSON object

  • Items array is mandatory. An empty array of items will raise a validation error.

  • Items array is a list of product items objects with ProductCode and Quantity

2.4 Order Request - Response

When a new Order is created successfully in the system HTTP 200 is returened with this data response. In case there are validation errors, an array of errors ValidationErrors is returned in the response.

{
    "Success": true,
    "ErrorMessage": null,
    "ValidationErrors": []
}
{
    "Success": false,
    "ErrorMessage": "This is error message",
    "ValidationErrors": [
        "Validation error # 1",
        "Validation error # 2",
        "Validation error # 3"
    ]
}

PreviousAuthenticationNextOrder Status API

Last updated 1 year ago

Was this helpful?