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

# Method Reference

> Complete reference of the @pagfinance/sdk resources and methods: assets, payments, receipts, kyc, user, and auth.

The client exposes the resources below. Each resource groups methods related to one API domain.

<Note>
  Reference based on the public contract of the [@pagfinance/sdk](https://www.npmjs.com/package/@pagfinance/sdk) package. The corresponding REST endpoints are documented in the [API Reference](/en/api-reference/overview).
</Note>

## Resource overview

| Resource   | Methods                                                                                               |
| ---------- | ----------------------------------------------------------------------------------------------------- |
| `assets`   | `acceptedCryptos`, `gatewayConfig`, `assets`, `getAssetPrice`                                         |
| `payments` | `validateCode`, `quote`, `create`, `submit`, `list`, `get`                                            |
| `receipts` | `get({ type, tx, chain })`                                                                            |
| `kyc`      | `naturalProposal`, `legalProposal`, `documentUrl`, `check`, `cpfValidate`, `userData`                 |
| `user`     | `me`                                                                                                  |
| `auth`     | `signIn`, `challenge`, `verify`, `setToken`, `getToken`, `clearToken`, `otpSend`, `enableAutoRelogin` |

## assets

Price quotes and asset configuration. Public methods, no authentication.

<AccordionGroup>
  <Accordion title="acceptedCryptos()">
    Returns the configuration of the cryptocurrencies accepted by the platform.

    ```ts theme={null}
    const config = await client.assets.acceptedCryptos();
    ```
  </Accordion>

  <Accordion title="gatewayConfig()">
    Returns the payment gateway configuration.

    ```ts theme={null}
    const gateway = await client.assets.gatewayConfig();
    ```
  </Accordion>

  <Accordion title="assets()">
    Lists the available assets.

    ```ts theme={null}
    const assets = await client.assets.assets();
    ```
  </Accordion>

  <Accordion title="getAssetPrice({ assetId, fiatCurrency })">
    Returns the price of an asset in a fiat currency.

    ```ts theme={null}
    const price = await client.assets.getAssetPrice({ assetId: 1, fiatCurrency: 'BRL' });
    ```
  </Accordion>
</AccordionGroup>

## payments

Payment validation, quoting, creation, and lookup.

<AccordionGroup>
  <Accordion title="validateCode({ code })">
    Validates a payment code (PIX, boleto, or gift card).

    ```ts theme={null}
    const transfer = await client.payments.validateCode({ code: '00020101...' });
    ```
  </Accordion>

  <Accordion title="quote(req)">
    Requests a quote for a payment.

    ```ts theme={null}
    const quote = await client.payments.quote(req);
    ```
  </Accordion>

  <Accordion title="create(req)">
    Creates a payment from a quote.

    ```ts theme={null}
    const payment = await client.payments.create(req);
    ```
  </Accordion>

  <Accordion title="submit(req)">
    Submits the transaction of a created payment.

    ```ts theme={null}
    await client.payments.submit(req);
    ```
  </Accordion>

  <Accordion title="list()">
    Lists the authenticated user's payments.

    ```ts theme={null}
    const payments = await client.payments.list();
    ```
  </Accordion>

  <Accordion title="get(id)">
    Returns a specific payment by its identifier.

    ```ts theme={null}
    const payment = await client.payments.get(id);
    ```
  </Accordion>
</AccordionGroup>

## receipts

Transaction receipts, agnostic to the payment type.

<Accordion title="get({ type, tx, chain })">
  Returns the receipt of a transaction. Agnostic: it works for PIX, boleto, and gift card.

  ```ts theme={null}
  const receipt = await client.receipts.get({ type: 'pix', tx: '...', chain: 'solana' });
  ```
</Accordion>

## kyc

Identity verification (natural persons and legal entities).

| Method            | Description                                    |
| ----------------- | ---------------------------------------------- |
| `naturalProposal` | Creates a KYC proposal for a natural person.   |
| `legalProposal`   | Creates a KYC proposal for a legal entity.     |
| `documentUrl`     | Gets the URL for document upload.              |
| `check`           | Looks up the verification status.              |
| `cpfValidate`     | Validates a CPF (Brazilian taxpayer ID).       |
| `userData`        | Returns the user data associated with the KYC. |

## user

Authenticated user data.

<Accordion title="me()">
  Returns the authenticated user's data.

  ```ts theme={null}
  client.setToken(tokenJWT);
  const me = await client.user.me();
  ```
</Accordion>

## auth

Authentication and token management. Full details in [Authentication and Configuration](/en/sdks/authentication).

| Method                   | Description                                        |
| ------------------------ | -------------------------------------------------- |
| `signIn(params, signer)` | Runs the complete login flow and stores the token. |
| `challenge(params)`      | Requests the challenge (nonce).                    |
| `verify(params)`         | Verifies the signature and receives the JWT token. |
| `setToken(token)`        | Sets the JWT token on the client.                  |
| `getToken()`             | Returns the current token.                         |
| `clearToken()`           | Removes the token from the client.                 |
| `otpSend(params)`        | Sends an OTP code.                                 |
| `enableAutoRelogin(fn)`  | Enables automatic re-login on 401.                 |

## Errors

Every method may throw `PagFinanceError`.
