Legion
  • General
    • Introducing Legion
    • The Legion Webapp
    • High Level Sale Customer Journey
    • The Legion Whitepaper
  • Backend
    • Intro
    • Authentication
    • API Integration Flow
    • Swagger Documentation
  • Front end
    • Intro
  • Smart Contracts
    • Overview
    • Architecture
    • Fixed Price Sale
    • Sealed Bid Auction Sale
    • Pre-Liquid Token Sale V1
    • Pre-Liquid Token Sale V2
    • Address Registry
  • Deployments
    • Ethereum Mainnet
    • Arbitrum One
  • Security
    • Audits
    • Bug Bounty
    • Incident Response Plan
    • Incident Response (Blacklist)
Powered by GitBook
On this page
  • Authentication Flow for
  • Investment Round Flow
  • Fund Management Flow
  • Post-Application Actions
  1. Backend

API Integration Flow

This document outlines the step-by-step integration process with the Investment Round API, including user creation, authentication, round participation, and fund management.

PreviousAuthenticationNextIntro

Last updated 3 months ago

Please see the for the API reference, output, and more context for each endpoint.

Please note: you must request a username and password from the Legion team.

Authentication Flow for Pre-Liquid Token Sale V2

1. Create User

  • Endpoint: POST /v1/integration/user

  • Description: Creates a new user account in the system

2. Generate Authentication Token

  • Endpoint: POST /v1/integration/token

  • Description: Generates a JWT token for authentication

Investment Round Flow

3. List Active Rounds

  • Endpoint: GET /v1/integration/rounds

  • Description: Retrieves all currently active investment rounds

4. Get Round Details

  • Endpoint: GET /v1/integration/rounds/{id}

  • Description: Retrieves comprehensive details for a specific investment round

5. Submit Round Application

  • Endpoint: POST /v1/integration/rounds/{id}/submit

  • Description: A user applies to participate in the selected investment round

Fund Management Flow

6. Generate Deposit Signature

  • Endpoint: GET /v1/integration/rounds/{id}/signature

  • Description: Generates a cryptographic signature required for depositing funds

7. Contract Interaction for USDC Deposit

This step involves direct interaction with the smart contract:

  1. Approve USDC Transfer

    • Authorize the contract to transfer USDC from the user's wallet

  2. Execute Deposit

    • Use the signature from Step 6 to deposit USDC into the contract

    • A webhook notification will be triggered upon a successful deposit

8. Application Review Process

The project team will review the submitted application and determine one of three outcomes:

  • Full Approval

    • The full deposited amount is accepted

  • Partial Approval

    • Only a % of the deposited amount is accepted

  • Rejection

    • None of the deposited allocation is accepted

9. Track Application Status

  • Endpoint: GET /v1/integration/rounds/{id}/application

  • Description: Retrieves the current status of a user's round application

  • Path Parameter: id - The unique identifier of the round

Post-Application Actions

Based on the application status, different actions are required:

Rejected Applications

  • Action Required: Claim USDC refund through contract interaction

  • When: Immediately after rejection notification

Approved Applications

  1. Refund Period: MiCA states that there must be a 14-day refund period for all available EU citizens

  2. Immediate Action Required: No action

Partially Approved Applications

  1. Refund Period: MiCA states that there must be a 14-day refund period for all available EU citizens

  2. Immediate Action: Claim excess USDC refund through contract interaction

  3. Action Required: Claim tokens through contract interaction

  4. When: After the vesting period begins

Swagger documentation
Integration flow