API Menu

ABC Supply APIs

Pricing API

The Partners Pricing Experience API supports the submission of various tier codes, quantities and unit of measure. It returns the total price of each item.

  • The Partners Pricing Experience API supports the submission of various tier codes, quantities and unit of measure. It returns the total price of each item.
  • Experience layer API takes JSON payload as a request body along with client id & secret as header params.
  • Request is passed to the customer pricing process API which determines if the requested branch is agility.
  • If the request belongs to the agility branch, then the pricing v3 system API is used to fetch the price of the requested products.
  • If the request does not belong to the agility branch, then the pricing v2 system API is used to fetch the price of the requested products.
  • Response of the API is in JSON format along with the appropriate status code.

Authentication

tbd


Usage

tbd

End Points

RESOURCE: POST /pricing
DESCRIPTION: tbd


Request


curl "http://abcsupply{env}-partner-pricing.us-e1.cloudhub.io/api/abc/v1/pricing" \
  -X POST \
  -d "{\r\n    \"order_id\": \"00000000-0000-0000-0000-000000000000\",\r\n    \"source\": \"Hover\",\r\n    \"pricing\": {\r\n        \"customer_number\": \"100\",\r\n        \"branch_number\": \"354\",\r\n        \"purpose\": \"order\",\r\n        \"tiers\": [\r\n            {\r\n                \"item_number\": \"ABE34MB\",\r\n                \"quantity\": \"1\",\r\n                \"unit\": \"PC\"\r\n            },\r\n            {\r\n                \"tier_code\": \"0.1.22.289.1230.23.58.50MICDX12\",\r\n                \"quantity\": \"7\",\r\n                \"unit\": \"SH\"\r\n            },\r\n            {\r\n                \"tier_code\": \"0.1.22.289.1230.23.58.50MICDX12345789\",\r\n                \"quantity\": \"1\",\r\n                \"unit\": \"SH\"\r\n            }\r\n        ]\r\n    }\r\n}" \
  -H "X-Account-Realm: " \
  -H "Authorization: "


POST /api/abc/v1/pricing HTTP/1.1
Host: abcsupply{env}-partner-pricing.us-e1.cloudhub.io:80
X-Account-Realm: 
Authorization: 

{
    "order_id": "00000000-0000-0000-0000-000000000000",
    "source": "Hover",
    "pricing": {
        "customer_number": "100",
        "branch_number": "354",
        "purpose": "order",
        "tiers": [
            {
                "item_number": "ABE34MB",
                "quantity": "1",
                "unit": "PC"
            },
            {
                "tier_code": "0.1.22.289.1230.23.58.50MICDX12",
                "quantity": "7",
                "unit": "SH"
            },
            {
                "tier_code": "0.1.22.289.1230.23.58.50MICDX12345789",
                "quantity": "1",
                "unit": "SH"
            }
        ]
    }
}


const headers = new Headers();
headers.append('X-Account-Realm', '');
headers.append('Authorization', '');

const body = `{
    "order_id": "00000000-0000-0000-0000-000000000000",
    "source": "Hover",
    "pricing": {
        "customer_number": "100",
        "branch_number": "354",
        "purpose": "order",
        "tiers": [
            {
                "item_number": "ABE34MB",
                "quantity": "1",
                "unit": "PC"
            },
            {
                "tier_code": "0.1.22.289.1230.23.58.50MICDX12",
                "quantity": "7",
                "unit": "SH"
            },
            {
                "tier_code": "0.1.22.289.1230.23.58.50MICDX12345789",
                "quantity": "1",
                "unit": "SH"
            }
        ]
    }
}`;

const init = {
  method: 'POST',
  headers,
  body
};

