Webhook integration with custom scripts and third-party services
Integrating E-junkie With Third-Party & Custom Services via webhook callback
For third-party services we already support, please see our main Integration help page here.
How can I have E-junkie transmit the order data to an external script?
E-junkie can transmit all the order data to your URL only for successful completed payments. We submit this data via HTTP POST, so any generic form-handler type of script (such as typically used for receiving an HTML form submission) should be able to receive and parse the order data however you wish. If your server fails to respond when E-junkie attempts to submit order data to it, our system will not retry but will normally email a notification of the failure to your E-junkie Login Email address. If your URL would receive the order data and also return output which you want us to forward to the buyer, use our Send Generated Codes feature instead.
Our webhook data transmission follows the format of PayPal IPN but also includes some extra fields to report order data pertaining to our service that PayPal does not handle (these are listed as Non-IPN Variables below). Any custom or "off the shelf" script that can receive PayPal IPN should be able to handle our order data, as long as it can handle/ignore our extra fields and does not require validating the IPN with PayPal (which would fail since we are not PayPal, and we validate the actual PayPal IPN in the first place before sending order data anyway); however, you may optionally use our handshake
variable (documented below) to validate submissions from us. Since we can do this regardless of the buyer's checkout method, this means that E-junkie can send a PayPal-style IPN even for checkouts that did not go through PayPal.
To have order data sent to the same URL for all purchases, you can specify your URL in Seller Admin > Manage Seller Account > Edit Preferences > Webhook & Integrations > Common Notification URL.
You can also/instead have order data sent when any specific product is purchased, or specify a different URL to receive purchase data for each product (the following steps are not necessary if you're only using a Common Notification URL). While adding or editing your product:
- Tick the box to Show advanced settings at the top;
- Tick the box for Webhook Integration;
- This will reveal the Product Notification URL field, where you would paste the URL where your custom/third-party script can receive order data;
- Click Submit to apply changes and proceed to the button codes screen;
- Use the E-junkie Cart or Buy Now button/link codes from this screen to start selling your product.
(If you had already copy-pasted our button/link code for this product and made no other changes to the product, the existing buttons/links in your site will pick up this change automatically.)
Common Order IPN Data
payer_email
txn_id
- Transaction ID generated by payment processor (for non-PayPal txns we add a prefix identifying the payment service, followed by a dash and then the ID generated by that service)first_name
last_name
mc_gross
- total amount of paymentcustom
- if you added&custom=someValue
to the link URL for the buyer's purchase buttonmc_shipping
tax
invoice
- buyer's cart ID or Buy Now invoice IDfor_auction
auction_buyer_id
address_name
- ship-to full name if different from billing (buyer) nameaddress_street
- for two-line addresses, this variable passes both lines, separated by a newline characteraddress_city
address_state
address_zip
address_country
address_country_code
- shipping address 2-letter ISO country codeaddress_phone
address_business_name
- shipping address company name (if provided)payment_date
- Time/Date stamp generated by payment processor, in the formatHH:MM:SS Mmm DD, YYYY ZZZ
(e.g.12:34:56 Dec 21, 2012 MST
)payer_business_name
- billing address company name (if provided)payer_phone
- billing phoneresidence_country
- billing country (if supported by payment processor)charset
- this should normally be 'utf-8', as we now convert order data into UTF-8 from whatever charset was sent by the payment processor (in very rare cases this may identify the original charset if conversion to UTF-8 cannot be done)
Item Specific IPN Data
Here,X
represents the position of each item in the buyer's cart (e.g., the first item in the buyer's cart would be identified with item_name1
, item_number1
, quantity1
, etc. while the second cart item would be item_name2
, etc.):
item_nameX
item_numberX
- item number you have set in product configurationquantityX
- quantity soldmc_gross_X
- sale price for this product × quantity sold- For products using
Variations which tell more, the option names/values passed for the item will be reported in these variables:
option_name1_X
option_selection1_X
option_name2_X
option_selection2_X
option_name3_X
option_selection3_X
sku
andsku_X
variables below.
Additional Non-IPN Variables
The following variables are unique to our system and will be passed to your Integration URL(s) in addition to the order data we get from the payment processor. These are not part of the standard PayPal IPN data set, so any IPN-compatible scripts or third-party services you're using with our Integration feature should be able to handle or ignore the following fields.
Item Specific Non-IPN Data
Here,X
represents the position of each item in the buyer's cart, consistent with the Item Specific IPN Data variables documented above. These are only sent to a Common Notification URL:
sku_X
- for items using Variants affecting item SKU/price/weight/stock, this is the SKU value of the particular Variant ordered, taken from the first position of that Variant's line in your product's Variants configurationkey_X
- (if applicable) stored or generated code (key/license/serial/PIN) sent to the buyer (this variable is not sent to keygen URLs)item_affiliate_fee_X
- (if applicable) commission earned on the item by your E-junkie affiliate
item_cart_position
- this identifies which particular item in the order triggered a given submission to a product-specific Product Notification URL (which receives the full data for all items in the order), so you can match this to the value ofX
in the Item Specific IPN Data variable names (listed above) to identify which details in the submission pertain to that particular item -- e.g., if you receiveitem_cart_position=2
, you'll know that submission was triggered by the second item in the buyer's cart, corresponding toitem_name2
,item_number2
, etc.sku
- for items using Variants affecting item SKU/price/weight/stock, this is the SKU value of the particular Variant ordered, taken from the first position of that Variant's line in your product's Variants configurationexpiry_hours
- (if applicable) maximum number of Hours you allow your download links to be valid for in your product configurationmax_downloads
- (if applicable) maximum number of download Attempts you allow in your product configurationaffiliate_fee
- (if applicable) commission earned on the item by your E-junkie affiliatekey
- (if applicable) stored or generated code (key/license/serial/PIN/etc.) sent to the buyer (this variable is not sent to keygen URLs, as those would generate thekey
value as output)
Common Order Non-IPN Data
These are sent to both a Common Notification URL and Product Notification URLs:from_name
- your Display Name in E-junkie profilefrom_email
- your Display Email in E-junkie profileclient_id
- your E-junkie account number (you can find this ID in Seller Admin > Manage Seller Account > View Account Summary)buyer_ip
- public IP address assigned to buyer's computer or router at the time of checkoutcountry_mismatch=true
- only sent if country selected in cart does not match the one given during a PayPal Payments Standard checkout (other checkout methods cannot mismatch)zipcode_mismatch=true
- only sent if postal/zipcode given in cart does not match the one given during a PayPal Payments Standard checkout (other checkout methods cannot mismatch)client_shipping_method_id
- # of the Shipping Rule applied in buyer's cartshipping_method_type
- Shipping Rate Calculator for the Shipping Rule applied in buyer's cartshipping_method_desc
- Shipping Method Description for the Shipping Rule applied in buyer's cartdiscount_codes
- Discounts applied to the ordermailing_list_status
-true
if the buyer ticked the Subscribe for Newsletter and Updates checkbox during checkout,false
if notitem_affiliate_fee_total
- (if applicable) total commission earned for all items in the order by your E-junkie affiliateej_txn_id
- Payment confirmation ID shown to your affiliates when they earn commission on a sale)txn_type
- checkout method used:cart
(PayPal Payments Standard - cart order)web_accept
(PayPal Payments Standard - Buy Now button)expresscheckout
(PayPal Payments Pro Express Checkout using a PayPal account)ppdirect
(PayPal Payments Pro Direct Payment using a card)ppadvanced
(PayPal Payments Advanced)payflow
(PayPal Payflow Pro/Link)2co_cart
(2Checkout)authnet
(Authorize.net)braintree
(Braintree)cb
(ClickBank)instamojo
(Instamojo)razorpay
(Razorpay)stripe
(Stripe)ejgift
(E-junkie Free Checkout)
handshake
- result ofmd5(your_e-junkie_login_email+md5(your_e-junkie_password))
Your receiving script can optionally use this value to verify an Integration submission actually came from your account on our system. To generate this value, we take an MD5 hash of your E-junkie password, then tack your E-junkie login email in front of that hash, then re-hash the whole thing in MD5 again. If you ever change your E-junkie login email and/or password, you'd need to update the hash reference in your listener script. See this page for further tips on generating your handshake hash value.