An example of a Wallet creation flow is described in this section.
General Flow
The described flow is an example on the APIs that should be used to create a digital wallet for a customer.
API Flow
Auth-Service API
POST /protocol/openid-connect/token
curl --location --request POST 'https://{{baseUrl}}/auth-service/1.1/protocol/openid-connect/token' \
--header 'x-api-key: {{apikey}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username={{username}}' \
--data-urlencode 'password={{password}}'
200 (OK)
{
"access_token": "{{access_token}}",
"expires_in": 300,
"refresh_expires_in": 1800,
"refresh_token": "{{refresh_token}}",
"token_type": "Bearer",
"not-before-policy": 0,
"session_state": "{{session_state}}",
"scope": "profile email"
}
Entity API
POST /entities/1.2/entities
curl --location 'https://{{baseUrl}}/entities/1.2/entities' \
--header 'X-User-Bearer: Bearer {{acces_token}}'\
--header 'x-api-key: {{apices}}' \
--data-raw '{
"name": {
"firstName": "John",
"lastName": "Doe",
"fullName": "John Doe"
},
"contact": {
"phoneNumber": "+59811111111",
"email": "user@example.com",
"postalAddress": {
"addressLine1": "Jose Ellauri",
"addressLine2": "Esq. 21 de Setiembre",
"city": "Montevideo",
"stateProvince": "Montevideo",
"postalCode": "11300",
"country": "UY"
}
} ,
"idDocuments": [
{
"idType": "nationalId",
"idNumber": "11111111",
"issueDate": "2023-04-18",
"expiryDate": "2033-04-18",
"issuerCountry": "UY"
}
],
"dateOfBirth": "1980-02-22",
"birthCountry": "UY",
"nationality": "UY",
"residenceCountry": "AD",
"gender": "m",
"entityType": "naturalPerson"
}'
201(Created)
{
"entityId": "2210",
"creationDate": "2023-04-18T19:06:55.267Z",
"lastLoginDate": null,
"users": [],
"name": {
"title": null,
"firstName": "John",
"middleName": null,
"lastName": "Doe",
"secondlastName": null,
"fullName": "John Doe",
"nativeName": null
},
"contact": {
"phoneNumber": "+59811111111",
"email": "user@example.com",
"firstName": null,
"lastName": null,
"postalAddress": {
"addressLine1": "Jose Ellauri",
"addressLine2": "Esq. 21 de Setiembre",
"addressLine3": null,
"city": "Montevideo",
"stateProvince": "Montevideo",
"postalCode": "11300",
"country": "UY",
"canton": null
}
},
"beneficiaries": [],
"idDocuments": [
{
"idType": "nationalId",
"idNumber": "11111111",
"issueDate": "2023-04-18",
"expiryDate": "2033-04-18",
"issuer": null,
"issuerPlace": null,
"issuerCountry": "UY",
"otherDescription": null
}
],
"dateOfBirth": "1980-02-22",
"birthCountry": "UY",
"nationality": "UY",
"residenceCountry": "AD",
"occupation": null,
"gender": "m",
"entityProfileData": [],
"metadata": [],
"entityType": "naturalPerson",
"r_version": 1,
"parentId": null,
"entityStatus": "active",
"entitySubStatus": "CREATED",
"entitySubStatusDescription": "Entity was just created",
"lockReason": null,
"channel": null
}
Take into account that not all the information is required, see the api definition for more information about which fields are mandatory.
Entity Alias API
PUT /entities/1.2/entities/2210/alias
curl --location --request PUT 'https://{{baseUrl}}/entities/1.2/entities/2210/alias' \
--header 'X-User-Bearer: Bearer {{access_token}}' \
--header 'x-api-key: {{api_key}}' \
--data-raw '{
"keys": [
"documentType@nationalId$documentNumber@11111111$issuerCountry@UY"
]
}'
Wallet API
POST /wallets/1.0/wallets
curl --location --request POST 'https://{{baseUrl}}/wallets/1.0/wallets' \
--header 'X-User-Bearer: Bearer {{access_token}}' \
--header 'x-api-key: {{api_key}}' \
--data-raw '{
"entityId": "2210",
"walletStatus": "active"
}'
201(Created)
{
"entityId": "2210",
"isBatch": false,
"lockReason": "",
"metadata": [],
"walletId": "1128",
"walletStatus": "active"
}
Wallet Payment Methods API
POST /wallets/1.0/wallets/1128/paymentmethods
curl --location --request PUT 'https://{{baseUrl}}//wallets/1.0/wallets/1128/paymentmethods' \
--header 'X-User-Bearer: Bearer {{access_token}}' \
--header 'x-api-key: {{api_key}}' \
--data-raw '{
{
"paymentMethodAlias": "USD",
"paymentMethodType": "emoney-usd"
}'
201(Created)
{
"inactiveReason": "",
"paymentMethodAlias": "USD",
"paymentMethodData": {
"ACCOUNT_ID": "1000854"
},
"paymentMethodId": "3635383934372D313132382D33303831",
"paymentMethodLinkData": [],
"paymentMethodMetadata": [],
"paymentMethodStatus": "active",
"paymentMethodType": "emoney-usd",
"paymentMethodTypeClass": "emoney",
"paymentMethodTypeCountry": null,
"paymentMethodTypeCurrency": "USD",
"paymentMethodTypeDesc": "eMoney USD",
"paymentMethodTypeDirection": null,
"paymentMethodTypeImageUrl": null,
"paymentMethodTypeStatus": "available",
"paymentMethodTypeUsage": null,
"walletId": "1128"
}