+49 69 83008980 service@xqueue.com
Benötigen Sie Hilfe?

Update Transaction Type

Sie sind hier:
< Alle Themen
Updates an existing transaction type with the given ID in the account.
Currently you can:
  • Add new attributes
  • Change the name
  • Change the description
  • Change archival duration
The XML definition is identical to creating a transaction type: https://maileon.com/support/create-transaction-type/
Please be aware: due to backwards compatibility reasons you cannot change existing attributes or delete them.

Request

PUT https://api.maileon.com/1.0/transactions/types

Media type: application/vnd.maileon.api+xml

XML specification

A transaction type definition contains a set of basic settings for the transaction type and a set of attributes which will contain the data later on. The following table defines the attributes for the transaction type itself:

AttributeRequiredDefaultDescription
nameyesThe name of the transaction type. The name must start with a alphabetic character and may contain alphanumerical characters as well as “_” but no space. A name can be hierarchical, i.e. the different levels can be separated by a “.”, for example: “product.image.url”. The names between the “.”, i.e. the names on the different levels, may be up to 32 characters and the overall name may be up to 255 characters long.
descriptionnoIf set, this value will be submitted as description for the transaction type. The length is limited to 1000 characters.
archivingDurationnonot set (=infinite)If set, this parameter specifies the number in days a transaction event will be saved in Maileon before being deleted. Please be aware that evaluations on transaction events are not possible after they have been deleted and for mailings containing content from the transaction events, rescue links will not render properly after deleting the events.
attributesyesThe list of attributes of the transaction type. The list may be empty.

Any number of attributes can be specified. The following table explains the child elements of <attribute>:

AttributeRequiredDefaultDescription
nameyesThe path of the JSON element that contains the attribute value. A dot (“.”) is used as path separator. In the above example, the transaction content of an actual transaction might look like this:

{
  "customer" : {
    "firstname" : "John",
    "Lastname" : "Doe"
  }
  ...
}

In this case, the firstname attribute would have to be called customer.firstname. Attribute paths may be up to 255 characters long.

Note: the name itself is limited to 255 characters.

descriptionnoIIf set, this value will be submitted as description for the attribute. The length is limited to 1000 characters.
typeyesDefines the type of the attribute. Valid types are string (maximum length 1000 characters), doublefloatintegerbooleantimestamp and json. A valid timestamp is a UNIX epoch timestamp represented as a long integer or a string that contains an iso-formatted date (e.g "2014-02-08" or "2014-02-08 14:34:20"). json is a free-form JSON list element (“[...]“) that contains arbitrary JSON data and is up to 64000 bytes long.
requirednofalseIf this is set to true, any transactions that do not contain this attribute will be rejected by the method Create Transactions.
<transaction_type>
   <name>Order</name>
   <archivingduration>7</archivingduration>
   <description>An order transaction</description>
   <attributes>
      <attribute>
         <name>customer.firstname</name>
         <description>The first name of the customer</description>
         <type>string</type>
         <required>true</required>
      </attribute>
      <attribute>
         <name>customer.lastname</name>
         <description>The last name of the customer</description>
         <type>string</type>
         <required>true</required>
      </attribute>
      <attribute>
         <name>date_valid</name>
         <type>timestamp</type>
         <required>true</required>
      </attribute>
      <attribute>
         <name>total</name>
         <type>double</type>
         <required>true</required>
      </attribute>
      <attribute>
         <name>discount</name>
         <type>float</type>
         <required>false</required>
      </attribute>
      <attribute>
         <name>num_products</name>
         <type>integer</type>
         <required>false</required>
      </attribute>
      <attribute>
         <name>order_content</name>
         <type>json</type>
         <required>true</required>
      </attribute>
   </attributes>
</transaction_type>

Response

HTTP status codeBody ContentDescription
200 Ok/ <transaction_type_id>258</transaction_type_id>transaction type successfully created
400 Bad RequestIf there was an error in the submitted body. In this case, an XML-form error message that explains the problem is produced.

 

Inhaltsverzeichnis

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

Maileon ist ein Produkt der XQueue GmbH