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

# Start a payment for a proforma invoice



## OpenAPI

````yaml /api-referansi/openapi.json post /v1/billing/proforma-invoices/{id}/pay
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/billing/proforma-invoices/{id}/pay:
    post:
      tags:
        - Billing
        - ProformaInvoice
      summary: Start a payment for a proforma invoice
      operationId: billing.reachable.proforma-invoices.pay
      parameters:
        - name: id
          in: path
          required: true
          description: The proforma invoice identifier
          schema:
            type: integer
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProformaInvoicePayRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    type: object
                    properties:
                      payment_id:
                        type: string
                      proforma_invoice_id:
                        type: integer
                      gateway:
                        type: string
                      amount:
                        type: string
                      currency:
                        type: string
                      initiation:
                        type: string
                    required:
                      - payment_id
                      - proforma_invoice_id
                      - gateway
                      - amount
                      - currency
                      - initiation
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error_code:
                    type: string
                    const: PROFORMA_NOT_FOUND
                  message:
                    type: string
                  errors:
                    type: 'null'
                  data:
                    type: 'null'
                required:
                  - success
                  - error_code
                  - message
                  - errors
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    ProformaInvoicePayRequest:
      type: object
      properties:
        billing_email:
          type: string
          format: email
          description: >-
            Completes a missing invoice email during checkout; existing valid
            addresses are preserved.
          maxLength: 255
        gateway:
          type:
            - string
            - 'null'
          description: Payment provider key; defaults to the configured provider.
          enum:
            - iyzico
            - null
        return_url:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            Browser return target on a configured
            billing.payment.allowed_return_origins origin. Stored with this
            payment attempt; callback URLs cannot override it.
          maxLength: 2048
      title: ProformaInvoicePayRequest
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.