PromoStandards integration
PromoStandards suppliers,
in REST and JSON
Suppliers publish their product data, prices, stock, images, orders and invoices as SOAP web services. You call a plain URL and get JSON back. We talk SOAP to the supplier.
The same inventory call, two ways
Stock levels for one product, from the PromoStandards Inventory 2.0.0 service: what you build to call the supplier yourself, and the same request through PSRESTful.
Calling the supplier in SOAP
XML
A POST to that supplier's own endpoint, with the
SOAPAction: getInventoryLevels header:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns="http://www.promostandards.org/WSDL/Inventory/2.0.0/"
xmlns:shar="http://www.promostandards.org/WSDL/Inventory/2.0.0/SharedObjects/">
<soapenv:Header/>
<soapenv:Body>
<ns:GetInventoryLevelsRequest>
<shar:wsVersion>2.0.0</shar:wsVersion>
<shar:id>your-supplier-username</shar:id>
<shar:password>your-supplier-password</shar:password>
<shar:productId>55414</shar:productId>
</ns:GetInventoryLevelsRequest>
</soapenv:Body>
</soapenv:Envelope>
- Each supplier has its own endpoint URL and credentials to find and store.
- Each service and version has its own namespaces, so a 1.2.1 call looks different from a 2.0.0 one.
- The answer is an XML envelope you parse, and suppliers fill it in slightly differently.
Through PSRESTful
JSON
A GET to one URL pattern for every supplier, with your
PSRESTful API key:
curl "https://api.psrestful.com/v2.0.0/suppliers/HIT/inventory/55414" \
-H "X-API-Key: your-api-key"
The answer, cut down to one part:
"Inventory": {
"productId": "55414",
"PartInventoryArray": {
"PartInventory": [
{
"partId": "5414SWHT",
"partColor": "WHITE",
"quantityAvailable": {
"Quantity": { "value": 26, "uom": "EA" }
},
...
}
]
}
}
- Change the supplier code in the URL and the call stays the same.
- Your supplier logins live in PSRESTful, so your code only carries your API key.
- The JSON has the same shape for every supplier.
Example from our inventory guide. The SOAP side follows the PromoStandards Inventory 2.0.0 WSDL.
What PSRESTful does in between
Every call goes through the same three hops.
Your app
Your store, quoting tool or ERP sends a REST request with your API key.
PSRESTful
Builds the SOAP request the supplier expects, with your credentials or our shared ones.
The supplier
Answers in XML from its PromoStandards endpoint. We turn that into JSON for you.
Clear errors
When a supplier's server is down, you get a 502 that says so.
Honest gaps
When a supplier doesn't offer a method, you get the standard PromoStandards "Not Supported" error (code 125).
Cached catalog answers
Repeat calls don't wait on the supplier. Cache Information lists how long for each service.
Why REST and JSON?
Fewer things to learn
With REST (Representational State Transfer), each request is a URL, and the answer comes back in JSON (JavaScript Object Notation), which people can read and every programming language can parse. Most web developers use both every day, so it's easier to find someone, freelancers included, who can build on it.
A smaller option when size matters
JSON isn't always smaller than XML. When size matters, the Product Data, Media Content, Inventory
and Pricing and Configuration endpoints can answer in Protobuf, a compact binary format, if you send
Accept: application/x-protobuf. The
Web Service Validator
shows the three sizes side by side.
Works from any app
The same call works from a backend, a web page or a mobile app. With a public API key, your storefront's JavaScript can call PSRESTful directly, for example to show a supplier's stock.
Documentation you can try
The API is described in an OpenAPI specification, and the interactive reference lets you make a call from the page before writing any code. The same specification can generate client code for most languages.
Or build it yourself
You can build SOAP integrations in-house. Here is what each path asks of you.
In-house SOAP integrations
- One integration per supplier and service.
- Each supplier's quirks handled in your code.
- Your team keeps them running as suppliers change endpoints and versions.
With PSRESTful
- One REST API for every supplier we connect to.
- One JSON shape. How we keep it the same across suppliers.
- We do the upkeep once for every distributor, so you can spend your time on your store, quoting tool or ERP.
Make your first call today
The Free plan includes 10 API calls a day, enough to try the API with your own suppliers before you pay for anything.