Summary of the steps
- Create a Meld customer and store the
customerId - Check whether that customer is already KYC-approved
- If not, launch Meld’s hosted KYC link and wait for the
APPROVEDwebhook - Start the transaction with
bypassKyc: true
Before you begin
- You have contacted your Meld account manager to enable a KYC provider for you
- You can store the Meld
customerIdagainst each of your users - You have a webhook endpoint configured to receive
CUSTOMER_KYC_STATUS_CHANGEevents (or you plan to poll)
To test this flow in Meld’s sandbox, see KYC testing.
Step 1: Create a Meld customer
This step is required for the user to skip logging into the onramp, and is a one-time setup per user. CallPOST /accounts/customers and pass in the user’s first name, last name, email address, phone number, and birthday.
Request
Response
id in the response is now the Meld customerId of that user. The customerId is critical for all of the following steps, make sure you safely store it and tie it to the user in your system.
Step 2: Check if the User is Already KYCed
You can keep track in your own system if a particular user has been KYCed via Meld. If you don’t keep track, you can callGET /accounts/customers, passing the customerId of the user, to check whether the user has already been KYCed with Meld.
If the user has been KYCed successfully, then you do not have to KYC the user again. The response will look something like this for a KYCed user, with the key field being serviceProviderCustomers.kyc.status.
Response
serviceProviderCustomers.kyc.status will show a status other than APPROVED, or the serviceProviderCustomers object will be blank, depending on if the user has attempted KYC previously or not. Either way, the user will have to be KYCed successfully with Meld first.
Step 3: Have Meld KYC the User
This step is only needed if the user isn’t already successfully KYCed. In other words, if the value ofserviceProviderCustomers.kyc.status in the previous step is APPROVED then you can skip this step.
To KYC the user, call POST /accounts/customers/{customerId}/kyc/initiate. The customerId is in the path.
Note that Sumsub is being used as the sample KYC provider in these requests.
Request
url that you should then launch from your UI.
Response
serviceProviderCustomers.kyc.status shows as APPROVED.
If the serviceProviderCustomers.kyc.status is REJECTED, this means the user has failed KYC. They may retry submit with corrected data. If they still fail, then the user will have to try KYCing with the onramp directly, in the onramp’s widget.
Step 4: Initiate a transaction
Pass Meld thecustomerId of the user when you call POST /crypto/session/widget. Make sure to include the param "bypassKyc": true, which tells Meld to look up that customer’s KYC information and forward it to the onramp.
Request
Response
widgetUrl or serviceProviderWidgetUrl, then the user go straight to the onramp’s payment screen, as seen in this demo video.
And that’s it! Congrats, you are now using Meld’s Unified KYC product to enhance your users’ experience!