Log to accounts

/account_change_log/log_to_accounts

Target audience: Developers

1
Release version: 4.4.0

Log to accounts

Introduction

This endpoint is used for batch logging to multiple accounts at once. To list available categories you can use the available categories endpoint.

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/account_change_log/available_categories
Production https://backend.worldoftulo.com/external/api/v1/account_change_log/available_categories

Requirements

Identity Scope
No /external/account_change_log/w

Parameters

Name Type Description Required
change_logs Array Array of account change logs
Size range: 1..1000 Allowed values: Change log objects
Yes

Change log

Change log properties Type Description Required
account_id String Account id
Size range: 1..1000 Allowed values: "/^[a-f\d]{24}$/i"
Yes
category_type String Category type
Allowed values: available categories
Yes
message String Message
Size range: 1..1024
Yes
requested_by String Who requested the change
Size range: 1..100
Yes

Curl Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
curl --request PUT \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/account_change_log/log_to_accounts \
  --header 'accept: application/json' \
  --header 'authorization: Bearer <token>' \
  --header 'content-type: application/json' \
  --data '{
            "change_logs": [
                {
                  "account_id": "6107cc1509c04cb9949c25fd",
                  "category_type": "distribution",
                  "message": "message",
                  "requested_by": "requested_by@email.com"                
                },
                {
                  "account_id": "6107cc1509c04cb9949c25ff",
                  "category_type": "distribution",
                  "message": "message",
                  "requested_by": "requested_by@email.com"                
                },
                {
                  "account_id": "6107cc1509c04cb9949c2601",
                  "category_type": "distribution",
                  "message": "message",
                  "requested_by": "requested_by@email.com"                
                }
                .......
                ......
                ......and so forth
            ]
          }' \

Response

A successful response will always return status code 207 to indicate that it's a multipart response. The response contains two arrays ok: [] and errors: []. If the result is a partial success the errors will be listed in the errors arrays. See response example partially successful response for an example.

This way you can resolve any errors in isolation without having the need to re-submit all of the change logs.

An unsuccessful response such as a 404 or a 500 response is returned as a normal error. See errors.

Successful response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
HTTP 207
{
  "ok": [
    "6107cc1509c04cb9949c25fd",
    "6107cc1509c04cb9949c25ff",
    "6107cc1509c04cb9949c2601",
    "6107cc1509c04cb9949c2603",
    "6107cc1509c04cb9949c2605",
    "6107cc1509c04cb9949c2607",
    "6107cc1509c04cb9949c2609",
    "6107cc1509c04cb9949c260b",
    "6107cc1509c04cb9949c260d",
    "6107cc1509c04cb9949c260f",
    "6107cc1509c04cb9949c2611",
    "6107cc1509c04cb9949c2613",
    "6107cc1509c04cb9949c2615",
    "6107cc1509c04cb9949c2617",
    "6107cc1509c04cb9949c2619",
    "6107cc1509c04cb9949c261b",
    "6107cc1509c04cb9949c261d",
    "6107cc1509c04cb9949c261f",
    "6107cc1509c04cb9949c2621",
    "6107cc1509c04cb9949c2623",
    "6107cc1509c04cb9949c2625",
    "6107cc1509c04cb9949c2627",
    "6107cc1509c04cb9949c2629",
    "6107cc1509c04cb9949c262b",
    "6107cc1509c04cb9949c262d"
  ],
  "errors": []
}

Partially successful response

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
HTTP 207
{
  "ok": [
    "6107cb9309c04cb8b68507bc",
    "6107cb9309c04cb8b68507be",
    "6107cb9309c04cb8b68507c0",
    "6107cb9309c04cb8b68507c2",
    "6107cb9309c04cb8b68507c4"
  ],
  "errors": [
    {
      "payload": {
        "account_id": "6107cb9309c04cb8b68507c6",
        "created_at": "2021-08-02T12:40:19.793+02:00",
        "message": "distribution has changed",
        "cateogory": "distribution",
        "requested_by": "requested_by@email.com"
      },
      "error_message": "cannot log to archived account"
    },
    {
      "payload": {
        "account_id": "6107cb9309c04cb8b68507c8",
        "created_at": "2021-08-02T12:40:19.793+02:00",
        "message": "distribution has changed",
        "cateogory": "distribution",
        "requested_by": "requested_by@email.com"
      },
      "error_message": "cannot log to archived account"
    },
    {
      "payload": {
        "account_id": "6107cb9309c04cb8b68507ca",
        "created_at": "2021-08-02T12:40:19.793+02:00",
        "message": "distribution has changed",
        "cateogory": "distribution",
        "requested_by": "requested_by@email.com"
      },
      "error_message": "cannot log to archived account"
    },
    {
      "payload": {
        "account_id": "6107cb9309c04cb8b68507cc",
        "created_at": "2021-08-02T12:40:19.793+02:00",
        "message": "distribution has changed",
        "cateogory": "distribution",
        "requested_by": "requested_by@email.com"
      },
      "error_message": "cannot log to archived account"
    },
    {
      "payload": {
        "account_id": "6107cb9309c04cb8b68507ce",
        "created_at": "2021-08-02T12:40:19.793+02:00",
        "message": "distribution has changed",
        "cateogory": "distribution",
        "requested_by": "requested_by@email.com"
      },
      "error_message": "cannot log to archived account"
    },
    {
      "payload": {
        "account_id": "6107cb9309c04cb8b68507d0",
        "created_at": "2021-08-02T12:40:19.793+02:00",
        "message": "distribution has changed",
        "cateogory": "distribution",
        "requested_by": "requested_by@email.com"
      },
      "error_message": "account 6107cb9309c04cb8b68507d0 does not belong to organisation"
    },
    {
      "payload": {
        "account_id": "6107cb9309c04cb8b68507d2",
        "created_at": "2021-08-02T12:40:19.794+02:00",
        "message": "distribution has changed",
        "cateogory": "distribution",
        "requested_by": "requested_by@email.com"
      },
      "error_message": "account 6107cb9309c04cb8b68507d2 does not belong to organisation"
    },
    {
      "payload": {
        "account_id": "6107cb9309c04cb8b68507d4",
        "created_at": "2021-08-02T12:40:19.794+02:00",
        "message": "distribution has changed",
        "cateogory": "distribution",
        "requested_by": "requested_by@email.com"
      },
      "error_message": "account 6107cb9309c04cb8b68507d4 does not belong to organisation"
    },
    {
      "payload": {
        "account_id": "6107cb9309c04cb8b68507d6",
        "created_at": "2021-08-02T12:40:19.794+02:00",
        "message": "distribution has changed",
        "cateogory": "distribution",
        "requested_by": "requested_by@email.com"
      },
      "error_message": "account 6107cb9309c04cb8b68507d6 does not belong to organisation"
    },
    {
      "payload": {
        "account_id": "6107cb9309c04cb8b68507d8",
        "created_at": "2021-08-02T12:40:19.794+02:00",
        "message": "distribution has changed",
        "cateogory": "distribution",
        "requested_by": "requested_by@email.com"
      },
      "error_message": "account 6107cb9309c04cb8b68507d8 does not belong to organisation"
    }
  ]
}

Errors

This API uses the common error conventions of the Payway API

See common error responses