Promail REST API 2.0 is an easy way to exchange and manipulate data with the Promail platform.
Orders can be sent to Promail with the Order API.
Basic HTTP
The API is HTTP based. That means the API can be used with HTTP libraries like cURL or urllib.
This allows the API to be used directly in the browser.
Host url
Requests can be sent to the url https://www.deal1.ch/PromailRESTorderV2.php.
Json
The queries are to be sent to the API in the JavaScript language "Json".
examples below.
POST
The API reacts to the API Send methods and controls different functions.
The POST method is used to transmit data such as delivery orders to Promail.
Access Key and API_Name
In order to use the API, the correct access keys and desired API name must be included in the API call.
The API uses 3 keys, which are transferred when the API is called.
"Key" = x6R38e94z721GtUp (the key is related to your Promail account).
"PrivatKey" = Must be requested from Promail.
"Your_Email" = Your main account email address. Promail will be happy to provide you with information.
The corresponding interface is selected with "API name". Partners/customers receive the access key by sending an email to office@promail-ag.ch.
Submit POST delivery orders
In the following example PHP code, 2 orders are submitted with cURL:
Explanations
The sample code submits three records for two orders. Order with delivery note number 1234 has two SKU's. Order with delivery note number 1235 has one SKU.
Up to 500 data sets can be transmitted in this way.
key
apply to Promail
mandatory
privatkey
apply to Promail
mandatory
your_email
apply to Promail
mandatory
api_name
"Order" controls the API that transmits orders to the Promail WMS
mandatory
lieferschein_nr
Order number of your order
mandatory
emp_firma
Company
emp_name
Name in recipient company
emp_strasse
Recipient street (possibly with house number)
mandatory
emp_hausnr
House number, if not already in emp_strasse
(mandatory)
emp_plz
Recipient ZIP
mandatory
emp_ort
recipient location
mandatory
emp_land
Country of the reciever
mandatory
emp_email
E-mail of the recipient
emp_tel
Tel of the recipient
versandart
If nothing is specified, customer default is used. Information
versandbemerkung
If nothing is specified, customer default is used. Other options are, for example, "replacement", "light packaging" or instructions agreed with Promail.
rechnungsart
If nothing is specified, customer default is used. Other options are "payment in advance", "cash on delivery".
total_betrag
Invoice amount of the order
currency
"CHF"
mandatory
artikel_name
Article name
artikel_nr
Item number (SKU) of the item
mandatory
lot
lot of item
mhd
expiration date of the item
anzahl
Number of item quantity to be delivered
mandatory
preis
price of an item
All items with the same delivery note number are combined into one order.
Error messages+success messages
If the API is successfully called, an http status 200 is sent.
If the call was unsuccessful, an http status 401 is sent.
The following error messages are possible:
"message": "No data received" / status 401
api has not received any data
"message": "Could not convert json" / status 401
api failed to recognize data as json
"message": "key is missing" / status 401
api did not find a key value
"message": "privatkey is missing" / status 401
api did not find a privatekey value
"message": "your_email is missing" / status 401
api did not find an email value
"message": "api_name is missing" / status 401
api did not find an api-name value
"message": "order-API has not been sent with POST-methode" / status 401
Order-api must be sent with POST-Method
"message": "key is wrong" / status 401
key value is wrong
"message": "your privatkey or email is wrong" / status 401
privatekey or email is wrong
"message": "all ANZAHL records have been uploaded" / status 200
api call was successful
"not in database": "Artikelnummer" / status 200
api-call was successful, but some article numbers are unknown