HomeGuidesAPI Reference
API Reference

Create or replace transaction definition

Creates the transaction definition for a type, or replaces it when the type already exists. A replace clears every optional section the request omits (partitions, realTimeFields, realTimeConditionFields, fieldRoles). Both cases return 201. Each link txPath and partition txPath must resolve to a declared leaf field (link and partition paths may not target array fields). A link may declare an optional mergeTxPath, which must resolve to an "array" leaf field. Partition types must not collide with link types. An optional fieldRoles object names the path carrying each semantic role ("amount", "currency"), each of which must resolve to a declared leaf field of that role's required type. When realTimeFields is set, every transaction of the type must carry transactionDate.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
required
string
required

Unique transaction type identifier. Posting a type that already exists replaces its definition.

fields
object
required

Nested structure where leaf values are one of "string", "number", "ipAddress", "date", "array", "country", "string?", "number?", "ipAddress?", "date?", "array?", "country?". A type ending in "?" marks the field optional: it may be omitted or null. Array elements must be primitives: string, number, boolean, or null; "country" values must be ISO 3166-1 alpha-2 codes. Transactions may carry fields that are not declared. The top-level names "id", "transaction_id" and "type" are reserved by the platform and rejected.

boolean
partitions
array of objects
length ≤ 16

Optional non-client-scoped aggregation partitions (e.g. device, IP). Each partition type must be distinct from every link type.

partitions
realTimeFields
array of strings

Optional whitelist of dot-notation paths into "fields". When present, only these fields are available for transaction monitoring rules. When absent, all declared fields are available.

realTimeFields
realTimeConditionFields
array of objects
length ≤ 8

Optional real-time fields that real-time rule conditions filter on, each with the complete list of values it can take. Each path must also be listed in "realTimeFields" and resolve to a "string" or "country" field. Real-time aggregations whose conditions only compare these fields to listed values (=, !=, in, not in, is empty, is not empty) are answered from pre-aggregated daily totals (and hourly ones for links that keep hourly totals); a value outside the list is counted as "other". At most 8 fields with up to 256 values each.

realTimeConditionFields
fieldRoles
object

Optional mapping from a semantic role to the dot-notation path carrying it, so consumers can resolve a monetary value without knowing this definition's field names. Each path must resolve to a declared leaf field of the role's required type: "amount" requires a "number" leaf, "currency" a "string" leaf. Every role is optional; a consumer falls back to its own default when one is absent.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json