> ## Documentation Index
> Fetch the complete documentation index at: https://doc.soleaspay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Init new wallet

> Link a user in your app to a Sopay wallet.



## OpenAPI

````yaml GET /api/agent/link/new
openapi: 3.1.0
info:
  title: SoleasPay API
  description: API to authenticate and receive a bearer token from SoleasPay
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://soleaspay.com
security:
  - bearerAuth: []
paths:
  /api/agent/link/new:
    get:
      summary: Init new wallet
      description: Link a user in your app to a Sopay wallet.
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
          description: Your API key
        - name: email
          in: query
          required: true
          schema:
            type: string
            format: email
          description: User's email address
        - name: phone
          in: query
          required: true
          schema:
            type: string
          description: User's phone number
        - name: phoneCountry
          in: query
          required: true
          schema:
            type: string
          description: Country phone code (e.g., +237)
      responses:
        '200':
          description: Wallet linked or created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      apikey:
                        type: string
                        example: XLkynIRt7StyFdxnYQLxTyDxhk-WEjWQ1DEY-cwHMN8
                      matricule:
                        type: string
                        example: SP20231M
                  message:
                    type: string
                    example: link success
        '400':
          description: Error during linking
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: '400'
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Error message
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````