+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

AttributeMandatoryTypeDescription
order.idyesStringID of the order
order.dateyesTimestampDate of the order, can contain time information
order.statusStringCurrent state of the order, e.g. “Waiting for payment” or “completed”
order.estimated_delivery_timeStringE.g. “3 Working Days”
order.estimated_delivery_dateDateAn estimate for the delivery date
order.itemsyesJSONSet of items in the order. See table below for data definition.
order.product_idsStringComma separated list of product IDs in the order for easier filtering
order.categoriesStringComma separated list of categories in the order for easier filtering
order.brandsStringComma separated list of brands in the order for easier filtering
order.totalyesDoubleOverall price
order.total_no_shipping*DoubleOverall price without shipping fees
order.total_taxyesDoubleTaxes applied
order.total_feesyesDoubleSum of fees, like shipping costs
order.total_refundsDoubleSum of refunds
order.feesJSONSet of fees applied to the order, e.g. shipping fee. See table below for data definition.
order.refundsJSONSet of refunds applied to the order, e.g. some cashback. See table below for data definition.
order.currencyyesStringCurrency, e.g. €
payment.method.idStringID of the payment method
payment.method.name*StringName of the payment method
payment.method.urlStringSome URL, e.g. for payment details
payment.method.image_urlStringURL of an image to display in the mailing
payment.method.dataStringE.g. the Klarna-Payment-ID
payment.due_dateDateDate till the payment should be done
payment.statusStringStatus, e.g. “open” or “paid”
discount.codeStringIf there is a simple discount code, e.g. a voucher code
discount.totalStringThe sum of discounts
discount.rulesJSONSet of rules applied to the order, e.g. vouchers. See table below for data definition.
discount.rules_stringStringRules as a CSV string. Can be used for filters
customer.salutation*StringSalutation
customer.fullnameStringFull name
customer.firstnameStringFirst name
customer.lastnameStringLast name
customer.id*StringCustomer ID
billing.address.salutationStringSalutation for BA
billing.address.firstnameStringFirst name for BA
billing.address.lastnameStringLast name for BA
billing.address.streetStringStreet for BA
billing.address.zipStringZIP for BA
billing.address.cityStringCity for BA
billing.address.regionStringRegion for BA
billing.address.countryStringCountry for BA
shipping.address.salutationStringSalutation for SA
shipping.address.firstnameStringFirst name for SA
shipping.address.lastnameStringLast name for SA
shipping.address.streetStringStreet for SA
shipping.address.zipStringZIP for SA
shipping.address.cityStringCity for SA
shipping.address.regionStringRegionfor SA
shipping.address.countryStringCountry for SA
shipping.service.idStringID of the shipping service, e.g. the code like “dhl”, “ups”, or an internal ID like “123”
shipping.service.nameStringName of the shippings ervice, e.g. “UPS”
shipping.service.urlStringURL for more informations about shipping service
shipping.service.image_urlStringURL for an image to display in a mailing
shipping.service.tracking.codeStringA tracking code to display
shipping.service.tracking.urlStringA url to the tracking information
shipping.statusStringStatus, like “shipped”
generic.string_1String
generic.string_2String
generic.string_3String
generic.string_4String
generic.string_5String
generic.string_6String
generic.string_7String
generic.string_8String
generic.string_9String
generic.string_10String
generic.double_1Double
generic.double_2Double
generic.double_3Double
generic.double_4Double
generic.double_5Double
generic.integer_1Integer
generic.integer_2Integer
generic.integer_3Integer
generic.integer_4Integer
generic.integer_5Integer
generic.boolean_1Boolean
generic.boolean_2Boolean
generic.boolean_3Boolean
generic.boolean_4Boolean
generic.boolean_5Boolean
generic.date_1Date
generic.date_2Date
generic.date_3Date
generic.timestamp_1Timestamp
generic.timestamp_2Timestamp
generic.timestamp_3Timestamp
generic.json_1JSON
generic.json_2JSON
generic.json_3JSON

 

Attributes: order.items
AttributeMandatoryTypeDescription
skuyesStringStock Keeping Unit
product idStringOften there is a product ID that differs from SKU
is_giftBooleanIndicates if it is a gift
titleyesStringTitle of the product
description*StringRegular description
short_descriptionStringShort (teaser) description
reviewStringA review comment
release_dateDateDate of product release
urlyesStringURL to the product in the shop
image_urlyesStringURL of the image to display
status*StringIdicates, if the product available, delayed, shipped, sold out, etc.
quantityyesIntegerQuantity
single_priceyesDoublePrice of a single product
totalyesDoubleTotal cost
categories*StringCategories as a CSV string
seller.idStringID of a third party seller, e.g. for marketplaces
seller.nameStringName of the seller
seller.urlStringURL to the details of a seller
attributesJSONIf there are attributes required that are missing or should be displayed, e.g. as a list
brandStringBrand
colorStringColor
weightStringWeight
widthStringWidth
heightStringHeight
estimated_delivery_dateDateThe estimated date
estimated_delivery_timeStringE.g. “3 Working Days”

 

Attributes: order.discount.rules

AttributeMandatoryTypeDescription
idStringInternal ID of the rule
nameyesStringReadable name of the rule
descriptionStringDescription
totalyesDoubleNumber to display
type*StringDefines, if the discount is absolute or in percent

 

Attributes: order.fees

AttributeMandatoryTypeDescription
idStringInternal ID of the fee
nameyesStringReadable name of the fee
descriptionStringDescription
totalyesDoubleNumber to display

 

Attributes: order.refunds

AttributeMandatoryTypeDescription
idStringInternal ID of the refund
nameyesStringReadable name of the refund
descriptionStringDescription
totalyesDoubleNumber 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

Bleiben Sie Up-to-Date und profitieren Sie von spannenden News und Aktionen.

Maileon ist ein Produkt der XQueue GmbH