Expose Commerce data
This runtime action is responsible for notifying the external backoffice application when an <object> is created, updated, or deleted in Adobe Commerce.
data-src=/_includes/integration.md
Incoming event payload
The incoming event payload specified during event registration determines the incoming information.
The order runtime action requires the created_at and updated_at fields.
data-slots=heading, code
data-repeat=4
data-languages=JSON, JSON, JSON, JSON
customer
{
"id": 1,
"created_at":"2000-12-31 16:52:40",
"updated_at":"2000-12-31 16:48:40"
}
customer_group
{
"customer_group_id": 6,
"customer_group_code": "Group name code",
"tax_class_id": 4,
"tax_class_name": "Tax class name",
"extension_attributes": {
"exclude_website_ids":[]
}
}
order
{
"real_order_id": "ORDER_ID",
"increment_id": "ORDER_INCREMENTAL_ID",
"items": [
{
"item_id": "ITEM_ID"
}
],
"created_at": "2000-01-01",
"updated_at": "2000-01-01"
}
product
{
"created_at":"2023-11-24 16:52:40",
"name":"Test product name",
"sku":"2_4_7_TestProduct",
"updated_at":"2023-11-29 16:48:55"
}
The params also specify the event_code and event_id.
Payload transformation
If necessary, make any transformation changes necessary for the external backoffice application's formatting in the transformData function in the transformer.js file.
Connect to the backoffice application
Define the connection information in the sendData function in the sender.js file. Include all the authentication and connection information in the sender.js file or an extracted file outside index.js.
Parameters from the environment can be accessed from params. Add the necessary parameters in the actions/<object>/commerce/actions.config.yaml under created -> inputs, updated -> inputs, or deleted -> inputs as follows:
data-slots=heading, code
data-repeat=3
data-languages=yaml, yaml, yaml
create
created:
function: commerce/created/index.js
web: 'no'
runtime: nodejs:16
inputs:
LOG_LEVEL: debug
HERE_YOUR_PARAM: $HERE_YOUR_PARAM_ENV
annotations:
require-adobe-auth: true
final: true
update
updated:
function: commerce/updated/index.js
web: 'no'
runtime: nodejs:16
inputs:
LOG_LEVEL: debug
HERE_YOUR_PARAM: $HERE_YOUR_PARAM_ENV
annotations:
require-adobe-auth: true
final: true
delete
deleted:
function: commerce/deleted/index.js
web: 'no'
runtime: nodejs:16
inputs:
LOG_LEVEL: debug
HERE_YOUR_PARAM: $HERE_YOUR_PARAM_ENV
annotations:
require-adobe-auth: true
final: true