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

# List all payin links

<Tip>
  This endpoint is paginated to improve its performance. The example below shows
  how to fetch multiple pages.
</Tip>

```typescript theme={null}
import axios from "axios";

const getPage = async (input: { limit?: number; cursor?: string }) => {
  const response = await axios.get("https://api.palomma.com/v0/payinLinks", {
    headers: {
      Authorization: "Bearer <token>",
    },
    params: {
      ...input,
    },
  });
  if (!response.data) throw new Error();
  const { items, cursor, count } = response.data;
  return { items, cursor, count };
};

const getAll = async (input: { limit?: number }) => {
  let items: any[] = [];
  const firstPage = await getPage({ limit: input.limit });
  if (firstPage) {
    items = items.concat(firstPage.items);
    let currentCursor = firstPage.cursor;
    while (currentCursor !== null) {
      const nextPage = await getPage({
        limit: input.limit,
        cursor: currentCursor,
      });
      items = items.concat(nextPage.items);
      currentCursor = nextPage.cursor;
    }
  }
  return items;
};
```


## OpenAPI

````yaml GET /payinLinks
openapi: 3.0.0
info:
  title: Palomma API
  description: This API includes functionality of the Palomma API.
  version: 1.0.0
servers:
  - url: https://api.palomma.com/v0
    description: Production server
  - url: https://sandbox.api.palomma.com/v0
    description: Sandbox server
security:
  - BearerAuth: []
paths:
  /payinLinks:
    get:
      tags:
        - Payin Links
      summary: Retrieve payin links
      operationId: listPayinLinks
      parameters:
        - name: reference
          in: query
          description: Filter by reference provided on creation.
          schema:
            type: string
        - name: customerId
          in: query
          description: Filter by customerId.
          schema:
            type: string
        - name: payinSettlementId
          in: query
          description: Filter by payinSettlementId.
          schema:
            type: string
        - name: limit
          in: query
          description: Number of records to return. Default is 20. Maximum is 100.
          schema:
            type: integer
        - name: cursor
          in: query
          description: >-
            A cursor for use in pagination. The cursor indicates where to start
            fetching the results.
          schema:
            type: string
      responses:
        '200':
          description: List of payin links successfully retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/PayinLink'
                  cursor:
                    $ref: '#/components/schemas/CursorResponse'
                  count:
                    type: integer
                    description: The total number of items returned.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
components:
  schemas:
    PayinLink:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the Payin Link.
          example: 01HPR5TEDFKT498V8CYY3RPCXP
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the Payin
            Link.
        description:
          type: string
          description: Description of the Payin Link.
        customerId:
          type: string
          description: The ID of the customer for whom the Payin Link is created.
          example: 01HPR57X6QR5ZRKEEKBSDBW4RA
        customerDetails:
          $ref: '#/components/schemas/CustomerDetails'
        status:
          type: string
          enum:
            - pending
            - processing
            - approved
            - cancelled
          example: approved
          description: The current status of the Payin Link.
        statusMessage:
          $ref: '#/components/schemas/StatusMessage'
        paymentUrl:
          type: string
          description: URL to which the customer can go to complete the payment.
          example: >-
            http://payments.palomma.com/payinLinks?payinLinkId=01HPR5TEDFKT498V8CYY3RPCXP
        redirectUrl:
          type: string
          description: >-
            URL to which the customer will be redirected after the payment
            process.
          example: http://merchant.com/checkout
        amount:
          type: number
          description: The total amount to be paid in COP.
          example: 100000
        amountCollected:
          type: number
          description: The amount that has been collected in COP.
          example: 100000
        fee:
          type: number
          description: Any fee associated with the Payin Link.
          example: 500
        type:
          type: string
          description: The type of Payin Link
          enum:
            - general
            - pse
            - bancolombiaButton
            - nequiButton
            - card
            - bancolombiaCollect
        expiration:
          type: string
          description: >-
            Datetime when link will expire in YYYY-MM-DDTHH:mm:ss format. By
            default, expiration is at the end of the day after the link
            creation. Minimum expiration is the current date and maximum
            expiration is at the end of the 7th day from creation. Links expire
            shortly after the specified datetime has passed.
        targetMerchantAccountId:
          type: string
          description: Account ID of the target merchant account for this Payin Link.
          example: default
        createdAt:
          type: string
          format: date-time
          description: ISO string representing when the Payin Link was created.
        updatedAt:
          type: string
          format: date-time
          description: ISO string representing when the Payin Link was last updated.
    CursorResponse:
      type: string
      nullable: true
      description: >-
        A cursor for use in pagination. Provide this value in the cursor
        parameter to retrieve the next set of results. When there are no more
        results, the cursor will be null.
      example: >-
        fa4c20cf2b51f6a45377c98271e3754da1e29b6827928a8e0b40da5a7d53c971aa22c50b2c8ce83484a0dd36ee0e2570a0520a4f1f4817962d95ba65059b9a28da1a5d4ac7bfe7628fb917efd20608656da58b412ea758ec341cd6dfb226f8be263cefa811848b859a5a71f90f47533e01e969d49c0ac9e4e944b3d0fbd4e207
    CustomerDetails:
      type: object
      properties:
        reference:
          type: string
          description: >-
            An optional reference provided by the merchant to identify the
            customer.
        name:
          type: string
          description: >-
            First and last name for a natural person, and company name for a
            juridical person.
          example: Pepito Perez
        documentType:
          type: string
          description: Colombian ID type for customer.
          enum:
            - cc
            - ce
            - nit
        documentNumber:
          type: string
          description: Colombian ID number for customer.
          example: '1037551022'
        email:
          type: string
          description: Customer’s email.
          format: email
          example: pepito@gmail.com
        phoneNumber:
          type: string
          description: Customer’s phone number.
          example: '3013111111'
    StatusMessage:
      type: string
      description: >-
        Additional detail on the status. Only present when status is
        "cancelled".
      enum:
        - AUTHENTICATION_FAILED
        - CUSTOMER_CANCELLATION
        - DECLINED_BY_BANK
        - EXPIRED
        - INVALID_ACCOUNT
        - NOT_ENOUGH_FUNDS
        - ERROR
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````