e2e

Spend (Known Customer PSD2)

Learn how to enable spending for a known customer. This is PSD2 compliant journey.

1

GetCustomerJourneyDetailsUsingCustomerRef

If you already have the customerRef (from createApplication or you mapped it to your merchant log in), then you can skip log in and direct to the Customer Journey API to fetch the account status, credit limit and balances. This enables checks on the customer account status and eligibility to spend prior to starting the spend journey.

get
/customer-journey-details/{customerRef}
See API reference
2

SSO Widget - Log in

If PSD2 is required, the customer will log in. Even if you know the customer ref, the log in is still required for PSD2 journeys as the passcode element serves as the knowledge factor. The widget will return a token which will be used in the SCA widget.

3

retrieveSpendOptionsForCustomerRef

This endpoint is optional and only applicable If you have multiple spend plans such as instalments. Calling this endpoint with the basket value will return the eligible plans for the customer in the specified order.

4

initiate

This endpoint is only required for PSD2 journeys. It allows you to check if the transaction requires a PSD2 step-up. If it does not, it returns a transaction-exempt token. It also allows for merchant overriding of an exemption. The endpoint will return the SCA widget URL.

5

SCA Widget

This widget is only required for PSD2 journeys. It is hosted as an iframe that enables the initiation, re-issue, and entry of SMS OTPs. It returns the end result of the OTP journey back to the parent frame. Passing the OTP validation will result in an upgraded authorisation token being passed to the parent frame for use within the authorise endpoint.

6

authorise

Authorise a transaction once a spend option has been chosen by completing the required fields for the endpoint. Some fields may have been provided as part of previous responses in the journey, e.g. spend option (optional, defaults to revolving credit if not provided) and PSD2 authorisation token.

7

settle

Settle the authorisation once the order has been received using the authorisation ID passed from the previous endpoint.

Request Example

Request

1curl --request GET \
2  --url https://dapi.stg-newdaytechnology.net/customer-journey/customer-journey-details/%7BcustomerRef%7D \
3  --header 'api-version: SOME_STRING_VALUE' \
4  --header 'context-channel: Mobile' \
5  --header 'context-obo: mike.smith@customer.com' \
6  --header 'context-sub: john.brown@customer-service.com' \
7  --header 'context-tenant-id: f3a5e968b6de4b2380a76afd187cadf3'

Response Example

Response

JSON

1{
2  "customer": {
3    "status": "applicant",
4    "isRegisteredForOnline": true,
5    "customerRef": "4VNGUXxihf",
6    "isAccessBlocked": true,
7    "isAccessLocked": true
8  },
9  "applications": [
10    {
11      "id": "96dcbf9a-6673-4a55-855a-1fa1d20edfc3",
12      "state": "quoteAccept",
13      "subState": "downsell",
14      "creditLimit": 900,
15      "aer": 0.3994,
16      "apr": 0.399,
17      "sar": 0.3408
18    }
19  ],
20  "accounts": [
21    {
22      "status": "open",
23      "flags": [
24        "overLimit",
25        "pastDue"
26      ],
27      "aer": 0.4494,
28      "paymentDueDate": "2023-10-29",
29      "creditLimits": [
30        {
31          "type": "account",
32          "amount": {
33            "value": 20.99,
34            "currencyCode": "GBR"
35          },
36          "updatedAt": "2021-09-30T12:00:00Z",
37          "expiresAt": "2023-10-30T12:00:00Z"
38        }
39      ],
40      "availableCreditLimits": [
41        {
42          "type": "cash",
43          "amount": {
44            "value": 20.99,
45            "currencyCode": "GBR"
46          }
47        }
48      ],
49      "balances": {
50        "total": {
51          "value": 20.99,
52          "currencyCode": "GBR"
53        },
54        "pendingCredits": {
55          "value": 20.99,
56          "currencyCode": "GBR"
57        },
58        "pendingDebits": {
59          "value": 20.99,
60          "currencyCode": "GBR"
61        }
62      },
63      "dues": {
64        "isDelinquent": true,
65        "delinquencyAge": 1,
66        "arrears": [
67          {
68            "age": 1,
69            "amount": {
70              "value": 20.99,
71              "currencyCode": "GBR"
72            }
73          }
74        ]
75      }
76    }
77  ],
78  "kyc": {
79    "evidences": {
80      "property1": {
81        "customerJourneyId": "dbac4cf1-1ba9-402b-a212-844be8150b97",
82        "sessionId": "687cdd1a-617b-421f-8529-d13a3f171f6c",
83        "status": "authenticated",
84        "createdDateTimeUtc": "2019-08-24T14:15:22Z",
85        "lockoutEndDateTimeUtc": "2019-08-24T14:15:22Z",
86        "passCodeAttempted": true,
87        "passCodeResetsRemaining": 0,
88        "currentPassCodeAttemptsRemaining": 0
89      },
90      "property2": {
91        "customerJourneyId": "dbac4cf1-1ba9-402b-a212-844be8150b97",
92        "sessionId": "687cdd1a-617b-421f-8529-d13a3f171f6c",
93        "status": "authenticated",
94        "createdDateTimeUtc": "2019-08-24T14:15:22Z",
95        "lockoutEndDateTimeUtc": "2019-08-24T14:15:22Z",
96        "passCodeAttempted": true,
97        "passCodeResetsRemaining": 0,
98        "currentPassCodeAttemptsRemaining": 0
99      }
100    },
101    "isCompliant": true
102  }
103}