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

# Generate Payment Link

> Generate payment link for the user based on the provided request parameters.

# Generate Payment Link

This endpoint allows merchants to generate a payment link with customer-specific details such as name, amount, and notes.

## Request Body

* **FullName** (string, required): The full name of the customer. Must be between 2 to 50 characters and match the pattern `[a-zA-Z./' ]+`.
* **Email** (string, required): The email address of the customer. Must be between 3 to 45 characters.
* **Phone** (string, required): The phone number of the customer.
* **invoiceAmount** (number, required): The amount for the payment, should be equal to or greater than 10.
* **notes** (string, required): Any additional information or description for the payment.
* **isTermsAndConditionsAccepted** (boolean, required): Whether the customer accepts the terms and conditions.
* **currency** (string, optional): The currency for the payment, must be "AED".
* **expiryOn** (string, required): The expiry date of the payment link in `yyyy-MM-dd HH:mm:ss` format AND recommended expiry date should be 30 days from the payment link generation date.
* **Is\_QR\_needed** (boolean, required): Whether a QR code is needed.
* **Is\_invoice\_generated** (boolean, required): Whether an invoice is generated.
* **Address** (string, optional): The address of the customer.
* **City** (string, optional): The city of the customer.
* **Country** (string, optional): The country of the customer.
* **Invoice\_Id** (string, optional): The unique ID of the invoice.
* **Product\_Id** (string, optional): The unique ID of the product.
* **callback\_url** (string, optional): The callback URL for payment updates.

### Example Request

```json theme={null}
{
  "FullName": "John Doe",
  "Email": "john.doe@example.com",
  "Phone": "1234567890",
  "invoiceAmount": 50.00,
  "notes": "Payment for services rendered",
  "isTermsAndConditionsAccepted": true,
  "currency": "AED",
  "expiryOn": "2025-03-01 12:00:00",
  "Is_QR_needed": true,
  "Is_invoice_generated": true,
  "Address": "123 Main Street",
  "City": "Dubai",
  "Country": "UAE",
  "Invoice_Id": "INV123456",
  "Product_Id": "PROD7890",
  "callback_url": "https://example.com/callback"
}
```


## OpenAPI

````yaml POST /payment-link/generate
openapi: 3.0.1
info:
  title: OP APIs
  description: OP APIs
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://sandbox.omnispay.com/api/
    description: Sandbox server for testing and integration without affecting live data
security:
  - apiKey: []
    hmacSignature: []
    accountId: []
paths:
  /payment-link/generate:
    post:
      tags:
        - Public API for Payment Link Operations
      summary: Generate Payment Link
      description: >-
        Generate payment link for the user based on the provided request
        parameters.
      operationId: generatePaymentLinkForCustomer
      parameters:
        - name: Time-Zone
          in: header
          required: true
          schema:
            type: string
        - name: User-Agent
          in: header
          required: false
          schema:
            type: string
      requestBody:
        description: Request payload for generating payment link
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentLinkPublicRequest'
        required: true
      responses:
        '200':
          description: OK. Payment link generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonResponse'
        '400':
          description: Bad Request. The input data is invalid or malformed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonResponse'
        '401':
          description: >-
            Unauthorized. Access is denied due to invalid credentials or missing
            authentication token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonResponse'
        '403':
          description: Forbidden. You do not have permission to access this resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonResponse'
        '404':
          description: Not Found. The requested resource could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonResponse'
        '409':
          description: >-
            Conflict. The request could not be completed due to a conflict with
            the current state of the resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonResponse'
        '429':
          description: >-
            Too Many Requests. The user has sent too many requests in a given
            amount of time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonResponse'
        '500':
          description: Internal Server Error. An unexpected error occurred on the server
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonResponse'
components:
  schemas:
    PaymentLinkPublicRequest:
      required:
        - Email
        - FullName
        - Is_QR_needed
        - Is_invoice_generated
        - Phone
        - expiryOn
        - invoiceAmount
        - isTermsAndConditionsAccepted
        - notes
      type: object
      properties:
        FullName:
          maxLength: 50
          minLength: 2
          pattern: '[a-zA-Z./'' ]+'
          type: string
          description: >-
            User's full name (only alphabets, dot, slash, apostrophe, and space
            allowed)
          example: John Doe
        Address:
          type: string
          description: User's address
          example: 123 Street, City, Country
        City:
          pattern: ^[a-zA-Z\s.'-]+$
          type: string
          description: City name
          example: Dubai
        Country:
          pattern: ^[a-zA-Z\s.'-]+$
          type: string
          description: Country name
          example: UAE
        Email:
          maxLength: 60
          minLength: 3
          type: string
          description: User email address
          example: user@example.com
        Phone:
          type: string
          description: User phone number
          example: '+971501234567'
        invoiceAmount:
          minimum: 10
          type: number
          description: Invoice amount (minimum 10)
          format: double
          example: 100.5
        notes:
          maxLength: 150
          minLength: 2
          type: string
          description: Notes related to payment
          example: 'Payment for order #12345'
        isTermsAndConditionsAccepted:
          type: boolean
          description: Must be true to accept terms and conditions
          example: true
        currency:
          type: string
          description: Currency (only AED is allowed)
          example: AED
        Is_QR_needed:
          type: boolean
          description: Specify if a QR code is required
          example: true
        Is_invoice_generated:
          type: boolean
          description: Specify if an invoice should be generated
          example: true
        expiryOn:
          type: string
          description: Expiry date of the payment link
          format: date-time
        Invoice_Id:
          type: string
          description: Invoice ID
          example: INV123456
        Product_Id:
          type: string
          description: Product ID
        callback_url:
          type: string
          description: Callback URL for payment notifications
          example: https://example.com/callback
    CommonResponse:
      type: object
      properties:
        status:
          type: string
        message:
          type: string
        response:
          type: object
  securitySchemes:
    apiKey:
      type: apiKey
      name: apiKey
      in: header
    hmacSignature:
      type: apiKey
      name: X-HMAC-Signature
      in: header
    accountId:
      type: apiKey
      name: accountId
      in: header

````