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