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

Im Maileon Help-Center finden Sie umfassende Dokumentationen zu unserem System.

Beliebte Suchanfragen: Importe | Rest-API | Integrationen | SMS

Update Transaction Type

Sie sind hier:
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://support.maileon.com/support/create-transaction-type/.
Please be aware: due to backwards compatibility of the types with regard to mailings or filters, you cannot change existing attributes or delete them. This means the definition in the update must at least contain all attributes of the original transaction type but might contain 0..n new attributes. However, regarding old attributes, only the name is evaluated, all other attributes are ignored and not prcessed or even updated.

Request

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

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:

Attribute Required Default Description
name yes The 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.
description no If set, this value will be submitted as description for the transaction type. The length is limited to 1000 characters.
archivingDuration no not 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.
attributes yes The 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>:

Attribute Required Default Description
name yes The 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.

description no IIf set, this value will be submitted as description for the attribute. The length is limited to 1000 characters.
type yes Defines 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.
required no false If 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 code Body Content Description
200 Ok / <transaction_type_id>258</transaction_type_id> transaction type successfully created
400 Bad Request If there was an error in the submitted body. In this case, an XML-form error message that explains the problem is produced.
Inhaltsverzeichnis