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

# List Payment Codes



## OpenAPI

````yaml get /payment-codes
openapi: 3.0.3
info:
  title: Monime API
  description: Monime REST API. Please visit https://docs.momime.io/api for more details.
  termsOfService: https://monime.io/legal/terms-of-service
  contact:
    name: Monime Developers
    url: https://github.com/monimesl
    email: dev@monime.io
  version: '2024-08-01'
servers:
  - url: https://api.monime.io/
security:
  - bearerAuth: []
paths:
  /payment-codes:
    get:
      tags:
        - PaymentCode
      summary: List Payment Codes
      operationId: ListPaymentCodes
      parameters:
        - name: after
          in: query
          description: >-
            This identifier retrieves the next items in the total result list
            that come just after it. Use it to get items that follows the object
            having this identifier in the overall list. This takes precedence
            over 'before'.
          schema:
            maxLength: 100
            type: string
            description: >-
              This identifier retrieves the next items in the total result list
              that come just after it. Use it to get items that follows the
              object having this identifier in the overall list. This takes
              precedence over 'before'.
            nullable: true
        - name: before
          in: query
          description: >-
            This identifier retrieves the next items in the total result list
            that comes just before it. Use it to get items that precede the
            object having this identifier in the overall list.
          schema:
            maxLength: 100
            type: string
            description: >-
              This identifier retrieves the next items in the total result list
              that comes just before it. Use it to get items that precede the
              object having this identifier in the overall list.
            nullable: true
        - name: limit
          in: query
          description: >-
            The maximum number of items per page that should be retrieved from
            the result list.
          schema:
            maximum: 50
            minimum: 1
            type: integer
            description: >-
              The maximum number of items per page that should be retrieved from
              the result list.
            default: 10
        - name: Monime-Space-Id
          in: header
          description: >-
            The value is the tenancy parameter that Monime used to determine
            which space the request is intended for.
          required: true
          schema:
            maxLength: 100
            pattern: ^spc-.*$
            type: string
            description: >-
              The value is the tenancy parameter that Monime used to determine
              which space the request is intended for.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: >-
                      Represents the status of the query operation, confirming
                      if it was successful. This field is always true
                  messages:
                    type: array
                    items: {}
                    description: >-
                      Contains a list of messages providing relevant information
                      or feedback related to the query or operation
                  result:
                    type: array
                    items:
                      $ref: '#/components/schemas/PaymentCode'
                    description: The list of items in the response
                    nullable: true
                  pagination:
                    type: object
                    properties:
                      count:
                        minimum: 0
                        type: integer
                        description: The number of items in this list response.
                      total:
                        minimum: 0
                        type: integer
                        description: >-
                          The estimated total number of items matching the
                          request.
                        nullable: true
                      next:
                        type: string
                        description: >-
                          This identifier marks the first item in this response
                          list when moving backward through the results, or the
                          last item when moving forward. Use this identifier
                          with the 'after' or 'before' query parameter in your
                          next request to get the items that come after or
                          before this item in the overall list respectively.
                        nullable: true
                    description: The pagination info associated with the response
components:
  schemas:
    PaymentCode:
      type: object
      properties:
        id:
          type: string
          description: A unique identifier for the payment code object.
          example: pmc-TJh76H8hj778hftdtu66gjio
        name:
          maxLength: 100
          type: string
          description: >-
            The name or intent indicating the purpose or use of the payment
            code.
          nullable: true
          example: Home EDSA Meter Top-up
        mode:
          enum:
            - oneTime
            - recurrent
          type: string
          description: >-
            Specifies whether the payment code can be used only once or multiple
            times.
          default: oneTime
        isActive:
          type: boolean
          description: >-
            Indicates whether the payment code is currently active and available
            for use.
          default: true
        status:
          enum:
            - pending
            - processing
            - expired
            - cancelled
            - completed
          type: string
          description: >-
            The current status of the payment code, indicating its state in the
            payment process
          default: pending
        ussdCode:
          type: string
          description: >-
            The USSD code that users can dial on their mobile money device to
            make a payment using this payment code.
          example: \*715\*1\*0123456789#
        amount:
          type: object
          properties:
            currency:
              type: string
              description: >-
                The [3-letter](https://en.wikipedia.org/wiki/ISO_4217) ISO
                currency code.
            value:
              type: integer
              description: >-
                The value representation in the currency's minor unit. E.g. For
                1 Leone (SLE 1), the value should be 100, denoting cents, the
                minor unit.
          description: >-
            The monetary amount assigned to the payment code. If mode is
            recurrent, and financial target sum is also set, this represents the
            amount to be paid for every instance of payment for this code.
        customerTarget:
          type: object
          properties:
            name:
              maxLength: 100
              type: string
              description: Name of the customer to pay for this code.
              nullable: true
              example: Musa Kamara
            reference:
              maxLength: 100
              type: string
              description: >-
                Reference that may identify this customer in some external
                system.
              nullable: true
              example: '0123456789'
            payingPhoneNumber:
              maxLength: 30
              type: string
              description: The phone number that should dial to pay for this code.
              nullable: true
              example: '078000000'
          description: >-
            Information about the specific customer that this payment code is
            targeting/
          nullable: true
        financialTarget:
          type: object
          properties:
            expectedPaymentCount:
              minimum: 1
              type: integer
              description: >-
                The number of payments expected after which the code gets
                completed.
              nullable: true
              example: 10
            expectedPaymentSum:
              type: object
              properties:
                currency:
                  type: string
                  description: >-
                    The [3-letter](https://en.wikipedia.org/wiki/ISO_4217) ISO
                    currency code.
                value:
                  type: integer
                  description: >-
                    The value representation in the currency's minor unit. E.g.
                    For 1 Leone (SLE 1), the value should be 100, denoting
                    cents, the minor unit.
              description: >-
                The sum of payment amounts expected after which the code gets
                completed.
          description: The financial target for this payment code.
          nullable: true
        allowedProviders:
          type: array
          items:
            type: string
          description: >-
            The list of MoMo provider IDs for which the payment code is allowed
            to be used.
          nullable: true
          example:
            - m17
            - m18
        progress:
          type: object
          properties:
            isCompleted:
              type: boolean
              description: Indicate whether the payment code is completed or not.
            totalPaymentCount:
              type: integer
              description: Represents the total number of payments made using this code.
            totalPaymentSum:
              type: object
              properties:
                currency:
                  type: string
                  description: >-
                    The [3-letter](https://en.wikipedia.org/wiki/ISO_4217) ISO
                    currency code.
                value:
                  type: integer
                  description: >-
                    The value representation in the currency's minor unit. E.g.
                    For 1 Leone (SLE 1), the value should be 100, denoting
                    cents, the minor unit.
              description: >-
                Represents the total sum of payment amounts made using this
                code.
          description: The progress of the payment code.
        financialAccountId:
          type: string
          description: >-
            The ID of the financial account where the amount is settled to. This
            default to the owner's *Main* financial account.'
          nullable: true
        expireTime:
          type: string
          description: The expiration time of the payment code.
          format: date-time
        createTime:
          type: string
          description: The creation time of the payment code.
          format: date-time
        metadata:
          maxProperties: 100
          type: object
          description: The metadata for the payment code.
          nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: auth-scheme
      description: >-
        Bearer HTTP authentication specified with the header Authorization:
        Bearer <access_token>

````