Audit Record

The Audit Record object provides a detailed record of a specific event that occurred within the platform. This object contains the following properties:

Field
Type
Description

id

string

A unique identifier for the audit record. Note that no nesting exists for this identifier.

Example: AUD-1671-0642-1234-1234

event

string

The event code. Format: {platform/extension}.{module/extension name}.{object}.{action}

Example: platform.commerce.order.created

summary

string

A summary of the audit record.

Example: Order created

details

string

The audit details template. Any document property may be used as a placeholder.

Example: The order {{order.id}} has been successfully created by {{actor.name}} and is now in the platform.

actor

Information about the actor who has triggered an event.

Example:

{
  "id": "USR-2311-4038",
  "name": "Will Smith",
  "icon": "/public/users/usr-2311-4038.jpg",
  "account": {
    "id": "ACC-8989-32321",
    "name": "AdAstra Flex",
    "icon": "/public/accounts/acc-8989-32321.jpg",
  }
}

object

The API object for which an event has been triggered.

Example:

{
  "id": "ORD-3568-4038-2535",
  "type": "order",
  "icon": null,
  "objectType" : "Order"
}

timestamp

dateTime

The timestamp of the event.

Example: 2024-07-25T09:09:30.087Z

type

enum

The visibility of the audit record. The possible values are Public or Private.

request

The request for technical data.

Example:

{
  "api": {
    "ip": "192.168.2.2",
    "geolocation": {
       "countryCode": "ES",
       "countryName": "Spain",
       "region": "Catalonia"
    },
    "userAgent": "Chrome" 
  }
  "worker": {
    "workerName": null }
  "log": {
    "correlationId": "some-app-insights-id" }
}

documents

A JSON element containing a collection of linked Event Record objects.

Example:

{
    "order_01": {
    "id": "ORD-3568-4038-2535",
    "type": "Purchase",
    "status": "Completed" 
  }
  "extraData_01" {
    "extra_prop_01": "Some value that does not exist in order" 
  }
}

viewers

The list of accounts that have access to the audit records.

Example:

[
  {
      "id": "ACC-3408-7241",
      "name": "MPT Commerce e2e client",
      "type": "Client",
      "icon": "/v1/accounts/accounts/ACC-3408-7241/icon"
  },
  {
      "id": "ACC-1675-9721",
      "name": "Adobe",
      "type": "Vendor",
      "icon": "/v1/accounts/accounts/ACC-1675-9721/icon"
  }
]

AuditRecord

The Audit record object signifies a specific entity within the platform for which an Audit object is generated. It is important to note that each Audit object can only be created for one platform object at a time.

Field
Type
Description

id

string

The object's identifier.

Example: ORD-1234-1234-5678

name

string

The name of the platform object. Contains the ID if the name doesn't exist.

Example: ORD-1234-1234-5678

icon

string

The URL of the object icon.

objectType

string

The type of object.

Example: Order

revision

integer

The revision of the object.

Example: 24

AuditRecordActor

The Identity object signifies a user present within the platform, which is associated with the creation of an Audit object.

Field
Type
Description

id

string

The ID of the user.

Example: USR-0556-8733

name

string

The name of the user.

Example: John Doe

icon

string

The URL to the user's logo.

Example: /v1/accounts/users/USR-0556-8733/icon

account

The user's account details.

Example:

{
    "id": "ACC-3408-7241",
    "name": "MPT_QA_STATIC Commerce e2e client",
    "icon": "/v1/accounts/accounts/ACC-3408-7241/icon",
    "accountType": "Client"
  }

AuditRecordActorAccount

Field
Type
Description

id

string

The ID of the account.

Example: ACC-3408-7241

name

string

The name of the account.

Example: MPT Commerce e2e client

icon

string

The URL to the account's logo.

Example: /v1/accounts/accounts/ACC-3408-7241/icon

accountType

object

The type of account.

Example: Client

AuditRecordViewer

The audit record viewer object signifies a platform account that grants access to specific audit records for its members.

Field
Type
Description

id

string

The ID of the account.

Example: ACC-3408-7241

name

string

The name of the account.

Example: MPT Commerce e2e client

icon

string

The URL to the account's logo.

Example: /v1/accounts/accounts/ACC-3408-7241/icon

accountType

object

The type of account.

Example: Client

AuditRecordDocuments

The Documents object is a flexible JSON structure designed to hold essential information that characterizes an event. It can represent either a complete or partial depiction of the object related to the audit event, or it may consist of any arbitrary JSON data.

{
  "order": {
      "id": "ORD-1208-2301-8479",
      "href": "/commerce/orders/ORD-1208-2301-8479",
      "type": "Termination",
      "status": "Processing"
  },
  "actor": {
      "id": "TKN-8033-2484",
      "name": "Adobe Extension API",
      "icon": "",
      "account": {
          "id": "ACC-1675-9721",
          "name": "Adobe",
          "icon": "/v1/accounts/accounts/ACC-1675-9721/icon",
          "accountType": "Vendor"
      }
  }
}

Examples

{
    "event": "platform.commerce.order.created",
    "summary": "Order Created",
    "details": "The order ORD-1208-2301-8479 has been successfully created by Jane Doe and is now in the platform.",
    "object": {
        "id": "ORD-1208-2301-8479",
        "name": "ORD-1208-2301-8479",
        "objectType": "Order"
    },
    "timestamp": "2024-10-21T10:03:00.800Z",
    "actor": {
        "id": "USR-0556-8733",
        "name": "JANE DOE",
        "icon": "/v1/accounts/users/USR-0556-8733/icon",
        "account": {
            "id": "ACC-3408-7241",
            "name": "MPT_QA Commerce e2e client",
            "icon": "/v1/accounts/accounts/ACC-3408-7241/icon",
            "accountType": "Client"
        }
    },
    "type": "Public",
    "request": {
        "api": {
            "ip": "00.00.00.00",
            "geolocation": {
                "countryCode": "GB",
                "countryName": "United Kingdom",
                "region": "Scotland"
            },
            "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0"
        }
    },
    "documents": {
        "order": {
            "id": "ORD-1208-2301-8479",
            "type": "Termination",
            "status": "Draft"
        },
        "actor": {
            "id": "USR-0556-8733",
            "name": "Jane Doe",
            "icon": "/v1/accounts/users/USR-0556-8733/icon",
            "account": {
                "id": "ACC-3408-7241",
                "name": "MPT_QA Commerce e2e client",
                "icon": "/v1/accounts/accounts/ACC-3408-7241/icon",
                "accountType": "Client"
            }
        }
    },
    "viewers": [
        {
            "id": "ACC-3408-7241",
            "name": "MPT_QA Commerce e2e client",
            "type": "Client",
            "icon": "/v1/accounts/accounts/ACC-3408-7241/icon"
        },
        {
            "id": "ACC-1675-9721",
            "name": "Adobe",
            "type": "Vendor",
            "icon": "/v1/accounts/accounts/ACC-1675-9721/icon"
        }
    ],
    "id": "AUD-0391-8050-9033-9920"
}

Last updated

Was this helpful?