fetch('http://abcsupply{env}-partner-pricing.us-e1.cloudhub.io/api/abc/v1/pricing', init)
.then((response) => {
  return response.json(); // or .text() or .blob() ...
})
.then((text) => {
  // text is the response body
})
.catch((e) => {
  // error in e.message


import requests

url = 'http://abcsupply{env}-partner-pricing.us-e1.cloudhub.io/api/abc/v1/pricing'
headers = {'X-Account-Realm': '','Authorization': ''}
body = """{
    "order_id": "00000000-0000-0000-0000-000000000000",
    "source": "Hover",
    "pricing": {
        "customer_number": "100",
        "branch_number": "354",
        "purpose": "order",
        "tiers": [
            {
                "item_number": "ABE34MB",
                "quantity": "1",
                "unit": "PC"
            },
            {
                "tier_code": "0.1.22.289.1230.23.58.50MICDX12",
                "quantity": "7",
                "unit": "SH"
            },
            {
                "tier_code": "0.1.22.289.1230.23.58.50MICDX12345789",
                "quantity": "1",
                "unit": "SH"
            }
        ]
    }
}"""

req = requests.post(url, headers=headers, data=body)

print(req.status_code)
print(req.headers)
print(req.text)

Response

Body

  • Media type: application/json
  • Any instance of data is allowed.
  • The API file specifies body for this request but it does not specify the data model.


{
    "ok": "true",
    "pricing": {
        "customer_number": "48714500",
        "branch_number": "396",
        "purpose": "Test",
        "request_id": "907be550-439c-11eb-96d0-0042380bb3f0",
        "tiers": [
            {
                "tier_code": "0.7.27.118.6266.23.1204.AAE23ZZ",
                "quantity": "1",
                "unit": "SQ",
                "price_available": false,
                "price": 0,
                "unit_price": 0,
                "failure_messages": [
                    {
                        "message": "Customer '48714500' having branch number '396' is unauthorized to fetch details for '0.7.27.118.6266.23.1204.XXXXXX' tier code."
                    }
                ]
            },
            {
                "tier_code": "0.7.27.118.6266.23.1204.AAE23RB",
                "quantity": "2",
                "unit": "PC",
                "price_available": true,
                "price": 3.00,
                "unit_price": 1.50,
                "failure_messages": []
            },
            {
                "tier_code": "0.7.27.118.6266.23.1204.11GATP10",
                "quantity": "3",
                "unit": "PC",
                "price_available": false,
                "price": 0,
                "unit_price": 0,
                "failure_messages": [
                    {
                        "message": "UOM conversion not found"
                    }
                ]
            },
            {
                "tier_code": "0.7.27.118.6266.23.1204.11GATP10",
                "quantity": "3",
                "unit": "RL",
                "price_available": true,
                "price": 477.00,
                "unit_price": 159.00,
                "failure_messages": []
            }
        ],
        "ok": true
    },
    "order_id": "123",
    "source": "ABCSupply"
}

POST /initialize_order


Request

Headers

  • X-Account-Realm
    • String Required
    • Client-id
  • Authorization
    • String Required
    • Client-secret

Body


{
    "order_id": "00000000-0000-0000-0000-000000000000",
    "source": "Hover",
    "pricing": {
        "customer_number": "100",
        "branch_number": "354",
        "purpose": "order",
        "tiers": [
            {
                "item_number": "ABE34MB",
                "quantity": "1",
                "unit": "PC"
            },
            {
                "tier_code": "0.1.22.289.1230.23.58.50MICDX12",
                "quantity": "7",
                "unit": "SH"
            },
            {
                "tier_code": "0.1.22.289.1230.23.58.50MICDX12345789",
                "quantity": "1",
                "unit": "SH"
            }
        ]
    }
}


curl "http://abcsupply{env}-partner-pricing.us-e1.cloudhub.io/api/abc/v1/initialize_order" \
  -X POST \
  -d "{\n  \"order_id\": \"\",\n  \"source\": \"\",\n  \"date_created\": \"\"\n}" \
  -H "X-Account-Realm: " \
  -H "Authorization: " 


POST /api/abc/v1/initialize_order HTTP/1.1
Host: abcsupply{env}-partner-pricing.us-e1.cloudhub.io:80
X-Account-Realm: 
Authorization: 

{
  "order_id": "",
  "source": "",
  "date_created": ""
}


const headers = new Headers();
headers.append('X-Account-Realm', '');
headers.append('Authorization', '');

const body = `{
  "order_id": "",
  "source": "",
  "date_created": ""
}`;

const init = {
  method: 'POST',
  headers,
  body
};

fetch('http://abcsupply{env}-partner-pricing.us-e1.cloudhub.io/api/abc/v1/initialize_order', init)
.then((response) => {
  return response.json(); // or .text() or .blob() ...
})
.then((text) => {
  // text is the response body
})
.catch((e) => {
  // error in e.message
});


import requests

url = 'http://abcsupply{env}-partner-pricing.us-e1.cloudhub.io/api/abc/v1/initialize_order'
headers = {'X-Account-Realm': '','Authorization': ''}
body = """{
  "order_id": "",
  "source": "",
  "date_created": ""
}"""

req = requests.post(url, headers=headers, data=body)

print(req.status_code)
print(req.headers)
print(req.text)

Response

Body

  • Media type: application/json
  • Any instance of data is allowed.
  • The API file specifies body for this request but it does not specify the data model.



{ 
  "ok": true, 
  "order_id": "guid", 
  "source": "request source identifier", 
  "date_created": "ISO Timestamp with timezone" 
}

Headers

  • X-Account-Realm
    • String Required
    • Client-id
  • Authorization
    • String Required
    • Client-secret

Body

  • Media type: application/json


{  "customer": {    "username": "",    "first_name": "",    "last_name": "",    "email": "",    "company": ""  },  "pricing": {    "purpose": "",    "tiers": [      {        "tier_code": "",        "quantity": "",        "unit": ""      }    ]  },  "customer_number": "",  "branch_number": "",  "order_id": "",  "source": "",  "submit": false,  "date_submitted": ""}

Request


curl "http://abcsupply{env}-partner-pricing.us-e1.cloudhub.io/api/abc/v1/submit_order" \
  -X POST \
  -d "{\n  \"customer\": {\n    \"username\": \"\",\n    \"first_name\": \"\",\n    \"last_name\": \"\",\n    \"email\": \"\",\n    \"company\": \"\"\n  },\n  \"pricing\": {\n    \"purpose\": \"\",\n    \"tiers\": [\n      {\n        \"tier_code\": \"\",\n        \"quantity\": \"\",\n        \"unit\": \"\"\n      }\n    ]\n  },\n  \"customer_number\": \"\",\n  \"branch_number\": \"\",\n  \"order_id\": \"\",\n  \"source\": \"\",\n  \"submit\": false,\n  \"date_submitted\": \"\"\n}" \
  -H "X-Account-Realm: " \
  -H "Authorization: " 


POST /api/abc/v1/submit_order HTTP/1.1
Host: abcsupply{env}-partner-pricing.us-e1.cloudhub.io:80
X-Account-Realm: 
Authorization: 

{
  "customer": {
    "username": "",
    "first_name": "",
    "last_name": "",
    "email": "",
    "company": ""
  },
  "pricing": {
    "purpose": "",
    "tiers": [
      {
        "tier_code": "",
        "quantity": "",
        "unit": ""
      }
    ]
  },
  "customer_number": "",
  "branch_number": "",
  "order_id": "",
  "source": "",
  "submit": false,
  "date_submitted": ""
}


const headers = new Headers();
headers.append('X-Account-Realm', '');
headers.append('Authorization', '');

const body = `{
  "customer": {
    "username": "",
    "first_name": "",
    "last_name": "",
    "email": "",
    "company": ""
  },
  "pricing": {
    "purpose": "",
    "tiers": [
      {
        "tier_code": "",
        "quantity": "",
        "unit": ""
      }
    ]
  },
  "customer_number": "",
  "branch_number": "",
  "order_id": "",
  "source": "",
  "submit": false,
  "date_submitted": ""
}`;

const init = {
  method: 'POST',
  headers,
  body
};

fetch('http://abcsupply{env}-partner-pricing.us-e1.cloudhub.io/api/abc/v1/submit_order', init)
.then((response) => {
  return response.json(); // or .text() or .blob() ...
})
.then((text) => {
  // text is the response body
})
.catch((e) => {
  // error in e.message
});


import requests

url = 'http://abcsupply{env}-partner-pricing.us-e1.cloudhub.io/api/abc/v1/submit_order'
headers = {'X-Account-Realm': '','Authorization': ''}
body = """{
  "customer": {
    "username": "",
    "first_name": "",
    "last_name": "",
    "email": "",
    "company": ""
  },
  "pricing": {
    "purpose": "",
    "tiers": [
      {
        "tier_code": "",
        "quantity": "",
        "unit": ""
      }
    ]
  },
  "customer_number": "",
  "branch_number": "",
  "order_id": "",
  "source": "",
  "submit": false,
  "date_submitted": ""
}"""

req = requests.post(url, headers=headers, data=body)

print(req.status_code)
print(req.headers)
print(req.text)

Response

Body

Media type: application/json

Any instance of data is allowed.

The API file specifies body for this request but it does not specify the data model.


{
"ok": true,
"order_id": "guid",
"source": "request source identifier",
"date_submitted": "ISO Timestamp with timezone"
}

Support

The APIs that ABC Supply offers are designed to improve business transactions with us, and we provide you an expected service level you can integrate into your work flow. In addition, to ensure a highly quality experience for all our users, we monitor and place limits on API requests. Exceeding limits may result in your API access being disabled or revoked, so please be aware of the number of requests. If you have questions about API usage, please contact us at apirequest@abcsupply.com