+49 69 83008980 service@xqueue.com

Benötigen Sie Hilfe?

Order Confirmation

< Alle Themen

 

This page provides a sketch for creating order confirmation mails. Not all attributes need to be filled, as not each shop system can provide all data or some data is decided not to be required for the usecase. However, having a common transaction type can ease development

Attribute Mandatory Type Description
order.id yes String ID of the order
order.date yes Timestamp Date of the order, can contain time information
order.status String Current state of the order, e.g. “Waiting for payment” or “completed”
order.estimated_delivery_time String E.g. “3 Working Days”
order.estimated_delivery_date Date An estimate for the delivery date
order.items yes JSON Set of items in the order. See table below for data definition.
order.product_ids String Comma separated list of product IDs in the order for easier filtering
order.categories String Comma separated list of categories in the order for easier filtering
order.brands String Comma separated list of brands in the order for easier filtering
order.total yes Double Overall price
order.total_no_shipping * Double Overall price without shipping fees
order.total_tax yes Double Taxes applied
order.total_fees yes Double Sum of fees, like shipping costs
order.total_refunds Double Sum of refunds
order.fees JSON Set of fees applied to the order, e.g. shipping fee. See table below for data definition.
order.refunds JSON Set of refunds applied to the order, e.g. some cashback. See table below for data definition.
order.currency yes String Currency, e.g. €
payment.method.id String ID of the payment method
payment.method.name * String Name of the payment method
payment.method.url String Some URL, e.g. for payment details
payment.method.image_url String URL of an image to display in the mailing
payment.method.data String E.g. the Klarna-Payment-ID
payment.due_date Date Date till the payment should be done
payment.status String Status, e.g. “open” or “paid”
discount.code String If there is a simple discount code, e.g. a voucher code
discount.total String The sum of discounts
discount.rules JSON Set of rules applied to the order, e.g. vouchers. See table below for data definition.
discount.rules_string String Rules as a CSV string. Can be used for filters
customer.salutation * String Salutation
customer.fullname String Full name
customer.firstname String First name
customer.lastname String Last name
customer.id * String Customer ID
billing.address.salutation String Salutation for BA
billing.address.firstname String First name for BA
billing.address.lastname String Last name for BA
billing.address.street String Street for BA
billing.address.zip String ZIP for BA
billing.address.city String City for BA
billing.address.region String Region for BA
billing.address.country String Country for BA
shipping.address.salutation String Salutation for SA
shipping.address.firstname String First name for SA
shipping.address.lastname String Last name for SA
shipping.address.street String Street for SA
shipping.address.zip String ZIP for SA
shipping.address.city String City for SA
shipping.address.region String Regionfor SA
shipping.address.country String Country for SA
shipping.service.id String ID of the shipping service, e.g. the code like “dhl”, “ups”, or an internal ID like “123”
shipping.service.name String Name of the shippings ervice, e.g. “UPS”
shipping.service.url String URL for more informations about shipping service
shipping.service.image_url String URL for an image to display in a mailing
shipping.service.tracking.code String A tracking code to display
shipping.service.tracking.url String A url to the tracking information
shipping.status String Status, like “shipped”
generic.string_1 String
generic.string_2 String
generic.string_3 String
generic.string_4 String
generic.string_5 String
generic.string_6 String
generic.string_7 String
generic.string_8 String
generic.string_9 String
generic.string_10 String
generic.double_1 Double
generic.double_2 Double
generic.double_3 Double
generic.double_4 Double
generic.double_5 Double
generic.integer_1 Integer
generic.integer_2 Integer
generic.integer_3 Integer
generic.integer_4 Integer
generic.integer_5 Integer
generic.boolean_1 Boolean
generic.boolean_2 Boolean
generic.boolean_3 Boolean
generic.boolean_4 Boolean
generic.boolean_5 Boolean
generic.date_1 Date
generic.date_2 Date
generic.date_3 Date
generic.timestamp_1 Timestamp
generic.timestamp_2 Timestamp
generic.timestamp_3 Timestamp
generic.json_1 JSON
generic.json_2 JSON
generic.json_3 JSON

 

Attributes: order.items
Attribute Mandatory Type Description
sku yes String Stock Keeping Unit
product id String Often there is a product ID that differs from SKU
is_gift Boolean Indicates if it is a gift
title yes String Title of the product
description * String Regular description
short_description String Short (teaser) description
review String A review comment
release_date Date Date of product release
url yes String URL to the product in the shop
image_url yes String URL of the image to display
status * String Idicates, if the product available, delayed, shipped, sold out, etc.
quantity yes Integer Quantity
single_price yes Double Price of a single product
total yes Double Total cost
categories * String Categories as a CSV string
seller.id String ID of a third party seller, e.g. for marketplaces
seller.name String Name of the seller
seller.url String URL to the details of a seller
attributes JSON If there are attributes required that are missing or should be displayed, e.g. as a list
brand String Brand
color String Color
weight String Weight
width String Width
height String Height
estimated_delivery_date Date The estimated date
estimated_delivery_time String E.g. “3 Working Days”

 

