What's customer_order object in the notifications templates

The order notification has access to customer_order object.

All order notification data templates inherited from OrderEmailNotificationBase.

The customer_order object is VirtoCommerce.Domain.Order.Model.CustomerOrder type.

Notice that the property should be converted from Camel notation to lowercase and underscores, because of the DotLiquid engine we use in this template and because it uses Ruby notation for all the properties.

So, the liquid example of the customer_order model:

{
    "customer_id": "string",
    "customer_name": "string",
    "channel_id": "string",
    "store_id": "string",
    "store_name": "string",
    "organization_id": "string",
    "organization_name": "string",
    "employee_id": "string",
    "employee_name": "string",
    "outer_id": "string",
    "shopping_cart_id": "string",
    "is_prototype": true,
    "subscription_number": "string",
    "subscription_id": "string",
    "addresses": [
        {
            "key": "string",
            "address_type": "Billing",
            "name": "string",
            "organization": "string",
            "country_code": "string",
            "country_name": "string",
            "city": "string",
            "postal_code": "string",
            "zip": "string",
            "line1": "string",
            "line2": "string",
            "region_id": "string",
            "region_name": "string",
            "first_name": "string",
            "middle_name": "string",
            "last_name": "string",
            "phone": "string",
            "email": "string"
        }
    ],
    "in_payments": [
        {
            "purpose": "string",
            "gateway_code": "string",
            "payment_method": {
                "code": "string",
                "name": "string",
                "description": "string",
                "logo_url": "string",
                "is_active": true,
                "priority": 0,
                "is_available_for_partial": true,
                "currency": "string",
                "price": 0,
                "price_with_tax": 0,
                "total": 0,
                "total_with_tax": 0,
                "discount_amount": 0,
                "discount_amount_with_tax": 0,
                "settings": [
                    {
                        "module_id": "string",
                        "object_id": "string",
                        "object_type": "string",
                        "group_name": "string",
                        "name": "string",
                        "value": "string",
                        "raw_value": [],
                        "value_type": "ShortText",
                        "allowed_values": [
                            "string"
                        ],
                        "default_value": "string",
                        "raw_default_value": [],
                        "is_array": true,
                        "array_values": [
                            "string"
                        ],
                        "raw_array_values": [
                            []
                        ],
                        "title": "string",
                        "description": "string",
                        "is_runtime": true
                    }
                ],
                "tax_type": "string",
                "tax_total": 0,
                "tax_percent_rate": 0,
                "tax_details": [
                    {
                        "rate": 0,
                        "amount": 0,
                        "name": "string"
                    }
                ],
                "payment_method_type": "Unknown",
                "payment_method_group_type": "Paypal",
                "id": "string"
            },
            "organization_id": "string",
            "organization_name": "string",
            "customer_id": "string",
            "customer_name": "string",
            "incoming_date": "2019-11-21T07:00:34.140Z",
            "outer_id": "string",
            "billing_address": {
                "key": "string",
                "address_type": "Billing",
                "name": "string",
                "organization": "string",
                "country_code": "string",
                "country_name": "string",
                "city": "string",
                "postal_code": "string",
                "zip": "string",
                "line1": "string",
                "line2": "string",
                "region_id": "string",
                "region_name": "string",
                "first_name": "string",
                "middle_name": "string",
                "last_name": "string",
                "phone": "string",
                "email": "string"
            },
            "payment_status": "New",
            "authorized_date": "2019-11-21T07:00:34.141Z",
            "captured_date": "2019-11-21T07:00:34.141Z",
            "voided_date": "2019-11-21T07:00:34.141Z",
            "process_payment_result": {
                "payment_method": {
                    "code": "string",
                    "name": "string",
                    "description": "string",
                    "logo_url": "string",
                    "is_active": true,
                    "priority": 0,
                    "is_available_for_partial": true,
                    "currency": "string",
                    "price": 0,
                    "price_with_tax": 0,
                    "total": 0,
                    "total_with_tax": 0,
                    "discount_amount": 0,
                    "discount_amount_with_tax": 0,
                    "settings": [
                        {
                            "module_id": "string",
                            "object_id": "string",
                            "object_type": "string",
                            "group_name": "string",
                            "name": "string",
                            "value": "string",
                            "raw_value": [],
                            "value_type": "ShortText",
                            "allowed_values": [
                                "string"
                            ],
                            "default_value": "string",
                            "raw_default_value": [],
                            "is_array": true,
                            "array_values": [
                                "string"
                            ],
                            "raw_array_values": [
                                []
                            ],
                            "title": "string",
                            "description": "string",
                            "is_runtime": true
                        }
                    ],
                    "tax_type": "string",
                    "tax_total": 0,
                    "tax_percent_rate": 0,
                    "tax_details": [
                        {
                            "rate": 0,
                            "amount": 0,
                            "name": "string"
                        }
                    ],
                    "payment_method_type": "Unknown",
                    "payment_method_group_type": "Paypal",
                    "id": "string"
                },
                "new_payment_status": "New",
                "redirect_url": "string",
                "html_form": "string",
                "is_success": true,
                "error": "string",
                "outer_id": "string"
            },
            "amount": 0,
            "price": 0,
            "price_with_tax": 0,
            "total": 0,
            "total_with_tax": 0,
            "discount_amount": 0,
            "discount_amount_with_tax": 0,
            "tax_type": "string",
            "tax_total": 0,
            "tax_percent_rate": 0,
            "tax_details": [
                {
                    "rate": 0,
                    "amount": 0,
                    "name": "string"
                }
            ],
            "discounts": [
                {
                    "promotion_id": "string",
                    "currency": "string",
                    "discount_amount": 0,
                    "discount_amount_with_tax": 0,
                    "coupon": "string",
                    "description": "string",
                    "id": "string"
                }
            ],
            "transactions": [
                {
                    "amount": 0,
                    "currency_code": "string",
                    "is_processed": true,
                    "processed_date": "2019-11-21T07:00:34.141Z",
                    "process_error": "string",
                    "process_attempt_count": 0,
                    "request_data": "string",
                    "response_data": "string",
                    "response_code": "string",
                    "refund_amount": 0,
                    "gateway_ip_address": "string",
                    "type": "string",
                    "status": "string",
                    "note": "string",
                    "created_date": "2019-11-21T07:00:34.141Z",
                    "modified_date": "2019-11-21T07:00:34.141Z",
                    "created_by": "string",
                    "modified_by": "string",
                    "id": "string"
                }
            ],
            "operation_type": "string",
            "parent_operation_id": "string",
            "number": "string",
            "is_approved": true,
            "status": "string",
            "comment": "string",
            "currency": "string",
            "sum": 0,
            "children_operations": [
                {
                    "operation_type": "string",
                    "number": "string",
                    "is_approved": true,
                    "status": "string",
                    "comment": "string",
                    "currency": "string",
                    "parent_operation_id": "string",
                    "children_operations": [
                        null
                    ],
                    "id": "string"
                }
            ],
            "is_cancelled": true,
            "cancelled_date": "2019-11-21T07:00:34.141Z",
            "cancel_reason": "string",
            "object_type": "string",
            "dynamic_properties": [
                {
                    "object_id": "string",
                    "values": [
                        {
                            "object_type": "string",
                            "object_id": "string",
                            "locale": "string",
                            "value": [],
                            "value_id": "string",
                            "value_type": "Undefined"
                        }
                    ],
                    "name": "string",
                    "description": "string",
                    "object_type": "string",
                    "is_array": true,
                    "is_dictionary": true,
                    "is_multilingual": true,
                    "is_required": true,
                    "display_order": 0,
                    "value_type": "Undefined",
                    "display_names": [
                        {
                            "locale": "string",
                            "name": "string"
                        }
                    ],
                    "created_date": "2019-11-21T07:00:34.141Z",
                    "modified_date": "2019-11-21T07:00:34.141Z",
                    "created_by": "string",
                    "modified_by": "string",
                    "id": "string"
                }
            ],
            "operations_log": [
                {
                    "object_type": "string",
                    "object_id": "string",
                    "operation_type": "Detached",
                    "detail": "string",
                    "created_date": "2019-11-21T07:00:34.141Z",
                    "modified_date": "2019-11-21T07:00:34.141Z",
                    "created_by": "string",
                    "modified_by": "string",
                    "id": "string"
                }
            ],
            "created_date": "2019-11-21T07:00:34.141Z",
            "modified_date": "2019-11-21T07:00:34.141Z",
            "created_by": "string",
            "modified_by": "string",
            "id": "string"
        }
    ],
    "items": [
        {
            "price_id": "string",
            "currency": "string",
            "price": 0,
            "price_with_tax": 0,
            "placed_price": 0,
            "placed_price_with_tax": 0,
            "extended_price": 0,
            "extended_price_with_tax": 0,
            "discount_amount": 0,
            "discount_amount_with_tax": 0,
            "discount_total": 0,
            "discount_total_with_tax": 0,
            "fee": 0,
            "fee_with_tax": 0,
            "tax_type": "string",
            "tax_total": 0,
            "tax_percent_rate": 0,
            "reserve_quantity": 0,
            "quantity": 0,
            "product_id": "string",
            "product": {
                "code": "string",
                "manufacturer_part_number": "string",
                "gtin": "string",
                "name": "string",
                "catalog_id": "string",
                "catalog": {
                    "name": "string",
                    "is_virtual": true,
                    "default_language": {
                        "catalog_id": "string",
                        "is_default": true,
                        "language_code": "string",
                        "id": "string"
                    },
                    "languages": [
                        {
                            "catalog_id": "string",
                            "is_default": true,
                            "language_code": "string",
                            "id": "string"
                        }
                    ],
                    "properties": [
                        {
                            "catalog_id": "string",
                            "category_id": "string",
                            "name": "string",
                            "required": true,
                            "dictionary": true,
                            "multivalue": true,
                            "multilanguage": true,
                            "hidden": true,
                            "value_type": "ShortText",
                            "type": "Product",
                            "attributes": [
                                {
                                    "property_id": "string",
                                    "value": "string",
                                    "name": "string",
                                    "created_date": "2019-11-21T07:00:34.141Z",
                                    "modified_date": "2019-11-21T07:00:34.141Z",
                                    "created_by": "string",
                                    "modified_by": "string",
                                    "id": "string"
                                }
                            ],
                            "display_names": [
                                {
                                    "name": "string",
                                    "language_code": "string"
                                }
                            ],
                            "validation_rules": [
                                {
                                    "is_unique": true,
                                    "char_count_min": 0,
                                    "char_count_max": 0,
                                    "reg_exp": "string",
                                    "property_id": "string",
                                    "id": "string"
                                }
                            ],
                            "is_inherited": true,
                            "created_date": "2019-11-21T07:00:34.141Z",
                            "modified_date": "2019-11-21T07:00:34.141Z",
                            "created_by": "string",
                            "modified_by": "string",
                            "id": "string"
                        }
                    ],
                    "property_values": [
                        {
                            "property_id": "string",
                            "property_name": "string",
                            "property": {
                                "catalog_id": "string",
                                "category_id": "string",
                                "name": "string",
                                "required": true,
                                "dictionary": true,
                                "multivalue": true,
                                "multilanguage": true,
                                "hidden": true,
                                "value_type": "ShortText",
                                "type": "Product",
                                "attributes": [
                                    {
                                        "property_id": "string",
                                        "value": "string",
                                        "name": "string",
                                        "created_date": "2019-11-21T07:00:34.141Z",
                                        "modified_date": "2019-11-21T07:00:34.141Z",
                                        "created_by": "string",
                                        "modified_by": "string",
                                        "id": "string"
                                    }
                                ],
                                "display_names": [
                                    {
                                        "name": "string",
                                        "language_code": "string"
                                    }
                                ],
                                "validation_rules": [
                                    {
                                        "is_unique": true,
                                        "char_count_min": 0,
                                        "char_count_max": 0,
                                        "reg_exp": "string",
                                        "property_id": "string",
                                        "id": "string"
                                    }
                                ],
                                "is_inherited": true,
                                "created_date": "2019-11-21T07:00:34.141Z",
                                "modified_date": "2019-11-21T07:00:34.141Z",
                                "created_by": "string",
                                "modified_by": "string",
                                "id": "string"
                            },
                            "alias": "string",
                            "value_id": "string",
                            "value": [],
                            "value_type": "ShortText",
                            "language_code": "string",
                            "is_inherited": true,
                            "created_date": "2019-11-21T07:00:34.141Z",
                            "modified_date": "2019-11-21T07:00:34.141Z",
                            "created_by": "string",
                            "modified_by": "string",
                            "id": "string"
                        }
                    ],
                    "id": "string"
                },
                "category_id": "string",
                "category": {
                    "catalog_id": "string",
                    "catalog": {
                        "name": "string",
                        "is_virtual": true,
                        "default_language": {
                            "catalog_id": "string",
                            "is_default": true,
                            "language_code": "string",
                            "id": "string"
                        },
                        "languages": [
                            {
                                "catalog_id": "string",
                                "is_default": true,
                                "language_code": "string",
                                "id": "string"
                            }
                        ],
 ...
    "created_date": "2019-11-21T07:00:34.149Z",
    "modified_date": "2019-11-21T07:00:34.149Z",
    "created_by": "string",
    "modified_by": "string",
    "id": "string"
}

How to transform Swagger model into Snake case format for notification template

Step 1. Copy Model From Swagger UI

Step 2. Use better-converter.com for snake_case Json Property Names Converter

2 Likes

@OlegoO How does one get the update schema information? Is this what swagger provides?

Copied from Model Sample from Swagger and transformed properties name into Snake case via online service.

@OlegoO i think instructions on how to do all that would be good to have

Updated topic with Step by step instruction