If you have mageplaza/magento-2-webhook already installed, you can integrate parcelLab easily through this extension as well.
Navigate to System > Webhook > Configuration
:
Confirm that the extension is enabled:
Navigate to System > Webhook > Manage Hooks
:
In the top right corner, click on the down arrow in button Add New
top open the dropdown, from the dropdown select the first entry Order
:
In the following screen fill all fields:
Name
: Pick a descriptive name for this webhook, e.g.parcelLab Transfer Webhook on Event order
Status
: PickEnable
Order Status
: Select all statusStore Views
: PickAll Store Views
or any other selection if you only wish to integrate specific shopsPriority
: Enter10
Navigate to the next screen by clicking on Actions
in the navigation box on the left:
Now enter following values:
Payload URL
: Enterhttps://api.parcellab.com/magento2/order
Method
: SelectPOST
from the dropdownAuthentication
: SelectBasic
from the dropdownUsername
: Enter your parcelLab User ID, typically a 7 digit numerical codePassword
: Enter your parcelLab API Token, it requires write scopeHeaders
: No changes requiredContent Type
: Selectapplication/json
from the dropdownBody
: Copy and paste the body from order.liquid
Afterwards, click Save
in the top right corner.
The first webhook is now set up and active and will transfer order data to parcelLab:
As the webhook is already active we can confirm correct data transfer after an order has been placed or updated:
Now, the process needs to be repeated a second time for another webhook. The process is identical, but 4 fields require different data entry. All data is shown below:
Field | Webhook "Order" | Webhook "New Shipment" |
---|---|---|
Create by clicking... | Add New > Order |
Add New > New Shipment |
Name |
parcelLab Transfer Webhook on Event order |
parcelLab Transfer Webhook on Event new_shipment |
Status |
Enable | Enable |
Order Status |
All Status | n/a |
Store Views |
All Store Views | All Store Views |
Priority |
10 | 10 |
Payload URL |
https://api.parcellab.com/magento2/order important: .../order |
https://api.parcellab.com/magento2/new_shipment important: .../new_shipment |
Method |
POST | POST |
Authentication |
Basic | Basic |
Username |
parcelLab User ID | parcelLab User ID |
Password |
parcelLab API Token | parcelLab API Token |
Headers |
- | - |
Content Type |
application/json | application/json |
Body |
order.liquid | new_shipment.liquid |