Get customer details
Products
Through this API you can retrieve details of the payment products that are configured for your account.
Request
Which fields are required depend on the country code. This can determined by performing a getPaymentProduct call and supplying the country code. Each payment product field with the field usedForLookup set to true should be submitted in the request with a valid value.
PayloadGetCustomerDetailsRequest
Input for the retrieval of a customer's details.
Properties
|
|||
Property | Type | Required | Details |
---|---|---|---|
countryCode | string | yes | read close |
close
DescriptionThe code of the country where the customer should recide.
|
|||
array of object | yes | read close | |
close
DescriptionA list of keys with a value used to retreive the details of a customer. Depending on the country code, different keys are required. These can be determined with a getPaymentProduct call and using payment product fields with the property usedForLookup set to true.
|
|||
object | no | read close | |
key | string | no | read close |
close
DescriptionName of the key or property
|
|||
value | string | no | read close |
close
DescriptionValue of the key or property
|
Request example
This scenario you will probably use the most
-
// Note: a successful response from Create Session can be used directly as sessionDetails var sessionDetails = { "clientSessionId": "<clientSessionId from Create Session>", "customerId": "<customerId from Create Session>", "clientApiUrl": "<clientApiUrl from Create Session>", "assetUrl": "<assetUrl from Create Session>" }; var session = new connect(sessionDetails); var paymentProductId = 9000; var searchParameters = { countryCode: "SE", values: [ { key: "fiscalNumber", value: "012345678901" } ] }; session.getCustomerDetails(paymentProductId, searchParameters).then(function (paymentProductCustomerDetails) { // Process customer details }, function () { // Indicate that an error occurred });
Responses
Please find below an overview of the possible responses.
Response 200 - OKGetCustomerDetailsResponse
Personal information and address data related to the data in the request is returned.
Properties
|
|||
Property | Type | Required | Details |
---|---|---|---|
city | string | no | read close |
close
DescriptionThe city in which the customer recides.
|
|||
country | string | no | read close |
close
DescriptionThe country in which the customer recides.
|
|||
emailAddress | string | no | read close |
close
DescriptionThe email address registered to the customer.
|
|||
firstName | string | no | read close |
close
DescriptionThe first name of the customer
|
|||
fiscalNumber | string | no | read close |
close
DescriptionThe fiscal number (SSN) for the customer.
|
|||
languageCode | string | no | read close |
close
DescriptionThe code of the language used by the customer.
|
|||
phoneNumber | string | no | read close |
close
DescriptionThe phone number registered to the customer.
|
|||
street | string | no | read close |
close
DescriptionThe street on which the customer recides.
|
|||
surname | string | no | read close |
close
DescriptionThe surname or family name of the customer.
|
|||
zip | string | no | read close |
close
DescriptionThe ZIP or postal code for the area in which the customer recides.
|
Response example
This scenario you will probably use the most
-
{ "fiscalNumber" : "0123456789012", "city" : "Stockholm", "street" : "Gustav Adolfs torg 22", "zip" : "111 52", "firstName" : "Gustav", "surname" : "Adolfs", "emailAddress" : "gustav.adolfs@stockholm.se", "phoneNumber" : "0123456789", "languageCode" : "" }
Response 400 - Bad requestErrorResponse
The request is missing required values or no information could be found with the input data.
Properties
|
|||
Property | Type | Required | Details |
---|---|---|---|
errorId | string | yes | read close |
close
DescriptionUnique reference, for debugging purposes, of this error response
|
|||
array of object | yes | read close | |
close
DescriptionList of one or more errors
|
|||
object | no | read close | |
category | string | no | read close |
close
DescriptionCategory the error belongs to. The category should give an indication of the type of error you are dealing with.
Possible values:
|
|||
code | string | yes | read close |
close
DescriptionError code
|
|||
httpStatusCode | integer | no | read close |
close
DescriptionHTTP status code for this error that can be used to determine the type of error
|
|||
id | string | no | read close |
close
DescriptionID of the error. This is a short human-readable message that briefly describes the error.
|
|||
message | string | no | read close |
close
DescriptionHuman-readable error message that is not meant to be relayed to customer as it might tip off people who are trying to commit fraud
|
|||
propertyName | string | no | read close |
close
DescriptionReturned only if the error relates to a value that was missing or incorrect.
Contains a location path to the value as a JSonata query. Some common examples:
|
|||
requestId | string | no | read close |
close
DescriptionID of the request that can be used for debugging purposes
|
Response example
This scenario you will probably use the most
-
{ "errorId" : "657b10da-d2f9-4088-a948-bf190ef516b1-00000311", "errors" : [ { "code" : "1214", "id" : "CUSTOMER_DETAILS_NOT_FOUND", "message" : "No customer details could be found with the provided data." } ] }
Response 404 - Not foundErrorResponse
The paymentProductId you submitted does not exist.
Properties
|
|||
Property | Type | Required | Details |
---|---|---|---|
errorId | string | yes | read close |
close
DescriptionUnique reference, for debugging purposes, of this error response
|
|||
array of object | yes | read close | |
close
DescriptionList of one or more errors
|
|||
object | no | read close | |
category | string | no | read close |
close
DescriptionCategory the error belongs to. The category should give an indication of the type of error you are dealing with.
Possible values:
|
|||
code | string | yes | read close |
close
DescriptionError code
|
|||
httpStatusCode | integer | no | read close |
close
DescriptionHTTP status code for this error that can be used to determine the type of error
|
|||
id | string | no | read close |
close
DescriptionID of the error. This is a short human-readable message that briefly describes the error.
|
|||
message | string | no | read close |
close
DescriptionHuman-readable error message that is not meant to be relayed to customer as it might tip off people who are trying to commit fraud
|
|||
propertyName | string | no | read close |
close
DescriptionReturned only if the error relates to a value that was missing or incorrect.
Contains a location path to the value as a JSonata query. Some common examples:
|
|||
requestId | string | no | read close |
close
DescriptionID of the request that can be used for debugging purposes
|
Response example
This scenario you will probably use the most
-
{ "errorId" : "657b10da-d2f9-4088-a948-bf190ef516b1-00000312", "errors" : [ { "code" : "1070", "message" : "UNKNOWN_PAYMENT_PRODUCT_ID" } ] }