createSale

Method allows to create order with specific details (in account selected currency).
Make sure you have all your account information set (contact, invoice data, etc.) on the website before submitting your first order!

Usage URL: https://e-hedo.pl/api/createSale.json?key=YOURAPIKEY

Query params

(put those in your URL, e.g. ?id=123)

  • lang

    Language of result. ISO 2 Letter Language Codes ie: en, pl, cs

  • test

    Enables a sandbox mode - no data will be written on the server. Any value allowed.

POST data

(if any - change request to POST, put those in as form-data)

  • fkshipmenttype | required

    Shipment type internal identifier

  • fkpaymenttype | required

    Payment type internal identifier

  • doc_type | required

    Which document should be assigned to sale. Available: "receipt" or "invoice"

  • shipment_diff_invoice | required

    Points whether shipping address is different than client (invoice) address.
    If set to yes, you have to fill "shipping" data
    This field is mandatory if you are using a drop-shipping client

  • currency

    Currency symbol. Three letters format ie: PLN, EUR, USD. If omitted - account currency will be picked

  • is_assembling

    Points whether order is going to be modified or more products added

  • pickup_point

    *new*Unique ID of selected pickup point. Required only if fkshipmenttype points at pickup point delivery type.
    This field replaces 6 old separate fields for each pickup point delivery shipment type.
    - For Poczta Polska - it's PNI,
    - For DHL - it's SAP

  • notice

    Order's notice

  • products[index] | required

    Array with requested products. index is an incremented integer that starts from 0 and goes up for each item passed in array

  • products[index][id] | required

    Product internal ID

  • products[index][qty] | required

    Requested product quantity

  • shipping

    Array with shipping address - required only if "differentshipping" = true

  • shipping[receiver_name]

    Receivers's full name / company name

  • shipping[postal_code]

    Receivers's postal code

  • shipping[city]

    Receivers's city

  • shipping[street]

    Receivers's street

  • shipping[home_number]

    Receivers's building number

  • shipping[flat_number]

    Receivers's flat nummber

  • shipping[phone]

    Receivers's phone number

  • shipping[email]

    Receivers's email address

  • shipping[country]

    Receivers's country - ISO2 code

  • own_label

    Array with information about supplied own label. Required and processed only if you have selected a valid delivery method. Allows customer to send us their own delivery label for the package (as long as given provider is supported by us). Since 10th November 2022 it is possible to upload multiple files.
    To get a valid fkshipmenttype value for this option - please refer to either of those methods: getAvailableDeliveryOptions, getShipmentTypes.

  • own_label[mode] | required

    Allows us to identify which field should be use for file validation. Following values are allowed: pdf, url

  • own_label[provider] | required

    Delivery carrier for given label. Following values are allowed: dpd, dhl, inpost, pocztapolska, ups, orlen, emag, olzalogistic

  • own_label[items][index]

    Array with data for each given label. index is an incremented integer that starts from 0 and goes up for each item passed in array

  • own_label[items][index][url]

    URL address which points to your PDF label file. Make sure that given endpoint returns correct PDF file and has 'Content-Type' header equal to 'application/pdf'. Required if mode = url

  • own_label[items][index][data]

    Base64 string with valid PDF inside. Required if mode = pdf

  • own_label[items][index][tracking_no] | required

    Comma separated tracking numbers from given label. If only one label is passed then put here that one tracking number.

fkshipmenttype=34&
fkpaymenttype=5&
notice=This is my notice&
doc_type=invoice&
inpost_box_name=WAW226M&
is_assembling=0&
shipment_diff_invoice=1&
products[0][id]=45356&
products[0][qty]=1&
products[1][id]=47990&
products[1][qty]=1&
shipping[receiver_name]=First and Last Name or Company Name&
shipping[postal_code]=23-456&
shipping[city]=Warsaw&
shipping[street]=Niepodleglosci&
shipping[home_number]=123&
shipping[flat_number]=&
shipping[phone]=+48 999-888-777&
shipping[email]=some-email@provider.com&
shipping[country]=PL&
invoice[vat_id]=DE8975305023&
invoice[regon]=&
invoice[name]=First and Last Name or Company Name&
invoice[firstname]=Test&
invoice[lastname]=Client&
invoice[postal_code]=12-345&
invoice[city]=Testing City&
invoice[street]=Test street&
invoice[home_number]=12&
invoice[flat_number]=34a&
invoice[phone]=+48 123-456-789&
invoice[country]=DE
Example URL: https://e-hedo.pl/api/createSale.json?key=YOURAPIKEY&lang=en

{
    "messages": {
        "danger": [
            "You have unpaid overdue debts"
        ]
    }
}
Example URL: https://e-hedo.pl/api/createSale.xml?key=YOURAPIKEY&lang=en

<?xml version="1.0" encoding="utf-8"?>
<root>
	<messages>
		<danger>
			<item>You have unpaid overdue debts</item>
		</danger>
	</messages>
</root>