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

# Pay invoice

> Record a payment for an invoice and update its status in the system. This API is integral for maintaining accurate financial records.



## OpenAPI

````yaml api-reference/openapiFiles/invoices/pay/openapi.json post /invoices/pay
openapi: 3.0.1
info:
  title: YJSG APIS
  description: >-
    A sample api that provides documentation for apis to be used by different
    integration partners.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.yourjobsearchgenius.ai/v1
    description: Production server
security:
  - bearerAuth: []
paths:
  /invoices/pay:
    post:
      description: >-
        Record a payment for an invoice and update its status in the system.
        This API is integral for maintaining accurate financial records.
      requestBody:
        description: Invoice to add to the system.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceBody'
        required: true
      responses:
        '200':
          description: Resource fetched successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Invoice created successfully
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid Token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found!
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error!
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    InvoiceBody:
      type: object
      properties:
        _id:
          type: string
          description: Invoice ID in their system
          example: 507f1f77bcf86cd799439011
        expiryDate:
          type: integer
          description: The expiry date of the invoice(unix timestamp in milliseconds)
          example: '1672531200'
        invoiceUrl:
          type: string
          format: uri
          description: URL to access the invoice
          example: https://example.com/invoices/12345
        subscriptionId:
          type: string
          description: Subscription ID in our system
          example: sub_abc123
        paidAt:
          type: integer
          description: The expiry date of the invoice(unix timestamp in milliseconds)
          example: '1672531200'
      required:
        - _id
        - expiryDate
        - invoiceUrl
        - subscriptionId
        - paidAt
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
          format: s
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````