Subscription
2 endpoints · WealthSync API
Add user subscription.
This API is used to create a new subscription for a user. Call this API ONLY ONCE per user, before initiating the AA consent flow. This is the foundational API called to register a user with WealthSync and establishes the user's permanent identity in the system.
Request Body Parameters:
→ uniqueIdentifier (required): This is the primary identifier for the user in your system. It can be a random string, mobile number, or UUID. This value is added at the time of subscription and MUST be used consistently across ALL WealthSync API calls. It never changes for a user.
→ mobileNumber (required): The user's 10-digit mobile number.
→ subscriptionStatus (required): Set to "YES" to activate the user's account.
FAQ: Q. What is a unique identifier (UID)? Why do we create it? Is it mandatory? UID is simply a value that uniquely identifies a user in your system. It can be anything that stays the same every time the user logs in, such as:
-> Random string: 7410039245type
-> Mobile number: 7410039245
-> UUID: 9805bd63-2bd5-49ef-bd74-21439416487b
We create userId so that Wealthsync can recognize the user across sessions. Is it mandatory? Yes. In Wealthsync it is mandatory. Without it, we cannot create a subscription, link accounts, initiate consent, or fetch/analyze user data.
Q. What happens if I set the subscription as ‘NO’? If set to "NO", the consent journey will not take place. You will still be able to view the previously fetched data, but no new data will be retrieved.
Q. What are the implications if it becomes NO? Will we (FIU) stop getting customers’ data? If status changes YES → NO, you still have access to past data. However, daily data refresh stops immediately.
Headers
- X-API-KEYstringrequiredYour secret API key for the environment you are calling (Stage and Live use different keys).
- X-API-APP-IDstringrequiredThe App ID issued together with the key.
- Content-Typestringrequiredapplication/json
Body parameters
application/json- uniqueIdentifierstringrequiredRequired. Your identifier for the user, exactly as sent when the user was subscribed. Never changes for a user. Non-empty string.minLength 1default user-12345
- mobileNumberstringrequiredRequired. The user's 10-digit mobile number.nullabledefault 9876543210
- subscriptionStatusstringrequiredRequired. Subscription status. Allowed values: YES (activate), NO (deactivate).nullabledefault YES
Sample request body
Responses
200OK
- messagestringoptionalNo description.nullable
400Bad Request
- dataobjectoptionalNo description.
- messagesarray<string>optionalNo description.nullable
- request_idstringoptionalNo description.nullable
- successbooleanoptionalNo description.default false
- messagestringoptionalNo description.nullabledefault XXXXX
- isBillablebooleanoptionalNo description.
- statusCodeinteger (int32)optionalNo description.default 400
401Unauthorized
- dataobjectoptionalNo description.
- messagesarray<string>optionalNo description.nullable
- request_idstringoptionalNo description.nullable
- successbooleanoptionalNo description.default false
- messagestringoptionalNo description.nullabledefault XXXXX
- isBillablebooleanoptionalNo description.
- statusCodeinteger (int32)optionalNo description.default 401
500Internal Server Error
- dataobjectoptionalNo description.
- messagesarray<string>optionalNo description.nullable
- request_idstringoptionalNo description.nullable
- successbooleanoptionalNo description.default false
- messagestringoptionalNo description.nullabledefault XXXXX
- isBillablebooleanoptionalNo description.
- statusCodeinteger (int32)optionalNo description.default 500
Code samplescurl · Node.js · Python
Update an existing user subscription (WealthSync AA).
This API is used to update an existing user's subscription status. Call this API when the user wants to change their subscription from YES → NO or NO → YES.
Prerequisites: → The user must already be subscribed via the Add Subscription API (POST user-subscriptions).
Request Body Parameters:
→ uniqueIdentifier (required): The primary identifier added at the time of subscription. It must be the exact same value used during the initial subscription and MUST never change for this user.
→ mobileNumber (required): The user's 10-digit mobile number.
→ subscriptionStatus (required): Set to "YES" to activate or "NO" to deactivate the subscription. If set to "NO", previously fetched data remains accessible but no new data will be fetched.
Headers
- X-API-KEYstringrequiredYour secret API key for the environment you are calling (Stage and Live use different keys).
- X-API-APP-IDstringrequiredThe App ID issued together with the key.
- Content-Typestringrequiredapplication/json
Body parameters
application/json- uniqueIdentifierstringrequiredRequired. Your identifier for the user, exactly as sent when the user was subscribed. Never changes for a user. Non-empty string.minLength 1default user-12345
- mobileNumberstringrequiredRequired. The user's 10-digit mobile number.nullabledefault 9876543210
- subscriptionStatusstringrequiredRequired. Subscription status. Allowed values: YES (activate), NO (deactivate).nullabledefault YES
Sample request body
Responses
200OK
- messagestringoptionalNo description.nullable
400Bad Request
- dataobjectoptionalNo description.
- messagesarray<string>optionalNo description.nullable
- request_idstringoptionalNo description.nullable
- successbooleanoptionalNo description.default false
- messagestringoptionalNo description.nullabledefault XXXXX
- isBillablebooleanoptionalNo description.
- statusCodeinteger (int32)optionalNo description.default 400
401Unauthorized
- dataobjectoptionalNo description.
- messagesarray<string>optionalNo description.nullable
- request_idstringoptionalNo description.nullable
- successbooleanoptionalNo description.default false
- messagestringoptionalNo description.nullabledefault XXXXX
- isBillablebooleanoptionalNo description.
- statusCodeinteger (int32)optionalNo description.default 401
500Internal Server Error
- dataobjectoptionalNo description.
- messagesarray<string>optionalNo description.nullable
- request_idstringoptionalNo description.nullable
- successbooleanoptionalNo description.default false
- messagestringoptionalNo description.nullabledefault XXXXX
- isBillablebooleanoptionalNo description.
- statusCodeinteger (int32)optionalNo description.default 500