User Payment Methods APIs
POSTCreate
- Description
- A callback API which creates a userPaymentInfo record in Core Service.
- Request Endpoint
- POST https://<Example api server address>/user/paymentinfo
- Parameters
- None.
- cURL syntax
curl --include \ --request POST \ --header "Content-Type: application/json" \ --data-binary "{ \"userId\" : \"dc26a81a-c3c3-41eb-951c-e1a27fa4ba92\", \"deviceUdid\" : \"41eb-951c-e1a27fa4ba92\", \"paymentInfo\" : { \"fullName\" : \"Samarth J\", \"nickName\" : \"Sam\", \"fullAddress\" : \"#123, Jayanagar Bangalore\", \"paymentType\" : \"CREDITCARD\", \"cardScheme\" : \"Visa\", \"providerToken\" : \"todc26a81a-c3c3-41eb-951c-e1a27fa4ba92ken\", \"providerPaymentId\" : \"ppi12345\", \"isDefault\" : true, \"issuingAuthority\" : \"HDFC\" }, \"events\" : [ { \"eventName\" : \"Received data from MC\", \"timeStamp\" : 1462361924, \"data\" : { \"_class\" : \"com.Example.middleware.models.view.AddPMCallbackViewModel\", \"userId\" : \"dc26a81a-c3c3-41eb-951c-e1a27fa4ba92\", \"paymentInfo\" : { \"fullName\" : \"Samruddhi\", \"paymentType\" : \"CREDITCARD\", \"providerToken\" : \"1000000000000043\", \"providerPaymentId\" : \"sadzfxjndkd\", \"isDefault\" : true } }, \"eventSource\" : \"PAYLETTER\", \"eventOrder\" : 1 }, { \"eventName\" : \"Data sent to SAKA\", \"timeStamp\" : 1462361924, \"data\" : \"1000000000000043\", \"eventSource\" : \"PAYLETTER\", \"eventOrder\" : 2 } ], \"extRisk3DSEnrolledCard\" : true, \"extRisk3DSResult\" : \"success\" }" \ 'https://core.dev.Example.net/api/user/paymentinfo'
- POST body attributes (JSON)
Attribute Type Use Description userId
String Required UUID of a user. deviceUdid
String Required UUID of a device that belongs to a User. paymentInfo
Object Required Payment info object that contains the following child attributes. fullName
String Required Full name of a user. nickName
String Optional Nick name of a user. fullAddress
String Optional Full address of a user. cardScheme
String Required Can either be "Mastercard" or "Visa". paymentType
String Required Can be one of "Commercial Credit Corporate", "Consumer Credit Card Non-Secure", "Consumer Credit Card Secure", "Consumer Debit E-Comm", "Consumer Debit Non-Secure", "Consumer Debit Secure". providerToken
String Required Relates to the SAKA Token for Client to get "SummaryCCInfo" from the SAKA database. providerPaymentId
String Required Relates to Payletter's "paymentInfoID". isDefault
Boolean Optional Sets the default PM to yes or no. issuingAuthority
String Optional Indicates who has issued the credit / debit card. events
Array Optional An array of events with the following child attribute structure. eventName
String Optional Name of the event. timeStamp
Number Optional Unix timestamp. eventSource
String Optional Can be "PAYLETTER" or "MOBILE_CLIENT" depending on the context. eventOrder
Number Optional An integer indicating the precedence of the event. extRisk3DSEnrolledCard
Boolean Optional A 3DS enrolled card. extRisk3DSResult
String Optional The Secure card result. - POST body
Headers: Content-Type: application/json
{ "userId": "dc26a81a-c3c3-41eb-951c-e1a27fa4ba92", "deviceUdid": "41eb-951c-e1a27fa4ba92", "paymentInfo": { "fullName": "Samarth J", "nickName": "Sam", "fullAddress": "#123, Jayanagar Bangalore", "paymentType": "CREDITCARD", "cardScheme": "Visa", "providerToken": "todc26a81a-c3c3-41eb-951c-e1a27fa4ba92ken", "providerPaymentId": "ppi12345", "isDefault": true, "issuingAuthority": "HDFC" }, "events": [ { "eventName": "Received data from MC", "timeStamp": 1462361924, "data": { "_class": "com.Example.middleware.models.view.AddPMCallbackViewModel", "userId": "dc26a81a-c3c3-41eb-951c-e1a27fa4ba92", "paymentInfo": { "fullName": "Samruddhi", "paymentType": "CREDITCARD", "providerToken": "1000000000000043", "providerPaymentId": "sadzfxjndkd", "isDefault": true } }, "eventSource": "PAYLETTER", "eventOrder": 1 }, { "eventName": "Data sent to SAKA", "timeStamp": 1462361924, "data": "1000000000000043", "eventSource": "PAYLETTER", "eventOrder": 2 } ], "extRisk3DSEnrolledCard": true, "extRisk3DSResult": "success"
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "data": { "paymentId": "77fc6409-9e7c-4d1d-8c6c-160e95004dc6" }, "detail": null, "error": false, "message": "Adding user payment method successful" }
DELETEDelete
- Description
- Allows a client system to delete an existing payment method of a user.
- Request Endpoint
- DELETE https://<Example api server address>/user/paymentinfo/{providerPaymentId}
- Parameters
Parameter Type Use Description providerPaymentId String Required Corresponds to the paymentInfoId of Payletter. - cURL syntax
curl --include \ --request DELETE \ 'https://core.dev.Example.net/api/user/paymentinfo/providerPaymentId'
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "data": true, "detail": null, "error": false, "message": "Deleting user payment method successful" }
GETFetch a Payment Method Details
- Description
- This API will fetch all the details of a payment method.
- Request Endpoint
- GET https://<Example api server address>/user/{id}/paymentinfo/{paymentId}
- Parameters
Parameter Type Use Description id String (UUID) Required UUID of the User. paymentId String (UUID) Required Payment id of the payment method. - cURL syntax
curl --include \ 'https://core.dev.Example.net/api/user/id/paymentinfo/paymentId'
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "error": false, "message": "Fetched payment method details successfully", "detail": null, "data": { "id": "c0d40f47-94df-46be-a4a4-55bf82ab8a07", "updatedBy": "", "paymentProvider": "PAYLETTER", "paymentType": "DEBITCARD", "providerTransactionId": "09pfghhdh0", "providerPaymentId": null, "providerPaymentNumber": "6756", "providerRegisteredDate": null, "routingNumber": null, "issuingAuthority": "ICICI", "nickName": "ShruJ", "fullName": "Hebbalkar", "paymentAddress": { "street1": "123 Test Ln", "street2": "", "street3": "", "houseNumber": "#54", "streetName": "xyz", "flatNumber": "3A", "floor": "3rd", "building": "Prestige", "city": "London", "state": "st", "county": "Clark", "countryCode": "GB", "postal": "EC1A 1A9", "country": "United Kingdon", "addressType": "BILLING" }, "paymentInfoStatus": "VERIFIED", "defaultPaymentInfo": true, "addedOn": 1453370603877, "lastUsedOn": 1453370603877 } }
GETFetch All
- Description
- Fetches all the payment methods related to a user.
- Request Endpoint
- GET https://<Example api server address>/user/paymentinfo
- Parameters
- None.
- cURL syntax
curl --include \ 'https://core.dev.Example.net/api/user/id/paymentinfo?offset=0&limit=1'
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "error": false, "message": "Fetched payment methods succesfully", "detail": null, "data": [ { "id": "ee3a2da6-6fdf-435f-8470-6cb652e15dfb", "updatedBy": "", "paymentProvider": null, "paymentType": "DEBITCARD", "providerTransactionId": "pay34sdas", "providerPaymentId": null, "providerPaymentNumber": "2353", "providerRegisteredDate": null, "routingNumber": null, "issuingAuthority": "ICIC", "nickName": "SRN", "fullName": "Nagarkar Soumya", "paymentAddress": { "street1": "123 Test Ln", "street2": "", "street3": "", "houseNumber": "#54", "streetName": "xyz", "flatNumber": "3A", "floor": "3rd", "building": "Prestige", "city": "London", "state": "st", "county": "Clark", "countryCode": "GB", "postal": "EC1A 1A9", "country": "United Kingdon", "addressType": "BILLING" }, "paymentInfoStatus": "USER_IDENTIFICATION_PENDING", "defaultPaymentInfo": false, "addedOn": null, "lastUsedOn": 1453366840389 }, { "id": "c0d40f47-94df-46be-a4a4-55bf82ab8a07", "updatedBy": "", "paymentProvider": "PAYLETTER", "paymentType": "DEBITCARD", "providerTransactionId": "09pfghhdh0", "providerPaymentId": null, "providerPaymentNumber": "6756", "providerRegisteredDate": null, "routingNumber": null, "issuingAuthority": "ICICI", "nickName": "ShruJ", "fullName": "Hebbalkar", "paymentAddress": { "street1": "123 Test Ln", "street2": "", "street3": "", "houseNumber": "#54", "streetName": "xyz", "flatNumber": "3A", "floor": "3rd", "building": "Prestige", "city": "London", "state": "st", "county": "Clark", "countryCode": "GB", "postal": "EC1A 1A9", "country": "United Kingdon", "addressType": "BILLING" }, "paymentInfoStatus": "VERIFICATION_PENDING", "defaultPaymentInfo": false, "addedOn": 1453370603877, "lastUsedOn": 1453370603877 } ] }
GETFetch All Deleted Payment Methods
- Description
- Fetches all deleted payment methods.
- Request Endpoint
- GET https://<Example api server address>/user/deleted/payment/info
- Parameters
- None.
- cURL syntax
curl --include \ 'https://core.dev.Example.net/api/user/deleted/payment/info'
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "data": [ { "id": "39d31d99-b78f-4ba7-87ff-c490b2820949", "deleted": true, "addedOn": 1472622197248, "defaultPaymentInfo": false, "fullName": "Samarth J", "issuingAuthority": null, "lastUsedOn": 1472622195207, "nickName": "Vishwas S", "paymentInfoStatus": "VERIFIED", "paymentProvider": "PAYLETTER", "paymentType": "CREDITCARD", "providerPaymentId": "ppi123456", "providerPaymentNumber": "2006", "providerToken": "1000000000000043", "deletedBy": null, "deletedOn": null, "extRisk3DSEnrolledCard": true, "extRisk3DSResult": "Success", "deviceUdid": "2083718938012321038243", "cardBrand": "Visa", "cardBinCountry": null } ], "detail": null, "error": false, "message": "Fetching all deleted payment methods successful." }
GETFetch Expiring Payment Methods
- Description
- Allows a mobile client to fetch a user’s payment methods expiry info.
- Request Endpoint
- GET https://<Example api server address>/user/{userId}/paymentinfo/expiry/check
- Parameters
Parameter Type Use Description userId String (UUID) Required UUID of the User. - cURL syntax
curl --include \ 'https://core.dev.Example.net/api/user/userId/paymentinfo/expiry/check'
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "data": [ { "id": "c03199ab-5b60-4089-971b-6574fc1bc6d0", "providerPaymentId": "8af3a381-34c5-4f28-a091-7c4c2d2832b6", "providerPaymentNumber": "1111", "providerToken": "1000000000001711", "expiringSoon": false }, { "id": "8023915d-e7f9-4258-83e9-8a7db486d560", "providerPaymentId": "b14d9376-5b3a-46db-9c42-253942d56077", "providerPaymentNumber": "1111", "providerToken": "1000000000001773", "expiringSoon": false }, { "id": "b2ab85f9-f17e-45cb-bcdf-51741e69f551", "providerPaymentId": "18574e99-81f3-46b2-9580-f1ce1f6eff65", "providerPaymentNumber": "1111", "providerToken": "1000000000001826", "expiringSoon": false }, { "id": "f84fc8ce-4aeb-497d-9dc4-66ae1b06cff6", "providerPaymentId": "70e8444a-da88-41a5-904e-7fd195fdb919", "providerPaymentNumber": "8431", "providerToken": "1000000000001827", "expiringSoon": false }, { "id": "469303c1-e060-4ca2-ad31-7fa751c148e7", "providerPaymentId": "24eb6efc-161a-451d-81d8-cf992f2c6c95", "providerPaymentNumber": "1111", "providerToken": "1000000000001844", "expiringSoon": false }, { "id": "dab026bd-8732-464e-a45e-dc6dff652139", "providerPaymentId": "6c35efab-c79d-4e0b-a25b-7244ccdbdb73", "providerPaymentNumber": "1111", "providerToken": "1000000000001845", "expiringSoon": false } ], "detail": null, "error": false, "message": "Successfully retrieved user card expiry status" }
GETFetch User's Deleted Payment Methods
- Description
- Fetches only a particular User’s deleted payment methods.
- Request Endpoint
- GET https://<Example api server address>/user/{id}/deleted/payment/info
- Parameters
Parameter Type Use Description id String Required UUID of an existing user. - cURL syntax
curl --include \ 'https://core.dev.Example.net/api/user/id/deleted/payment/info'
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "data": [ { "id": "39d31d99-b78f-4ba7-87ff-c490b2820949", "deleted": true, "addedOn": 1472622197248, "defaultPaymentInfo": false, "fullName": "Samarth J", "issuingAuthority": null, "lastUsedOn": 1472622195207, "nickName": "Vishwas S", "paymentInfoStatus": "VERIFIED", "paymentProvider": "PAYLETTER", "paymentType": "CREDITCARD", "providerPaymentId": "ppi123456", "providerPaymentNumber": "2006", "providerToken": "1000000000000043", "deletedBy": null, "deletedOn": null, "extRisk3DSEnrolledCard": true, "extRisk3DSResult": "Success", "deviceUdid": "2083718938012321038243", "cardBrand": "Visa", "cardBinCountry": null } ], "detail": null, "error": false, "message": "Fetching user's deleted payment methods successful." }
PUTUpdate
- Description
This is a callback API which updates an userPaymentInfo record in Client Service based on the userId and providerPaymentId passed.
- The "providerPaymentId" attribute is only for fetching an existing record to update and cannot be updated.
- If an invalid "providerPaymentId" is passed, an exception is thrown by the system.
- Request Endpoint
- PUT https://<Example api server address>/user/paymentinfo
- Parameters
- None.
- cURL syntax
curl --include \ --request PUT \ --header "Content-Type: application/json" \ --data-binary "{ \"userId\" : \"dc26a81a-c3c3-41eb-951c-e1a27fa4ba92\", \"deviceUdid\" : \"segweg-sdrfhetrh-xfsdr\", \"paymentInfo\" : { \"fullName\" : \"Samarth J\", \"nickName\" : \"Sam\", \"fullAddress\" : \"#123, Jayanagar Bangalore\", \"paymentType\" : \"CREDITCARD\", \"cardScheme\" : \"Visa\", \"providerToken\" : \"todc26a81a-c3c3-41eb-951c-e1a27fa4ba92ken\", \"providerPaymentId\" : \"ppi12345\", \"isDefault\" : true, \"issuingAuthority\" : \"HDFC\" }, \"events\" : [ { \"eventName\" : \"Received data from MC\", \"timeStamp\" : 1462361924, \"data\" : { \"_class\" : \"com.Example.middleware.models.view.AddPMCallbackViewModel\", \"userId\" : \"dc26a81a-c3c3-41eb-951c-e1a27fa4ba92\", \"paymentInfo\" : { \"fullName\" : \"Samruddhi\", \"paymentType\" : \"CREDITCARD\", \"providerToken\" : \"1000000000000043\", \"providerPaymentId\" : \"sadzfxjndkd\", \"isDefault\" : true } }, \"eventSource\" : \"PAYLETTER\", \"eventOrder\" : 1 }, { \"eventName\" : \"Data sent to SAKA\", \"timeStamp\" : 1462361924, \"data\" : \"1000000000000043\", \"eventSource\" : \"PAYLETTER\", \"eventOrder\" : 2 } ] }" \ 'https://core.dev.Example.net/api/user/paymentinfo'
- PUT body attributes (JSON)
Attribute Type Use Description userId
String Required UUID of a user. deviceUdid
String Required UUID of a device which belongs to the User. paymentInfo
Object Required Payment info object that contains the following child attributes. fullName
String Optional Full name of a user. nickName
String Optional Nickname of a user. fullAddress
String Optional Full address of a user. cardScheme
String Required Can either be "Mastercard" or "Visa". paymentType
String Required Can be one of "Commercial Credit Corporate", "Consumer Credit Card Non-Secure",
"Consumer Credit Card Secure", "Consumer Debit E-Comm",
"Consumer Debit Non-Secure", "Consumer Debit Secure".providerToken
String Required Relates to a SAKA Token for Client to get "SummaryCCInfo" from the SAKA database. providerPaymentId
String Required Relates to Payletter's "paymentInfoID" which is the same as "providerPaymentId"
passed while creating a payment method.isDefault
Boolean Optional Sets the default PM (Payment Method) to yes or no. issuingAuthority
String Optional Indicates who has issued the credit / debit card. events
Array Optional an array of events with the below structure. eventName
String Optional Name of the event. timeStamp
Number Optional The Unix timestamp. eventSource
String Optional Can be "PAYLETTER" or "MOBILE_CLIENT" depending on the context. eventOrder
Number Optional An integer indicating the precedence of the event. - PUT body
Headers: Content-Type: application/json
{ "userId": "dc26a81a-c3c3-41eb-951c-e1a27fa4ba92", "deviceUdid": "segweg-sdrfhetrh-xfsdr", "paymentInfo": { "fullName": "Samarth J", "nickName": "Sam", "fullAddress": "#123, Jayanagar Bangalore", "paymentType": "CREDITCARD", "cardScheme": "Visa", "providerToken": "todc26a81a-c3c3-41eb-951c-e1a27fa4ba92ken", "providerPaymentId": "ppi12345", "isDefault": true, "issuingAuthority": "HDFC" }, "events": [ { "eventName": "Received data from MC", "timeStamp": 1462361924, "data": { "_class": "com.Example.middleware.models.view.AddPMCallbackViewModel", "userId": "dc26a81a-c3c3-41eb-951c-e1a27fa4ba92", "paymentInfo": { "fullName": "Samruddhi", "paymentType": "CREDITCARD", "providerToken": "1000000000000043", "providerPaymentId": "sadzfxjndkd", "isDefault": true } }, "eventSource": "PAYLETTER", "eventOrder": 1 }, { "eventName": "Data sent to SAKA", "timeStamp": 1462361924, "data": "1000000000000043", "eventSource": "PAYLETTER", "eventOrder": 2 } ] }
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "data": { "paymentId": "5b943e63-27e9-4e78-902d-25f32de837ac" }, "detail": null, "error": false, "message": "Updating user payment information successful" }
POSTUpdate Client with Status
- Description
- CallBack service to keep track of incorrect cvv attempts.
- Request Endpoint
- POST https://<Example api server address>/user/cvvfraud
- Parameters
- None.
- cURL syntax
curl --include \ --request POST \ --header "Content-Type: application/json" \ --data-binary "{ \"providerPaymentId\":\"c020757b-adb0-4754-adab-fccd0610eb4f\", \"userId\":\"842c9e8c-ed40-4d71-adb0-2180e1590c0f\" }" \ 'https://core.dev.Example.net/api/user/cvvfraud'
- POST body attributes (JSON)
Attribute Type Use Description userId
String Required The user UUID. providerPaymentId
String Required Relates to Payletter's "paymentInfoID". Used for record keeping purposes, and also for MC to use this to display full card details. - POST body
Headers: Content-Type: application/json
{ "providerPaymentId": "c020757b-adb0-4754-adab-fccd0610eb4f", "userId": "842c9e8c-ed40-4d71-adb0-2180e1590c0f" }
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
{ "data": { "id": "14120512-8f45-4bb7-b6f8-49c7a2d2f4ae", "updatedBy": "", "addedOn": null, "defaultPaymentInfo": false, "fullName": "Nagarkar Soumya", "issuingAuthority": "ICIC", "lastUsedOn": 1455690558521, "nickName": "SRN", "paymentInfoStatus": "VERIFIED", "paymentProvider": null, "paymentType": "DEBITCARD", "providerPaymentId": "c020757b-adb0-4754-adab-fccd0610eb4f", "providerPaymentNumber": "2353", "paymentAddress": null, "providerToken": null }, "detail": null, "error": false, "message": "Monitoring the number of cvv attempts" }