If you're using a custom store and would like to integrate with LateShipment.com to send shipment tracking and order data, follow the instructions below. This guide will walk you through setting up a secure webhook connection that allows us to receive and process your order data.
Step 1: Add the Webhook Code to Your Server
In your dashboard, navigate to the bottom left and click Settings > Connect Store, then select Others from the dropdown. To begin, add the following code to your server in the programming language of your choice. This snippet securely sends order and tracking data to LateShipment.com using your unique API key.
Python Example (we also provide code in Node.js, PHP, and Java):
import requests
url = "https://smart.lateshipment.com/Genericwebhook/webhookapi.php"
payload = "<< JSON Data >>"
headers = {
'X-Auth-Email': "your_email@example.com",
'X-Auth-Key': "your_api_key_here",
'Content-Type': "application/json"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)
Replace << JSON Data >> with your actual payload in the format shown below.
Step 2: Trigger Event – Label Creation
You need to send a POST request with the JSON payload whenever a label is created for an order. This allows us to receive the latest tracking and order data in real time.
Required Parameters
JSON Data Format (Payload)
Here’s the format your payload should follow:
{
"order_no": "54321",
"order_date": "2019-07-25 19:08:49",
"customer_name": "User Name",
"customer_email": "user@example.com",
"customer_phoneno": "1234567890",
"trackingnumber": "123456789123456789",
"carrier_type": "UPS",
"product": "Product Name",
"productid": "12345",
"quantity": "1",
"image_url": "https://www.example.com/image1.png",
"product_price": "17.50",
"subtotal_amount": "8.00",
"shipping_amount": "1.00",
"payment_status": "paid",
"package_status": "shipped",
"amount": "9.99",
"Number_of_items": "2",
"shipping_name": "User Name",
"shipping_street": "123 Main St",
"shipping_street1": "Apt 4B",
"shipping_city": "New York",
"shipping_state": "NY",
"shipping_zip": "10001",
"shipping_country": "USA",
"billing_name": "User Name",
"billing_street": "123 Main St",
"billing_street1": "Apt 4B",
"billing_city": "New York",
"billing_state": "NY",
"billing_zip": "10001",
"billing_country": "USA"
}
Sample Response
{
"message": "Request Received Successfully",
"status": "Success"
}
Possible Errors & Status Codes
Need Help?
If you have questions or need support, feel free to reach out to your onboarding specialist or contact our support team at support@lateshipment.com. We’re happy to help you get set up!
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article