Skip to main content

Connect with Symblepay

This page details how the user connection flow works. It allows you to connect your users with Symblepay so they can be part of a user-to-user trade. This flow is the same for websites and iOS and Android apps. It assumes that you already have credentials to successfully call Symblepay APIs and have subscribed to notifications using Webhooks API.

How it works

Sunshine scenario is expected for the majority of the time.

  • When a user wants to connect with Symblepay in your application, request your backend services to create a connectUri using Symblepay API.
  • Re-direct user to Symblepay Frontend using https uri.
  • User signs in with existing Symblepay account or creates a new in Symblepay Frontend
  • Your backend services receives notification with coupling between Marketplace User id and Symblepay Account Id.
  • Meanwhile user returns to your application (using re-direct or switching apps) and sees the success screen.

User Connection Flow

Initiate connect flow

Initiate Flow
curl https://api.symblepay.io/v1/marketplace/users/connect \
-X POST \
-H 'Authorization: Bearer {API_TOKEN}' \
-H 'Content-Type: application/json'\
-d '{
"successUrl": "{SUCCESS_URL}",
"cancelUrl": "{CANCEL_URL}",
"userId": "{USER_ID}"
}'
Response example
{
"redirectUrl": "https://api.symblepay.io/initiate-authenticate-flow"
}

Send your users to the redirectUrl in a browser or In-App browser on Android or iOS

Connect user flow was a success

Wait for the user to be redirected back to your successUrl.

Suceess callback example
https://marketplace.dk/success-url"

Receive webhook

A webhook is also sent to ensure you get the information.

Webhook example
{
"id": "ed3325d8-b379-444a-9cc1-7d119efefbea",
"referenceId": "616de408-5f8f-4ef3-ba28-6b4827145070",
"eventName": "user.connected",
"eventDate": "2024-02-16T10:36:20+01:00",
"symblepayAccountId": "f6c4a43f-682e-4559-b8d1-11a63afd134a"
}

Flow was a cancelled

Wait for the user to be redirected back to your cancelUrl.

Cancel callback example
https://marketplace.dk/cancel-url