Payment API

ChangeLog

API Documentation

Senest redigeret:

Introduction

A ChangeLog represents a change in an entity, such that the changes are transparent and traceable over time. A single ChangeLog entity can be used to reason what, why, when and by whom an entity was changed.

ChangeLog types

ChangeLogs can be of the following types:

  • Contact
  • Subscription
  • Agreement
  • AddOn

Properties

Name

Type

Example

Description

changeGuid

STRING(64)

c003d62e-b13b-4651-9b7b-xxxxxxxxxxxx

Unique GUID

createdTs

TIMESTAMP

 

Timestamp of ChangeLog creation

entityType

ENUM

Contact

The type of entity that has been changed.
Available options:
Contact | Subscription | Agreement | AddOn

entityGuid

STRING(64)

bd63f62e-d55a-4651-9b7b-xxxxxxxxxxxx

Unique GUID of the entity that has been changed

changeTs

TIMESTAMP

 

Timestamp of when the entity was changed

oldEntityJson

JSON

 

JSON representation of the entity before any of the changes were applied to it

changeDescription

STRING

“Subscription processed”

Textual description of the change

changeMetaData

JSON

 

Meta data of changes

requester

STRING

individual@your-ngo.org” or “API”

Description of the person or system that triggered the change.
Empty if change was triggered internally within OnlineFundraising.

requesterIp

STRING

18.195.xx.xxx

The IP address of whomever responsible for triggering the change.
Empty if change was triggered internally within OnlineFundraising.

systemRequest

BOOLEAN

 

Boolean denoting whether the change was triggered by OnlineFundraising

keysOnly

BOOLEAN

 

Boolean denoting whether only the keys of an entity should be logged. Utilized when anonymizing contacts.

changes

JSON

 

JSON representation of the changes that were applied to the entity. Only contains the fields that were changed. Has data on both the old and new values.

Endpoints

For each entity type that supports logging changes there exist an endpoint for which the ChangeLogs of a specific entity can be retrieved.

Entity

Operation

Endpoint

QueryParam (Optional)

Contact

GET

https://payment.api.v3.onlinefundraising.dk/contact/{contactGuid}/log

?limit=x

Subscription

GET

https://payment.api.v3.onlinefundraising.dk/subscription/{subscriptionGuid}/log

?limit=x

Agreement

GET

https://payment.api.v3.onlinefundraising.dk/agreement/{agreementGuid}/log

?limit=x

By specifiying the query parameter “limit” it can be controlled how many ChangeLogs to retrieve. Default is no limit. ChangeLogs are returned sorted with the most recent first.

Response

HTTP

Description

200

OK

HTTP 200 Example

[
    {
        "changeGuid": "16b48073-xxxx-xxxx-xxxx-0a337c4ba4dc",
        "createdTs": "2021-04-23 10:26:07 +0200",
        "entityType": "Subscription",
        "entityGuid": "1222ac4a-xxxx-xxxx-xxxx-bb9df2b9ab53",
        "changeTs": "2021-04-23 10:26:07 +0200",
        "oldEntityJson": "{\"subscriptionGuid\":\"1222ac4a-xxxx-xxxx-xxxx-bb9df2b9ab53\",\"merchantId\":\"your-ngo\", ...}",
        "changeDescription": "Cancel subscription",
        "changeMetaData": "{}",
        "requester": "individual@your-ngo.org",
        "systemRequest": false,
        "changes": [
            {
                "newValue": 100102,
                "fieldName": "cancelCode"
            },
            {
                "newValue": "anden årsag",
                "fieldName": "cancelDescription"
            },
            {
                "newValue": "2021-04-23 10:26:06 +0200",
                "fieldName": "cancelledTs"
            },
            {
                "newValue": "2021-04-23 10:26:06 +0200",
                "fieldName": "inactivatedTs"
            },
            {
                "newValue": "Inactive",
                "oldValue": "Active",
                "fieldName": "state"
            }
        ],
        "keysOnly": false,
        "requesterIp": "18.195.xx.xxx"
    }
]