Documentation Index
Fetch the complete documentation index at: https://partner-integrations.voyado.com/llms.txt
Use this file to discover all available pages before exploring further.
When adding custom functionality to this extension, make sure to create your own plugin. Otherwise, you may interfere with the existing code and risk breaking it.
How to add custom attributes to the Contact
To store custom attributes for a contact in Engage, these plugins can be used:magento/app/code/Voyado/ExtendedVoyado/etc/di.xml
magento/app/code/Voyado/ExtendedVoyado/etc/di.xml
magento/app/code/Voyado/ExtendedVoyado/Plugin/Sdk/ToVoyado.php
magento/app/code/Voyado/ExtendedVoyado/Plugin/Sdk/ToVoyado.php
How to add custom data to the Order
This guide walks you through adding custom key-value pairs to theextra_data field in the api/v2/orders payload sent to Voyado. You do this with a Magento after-plugin — no modification to the Voyado extension source is needed.
Before you start
- You need a working Voyado Adobe Commerce integration.
- All customizations must live in a separate Adobe Commerce module that depends on
Voyado_Magento2. Do not edit the extension’s files directly — your changes would be overwritten on the next Composer update.
How extra data works
Every order exported toapi/v2/orders includes an extra_data object. This is a flat string-to-string map — both keys and values must be strings. The extension populates it by default with shipping, billing, and payment details.
The extension calls getExtraDataForOrder() in Voyado\Magento2\Helper\VoyadoHelper to build this map. You extend it with an afterGetExtraDataForOrder plugin that receives the existing array and returns it with your additions.
How to create the module
1. Register the module
1. Register the module
Create Replace
app/code/VendorName/ExtendedVoyado/registration.php:VendorName with your own vendor name throughout this guide.2. Declare the module and dependency
2. Declare the module and dependency
Create
app/code/VendorName/ExtendedVoyado/etc/module.xml:3. Register the plugin
3. Register the plugin
Create
app/code/VendorName/ExtendedVoyado/etc/di.xml:4. Implement the plugin
4. Implement the plugin
Create After this plugin runs, the
app/code/VendorName/ExtendedVoyado/Plugin/AddExtraOrderData.php.The plugin receives the existing extra_data array in $result — which already contains all the default fields like shipping address, billing address, and payment method. You add your field to this array and return it. Nothing else in the payload is affected.In this example, we read a custom order field called discount_code and add it as discountCode in the extraData object:extraData object in the api/v2/orders payload will contain your new field alongside all the existing fields:The
$result parameter contains the full existing extra_data array built by the extension. By adding a key and returning the array, your field is merged into the same object. You are not creating a new object — you are extending the one that already exists.5. Enable the module and test
5. Enable the module and test
Run the standard Magento setup commands:Then place a test order and check the
voyado_magento2_status table. Look at the request column for the order export — your new fields should appear in the extraData object of the JSON body.What the default extra data already contains
What the default extra data already contains
The extension populates these fields by default. Your plugin adds to this — it does not replace it.
| Key | Source |
|---|---|
website_code | Store ID |
shipping_method | Order shipping description |
shipping_description | Order shipping description |
shipping_amount | Base shipping amount including tax |
customer_firstname, customer_middlename, customer_lastname | Billing address |
customer_telephonenumber | Billing address telephone |
billing_company, billing_street, billing_zipcode, billing_city, billing_country | Billing address |
shipping_firstname, shipping_middlename, shipping_lastname | Shipping address |
shipping_telephonenumber, shipping_company, shipping_street, shipping_zipcode, shipping_city, shipping_country | Shipping address |
payment_method | Payment method config value |
shipping_track or shipping_track_number + shipping_track_url | Shipment tracking (depending on config) |
Common mistakes
| Mistake | What happens | Fix |
|---|---|---|
| Passing an array as a value instead of a string | The value is serialized as "Array" in the API request | Use json_encode() to convert the array to a string |
Reassigning $result to a new array | All default extra_data fields are lost | Always add keys to the existing $result and return it |
Forgetting (string) cast on non-string data | Integer or float values may cause type mismatches | Cast all values to string, or use json_encode() for complex types |
| Editing the Voyado extension source directly | Changes are lost on the next composer update | Always use a separate module with a plugin as shown above |