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

# Create a payment link



## OpenAPI

````yaml en/api-reference/openapi.json POST /payment-links
openapi: 3.1.0
info:
  title: Mysoleas API
  version: 3.0.0
  description: >-
    New Mysoleas architecture: business gateway, Mysoleas Identity Cloud, and
    SoleasPay ecosystem.
servers:
  - url: https://api.mysoleas.com
    description: Mysoleas gateway
  - url: https://account.mysoleas.com
    description: Mysoleas authentication
security:
  - spAuthToken: []
tags:
  - name: Identity Cloud
  - name: Plugin
  - name: Payment links
  - name: Subscriptions
  - name: Collections
  - name: Disbursements
  - name: Verification
  - name: Catalog
paths:
  /payment-links:
    post:
      tags:
        - Payment links
      summary: Create a payment link
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentLinkCreateRequest'
      responses:
        '200':
          $ref: '#/components/responses/PaymentLinkSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  schemas:
    PaymentLinkCreateRequest:
      type: object
      required:
        - currency
      properties:
        amount:
          type: integer
          minimum: 1
        currency:
          type: string
          example: XAF
        provider:
          type: string
          example: mtn_cmr
        channel:
          type: string
          enum:
            - PROVIDER
            - WALLET
            - AUTO
        feeBearer:
          type: string
          enum:
            - CUSTOMER
            - MERCHANT
          description: Indique qui supporte les fees du lien.
        fee_bearer:
          type: string
          enum:
            - CUSTOMER
            - MERCHANT
          deprecated: true
        customerPaysFees:
          type: boolean
          deprecated: true
        customer_pays_fees:
          type: boolean
          deprecated: true
        title:
          type: string
        description:
          type: string
        expires_at:
          type: string
          format: date-time
        max_usage:
          type: integer
          minimum: 1
        metadata:
          type: object
          additionalProperties: true
    PaymentLinkApiResponse:
      allOf:
        - $ref: '#/components/schemas/ApiResponseBase'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/PaymentLink'
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: integer
          example: 400
        message:
          type: string
          example: empty_data
        error:
          type: object
          properties:
            details:
              type:
                - object
                - array
                - string
                - 'null'
    ApiResponseBase:
      type: object
      properties:
        code:
          type: integer
          example: 200
        success:
          type: boolean
          example: true
        locale:
          type: string
          example: fr
        message:
          type: string
        meta:
          type: object
          additionalProperties: true
    PaymentLink:
      type: object
      properties:
        reference:
          type: string
        short_code:
          type: string
        payment_url:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - DISABLED
            - EXPIRED
        amount:
          type:
            - integer
            - 'null'
        currency:
          type: string
        title:
          type: string
        description:
          type: string
        expires_at:
          type:
            - string
            - 'null'
        created_at:
          type: string
  responses:
    PaymentLinkSuccess:
      description: Payment link created
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PaymentLinkApiResponse'
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    spAuthToken:
      type: apiKey
      in: header
      name: x-sp-auth-token
      description: >-
        JWT Bearer emis par Mysoleas Identity Cloud. Format: Bearer
        <access_token>.

````