Attributes: order.discount.rules
Attribute Mandatory Type Description
id String Internal ID of the rule
name yes String Readable name of the rule
description String Description
total yes Double Number to display
type * String Defines, if the discount is absolute or in percent

 

Attributes: order.fees
Attribute Mandatory Type Description
id String Internal ID of the fee
name yes String Readable name of the fee
description String Description
total yes Double Number to display

 

Attributes: order.refunds
Attribute Mandatory Type Description
id String Internal ID of the refund
name yes String Readable name of the refund
description String Description
total yes Double Number to display

 

Sourcecode for Order Confirmations (PHP)
public function getOrderTransactionType() {
    $attributes = array();
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.id", com_maileon_api_transactions_DataType::$STRING, true));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.date", com_maileon_api_transactions_DataType::$TIMESTAMP, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.status", com_maileon_api_transactions_DataType::$STRING, true));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.estimated_delivery_time", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.estimated_delivery_date", com_maileon_api_transactions_DataType::$DATE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.items", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.product_ids", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.categories", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.brands", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.total", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.total_no_shipping", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.total_tax", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.total_fees", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.total_refunds", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.fees", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.refunds", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "order.currency", com_maileon_api_transactions_DataType::$STRING, true));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "payment.method.id", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "payment.method.name", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "payment.method.url", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "payment.method.image_url", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "payment.method.data", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "payment.due_date", com_maileon_api_transactions_DataType::$DATE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "discount.code", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "discount.total", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "discount.rules", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "discount.rules_string", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "customer.salutation", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "customer.fullname", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "customer.firstname", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "customer.lastname", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "customer.id", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "billing.address.salutation", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "billing.address.firstname", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "billing.address.lastname", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "billing.address.street", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "billing.address.zip", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "billing.address.city", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "billing.address.region", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "billing.address.country", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "billing.status", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.address.salutation", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.address.firstname", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.address.lastname", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.address.street", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.address.zip", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.address.city", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.address.region", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.address.country", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.service.id", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.service.name", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.service.url", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.service.image_url", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.service.tracking.code", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.service.tracking.url", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "shipping.status", com_maileon_api_transactions_DataType::$STRING, false));
    $attributes = $this->addGenericFields($attributes);
    
    $orderTxTypeRetentionTime = 365;
    return new com_maileon_api_transactions_TransactionType(null, self::TX_TYPE_NAME_ORDER, $attributes, $orderTxTypeRetentionTime, false, "An order triggered by X");
}

 

private function addGenericFields($attributes) {
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_1", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_2", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_3", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_4", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_5", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_6", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_7", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_8", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_9", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.string_10", com_maileon_api_transactions_DataType::$STRING, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.double_1", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.double_2", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.double_3", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.double_4", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.double_5", com_maileon_api_transactions_DataType::$DOUBLE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.integer_1", com_maileon_api_transactions_DataType::$INTEGER, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.integer_2", com_maileon_api_transactions_DataType::$INTEGER, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.integer_3", com_maileon_api_transactions_DataType::$INTEGER, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.integer_4", com_maileon_api_transactions_DataType::$INTEGER, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.integer_5", com_maileon_api_transactions_DataType::$INTEGER, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.boolean_1", com_maileon_api_transactions_DataType::$BOOLEAN, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.boolean_2", com_maileon_api_transactions_DataType::$BOOLEAN, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.boolean_3", com_maileon_api_transactions_DataType::$BOOLEAN, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.boolean_4", com_maileon_api_transactions_DataType::$BOOLEAN, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.boolean_5", com_maileon_api_transactions_DataType::$BOOLEAN, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.date_1", com_maileon_api_transactions_DataType::$DATE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.date_2", com_maileon_api_transactions_DataType::$DATE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.date_3", com_maileon_api_transactions_DataType::$DATE, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.timestamp_1", com_maileon_api_transactions_DataType::$TIMESTAMP, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.timestamp_2", com_maileon_api_transactions_DataType::$TIMESTAMP, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.timestamp_3", com_maileon_api_transactions_DataType::$TIMESTAMP, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.json_1", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.json_2", com_maileon_api_transactions_DataType::$JSON, false));
    array_push($attributes, new com_maileon_api_transactions_AttributeType(null, "generic.json_3", com_maileon_api_transactions_DataType::$JSON, false));
    return $attributes;
}
Inhaltsverzeichnis