OnHandBalance (POST)

Overview

This POST API can be used to capture new additions in on hand balance from ERP into SMART to be used as reference in P2P transactions.OnHandBalance processing result can be posted to callbackurl using callbackurl feature. To provide callback URL in the bulk API add “UserContext” http request header along with the data volume.

 

URL Format: 
https://<Instance>/SmartBulkInterfaceAPI/api/OnHandBalance/PostOnHandBalanceDetails
 

Request
[
  {
    "itemNumber": "string",
    "division": "string",
    "entityCode": "string",
    "onHandBalance": 0,
    "errorDescription": "string"
  }
]

 

Response
 {
    "statusCode": 202,
    "url": "https://api-smartuat.gep.com/SmartBulkInterfaceAPI/api/BulkResult/GetBulkResult?batchId= 11dd939547bc4b47ba9f1dc5bb6ae441",
    "batchID": " 11dd939547bc4b47ba9f1dc5bb6ae441",
    "interval": 60,
    "interval Type": "Minutes",
    "receivedCount": 1
}

 

Examples

Success Scenario – Request

Below request only contains mandatory attributes. 

[
    {
        "ItemNumber": "RP_28",
        "Division": null,
        "EntityCode": "1010",
        "OnHandBalance": 20.2,
        "ErrorDescription": null
    }
]

 

Success Scenario – Response

{
    "statusCode": 202,
    "url": "https://api-smartuat.gep.com/SmartBulkInterfaceAPI/api/BulkResult/GetBulkResult?batchId=8660e16ce7394dd3a7c2eb7775e20dae",
    "batchID": "8660e16ce7394dd3a7c2eb7775e20dae",
    "interval": 60,
    "interval Type": "Minutes",
    "receivedCount": 1
}


Success Scenario – GetBulkResult

{
    "status": "Success",
    "onHandBalanceDetails": []
}

 

Error Scenario 1 – Request

The below request contains a missing value of the mandatory attribute – EntityCode.
You will not get any error as such but such a record will not be processed at the catalog API side.

[
    {
        "ItemNumber": "RP_28",
        "Division": null,
        "EntityCode": null,
        "OnHandBalance": 25.2,
        "ErrorDescription": null
    }
]

 

Error Scenario 1 – Response

{
    "statusCode": 202,
    "url": "https://api-smartuat.gep.com/SmartBulkInterfaceAPI/api/BulkResult/GetBulkResult?batchId=8660e16ce7394dd3a7c2eb7775e20dae",
    "batchID": "8660e16ce7394dd3a7c2eb7775e20dae",
    "interval": 60,
    "interval Type": "Minutes",
    "receivedCount": 1
}

 

Error Scenario 1 – Get BulkResult

{
    "status": "Failure",
    "onHandBalanceDetails": [
        {
            "itemNumber": "DE0_IM_36",
            "division": "AMB",
            "entityCode": "",
            "onHandBalance": 45.20,
            "errorDescription": " | OrgEntityCode* : You must provide a value for the attribute. |"
        }
    ]
}

 

Callback URL Scenario - Success Response

{
  "BatchId": "fdfd03acc67848c5ad7f96367bb43d7c",
  "Result": {
    "Status": "Success",
    "onHandBalanceDetails": []
  }
}

 

Callbackurl Scenario - Error Response

{
  "BatchId": "2a209d85d359487c83494375b8f8d109",
  "Result": {
    "status": "Failure",
    "onHandBalanceDetails": [
        {
            "itemNumber": "DE0_IM_36",
            "division": "AMB",
            "entityCode": "",
            "onHandBalance": 45.20,
            "errorDescription": " | OrgEntityCode* : You must provide a value for the attribute. |"
        }
    ] 
 }
}

 

Data Elements

OnHandBalance

Property

Required?

Data type

Description

Validations / Exceptions

ItemNumber

Yes

String (50)

ItemNumber

  • You must provide a value for the attribute.
  • Item Number|Division: Combination already exists. Provide a unique record.

Division

Yes

String (50)

Division

  • You must provide a value for the attribute.
  • You must provide a value for the attribute from the given dropdown.
  • Item Number|Division: Combination already exists. Provide a unique record.

EntityCode

Yes

String

EntityCode

You must provide a value for the attribute from the given dropdown.

OnHandBalance

Yes

Nullable decimal (999999999999.999999)

OnHandBalance

You must provide a value for the attribute.

ErrorDescription

 

String

ErrorDescription