Testing with mock links
To try out the integration before SSO integration is complete, the sandbox environment allows replacing the oauth authorization code with a JWT encoded accountInfo, which will allow embedding the Melio web application without performing any calls to the partner's backend.
To do that you must generate the JWT encoded accountInfo by calling the sandbox mock link api. The mock link api accepts
a POST request at: https://partnerships.public-qa.melioservices.com/v1/auth/providers/standard/create-mock-link
For authentication send your api key in an api-key header.
You should provide the following JSON payload:
{
"partnerName": "<PartnerName>",
"token": "<Random UUID>",
"externalUserId": "<accountInfo.user.id>",
"externalOrgId": "<accountInfo.company.id>",
"accountInfo": {
"user": {... },
"company": {...}
}
}
The response will be a json object with a link you can use for the authUrl.
Curl example:
curl -L 'https://partnerships.public-qa.melioservices.com/v1/auth/providers/standard/create-mock-link' \
-H 'api-key: <api-key>' \
-H 'Content-Type: application/json' \
-H 'User-Agent: PostmanRuntime/7.39.0' \
-d '{"partnerName":"myPartnerName","token":"558bzdab2-k948-4d6e-28wq-78t634bc58dd","externalUserId":"us142664","externalOrgId":"ac51512","accountInfo":{"user":{"email":"jhon.do@gmail.com","firstName":"Jhon","lastName":"Doe"},"company":{"name":"Doe flowers and doves","legalName":"Jhon doe flowers inc","phoneNumber":"(500) 655-1234","address":{"state":"WI","line1":"1330 Commonwealth Dr","city":"Fort Atkinson","postalCode":"535381366"},"taxInfo":{"identifier":"123123123","type":"SSN"},"businessType":"sole-proprietorship"}}}'
Response:
{
"link": "https://partnerships.public-qa.melioservices.com/myPartnerName/auth?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc01vY2siOnRydWUsImFjY291bnRJbmZvIjp7InVzZXIiOnsiZW1haWwiOiJqaG9uLmRvQGdtYWlsLmNvbSIsImZpcnN0TmFtZSI6Ikpob24iLCJsYXN0TmFtZSI6IkRvZSJ9LCJjb21wYW55Ijp7Im5hbWUiOiJEb2UgZmxvd2VycyBhbmQgZG92ZXMiLCJsZWdhbE5hbWUiOiJKaG9uIGRvZSBmbG93ZXJzIGluYyIsInBob25lTnVtYmVyIjoiKDUwMCkgNjU1LTEyMzQiLCJhZGRyZXNzIjp7InN0YXRlIjoiV0kiLCJsaW5lMSI6IjEzMzAgQ29tbW9ud2VhbHRoIERyIiwiY2l0eSI6IkZvcnQgQXRraW5zb24iLCJwb3N0YWxDb2RlIjoiNTM1MzgxMzY2In0sInRheEluZm8iOnsiaWRlbnRpZmllciI6IjEyMzEyMzEyMyIsInR5cGUiOiJTU04ifSwiYnVzaW5lc3NUeXBlIjoic29sZS1wcm9wcmlldG9yc2hpcCJ9fSwidXNlcklkIjoidXMxNDI2NjQiLCJvcmdJZCI6ImFjNTE1MTIiLCJpYXQiOjE3MjA5NjkxNjV9.EgPGLtrw07tmMcxCF7adhQkhtR55fOTlPQ_HXfWfZB0"
}