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

# Usage and configuration

> Add the Payphone node to your Canvas flow and configure its inputs and outputs.

Once the integration is connected in Marketplace with the **Access Token**, the **Store ID**, the **VAT**, and the **Currency**, the **Payphone** node becomes available in your workspace to use inside your Canvas flows.

***

## Add the node to the Canvas

<Steps>
  <Step title="Locate the integration in Marketplace">
    In the left side panel of Brain Studio, open the **Marketplace** folder.

    If the integration is correctly connected, you will see **Payphone** listed as an available provider.

    <Frame caption="Payphone available in the Marketplace side panel">
      <img src="https://mintcdn.com/jelouai/N-faBULcr0WC2nPA/assets/images/integraciones/pagos/payphone-ambiente.png?fit=max&auto=format&n=N-faBULcr0WC2nPA&q=85&s=c3f184139f5b5ea2ed12341f9ad6d497" alt="Payphone visible in the Marketplace folder inside the Brain Studio side panel" width="944" height="480" data-path="assets/images/integraciones/pagos/payphone-ambiente.png" />
    </Frame>
  </Step>

  <Step title="Drag the node to the Canvas">
    Drag **Payphone** from the side panel into your flow in the Canvas.

    When you drop it, the node block will be created with its available outputs.
  </Step>

  <Step title="Open the configuration panel">
    Select the node in the Canvas to open its configuration panel on the right side.

    From there you can complete the **inputs** and review the available **outputs**.

    <Frame caption="Full configuration panel of the Payphone node in Brain Studio">
      <img src="https://mintcdn.com/jelouai/N-faBULcr0WC2nPA/assets/images/integraciones/pagos/payphone-configuracion-completa.png?fit=max&auto=format&n=N-faBULcr0WC2nPA&q=85&s=6e5fe489bc12b8f84ca3daa0beeb7cd4" alt="Side configuration panel of the Payphone node showing all available fields" width="970" height="1024" data-path="assets/images/integraciones/pagos/payphone-configuracion-completa.png" />
    </Frame>
  </Step>
</Steps>

***

## Configure the node

<Tabs>
  <Tab title="Inputs">
    <AccordionGroup>
      <Accordion title="Save result as" icon="database">
        <ParamField body="Save result as" type="string">
          Defines the name of the variable where Brain Studio will store the **complete JSON** response from the node.

          <Tip>
            Useful if you want to use the response later (logs, validations, traceability, or flow decisions).
          </Tip>
        </ParamField>
      </Accordion>

      <Accordion title="Charge mode [one-time payment by default]" icon="credit-card">
        <ParamField body="Charge mode [one-time payment by default]" type="string" default="payment">
          Defines the charge mode.

          For this integration, the default value is `payment`.
        </ParamField>
      </Accordion>

      <Accordion title="Environment" icon="server">
        <ParamField body="Environment" type="string" required>
          Defines the environment in which the charge will be executed.

          **Available values:** `DEV`, `PROD`
        </ParamField>

        <Warning>
          The value configured here must match the environment selected in the application inside **Payphone Developer**.

          If you configure `DEV` in the node but the application is in production, or vice versa, the flow may fail or produce inconsistent results.
        </Warning>
      </Accordion>

      <Accordion title="Payment button expiration [minutes]" icon="clock">
        <ParamField body="Payment button expiration [minutes]" type="number">
          Defines how long the payment button remains valid from the moment it is sent to the user.

          **Available values:** `10`, `20`, `30`, `60`
        </ParamField>
      </Accordion>

      <Accordion title="Payment reason" icon="file-lines">
        <ParamField body="Payment reason" type="string" required>
          Descriptive text for the charge.

          Examples:

          * order number
          * product or service name
          * internal payment reference
        </ParamField>
      </Accordion>

      <Accordion title="Taxable amount" icon="receipt">
        <ParamField body="Taxable amount" type="number" required>
          Enter the amount to charge that is subject to taxes.

          Accepts numeric values in dollars, including decimals when applicable.
        </ParamField>
      </Accordion>

      <Accordion title="Tax-exempt amount" icon="dollar-sign">
        <ParamField body="Tax-exempt amount" type="number" required>
          Enter the amount to charge that is exempt from taxes.

          Accepts numeric values in dollars, including decimals when applicable.
        </ParamField>
      </Accordion>

      <Accordion title="Payment metadata" icon="tag">
        <ParamField body="Payment metadata" type="string">
          Additional information for traceability or internal reference.

          <Info>
            You can use this field to correlate the payment with an order, a quote, or a reconciliation operation.
          </Info>
        </ParamField>
      </Accordion>

      <Accordion title="Customize payment button text" icon="message">
        <ParamField body="Customize payment button text" type="boolean" default="false">
          If you select **Yes**, additional fields are enabled to customize the message that accompanies the payment button.

          **Fields enabled when activated:**

          * `Header` (required)
          * `Body` (required)
          * `Footer` (required)
        </ParamField>

        <Info>
          When this option is active, you can fully modify the message the user will see before opening the checkout.
        </Info>
      </Accordion>

      <Accordion title="Header" icon="heading">
        <ParamField body="Header" type="string">
          Title of the message that accompanies the payment button.
        </ParamField>
      </Accordion>

      <Accordion title="Body" icon="align-left">
        <ParamField body="Body" type="string">
          Main text of the message that accompanies the payment button.
        </ParamField>
      </Accordion>

      <Accordion title="Footer" icon="minus">
        <ParamField body="Footer" type="string">
          Closing or disclaimer text of the message that accompanies the payment button.
        </ParamField>
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Outputs">
    <AccordionGroup>
      <Accordion title="Successful Payment" icon="circle-check">
        Triggered when Payphone confirms that the transaction was processed correctly.

        This is the official payment confirmation point within the flow.

        Usage examples:

        * issue an invoice
        * activate a subscription
        * release a product or service
        * update the status of an order in an external system
      </Accordion>

      <Accordion title="Failed Payment" icon="circle-xmark">
        Triggered when the transaction was rejected or declined.

        Recommendations:

        * inform the user
        * allow a retry
        * redirect to another payment method
      </Accordion>

      <Accordion title="Error Code" icon="bug">
        Triggered when Payphone returns an internal error code during the creation or processing of the payment.
      </Accordion>

      <Accordion title="HTTP Error" icon="triangle-exclamation">
        Triggered when a communication error with the provider occurs, for example a timeout, a network issue, or an invalid response.
      </Accordion>

      <Accordion title="CTA sent successfully" icon="paper-plane">
        Triggered when the payment button was sent correctly in the conversation.

        Indicates that the message with the button was successfully displayed in WhatsApp. From this output you can connect a wait node or a message telling the user they can now complete the payment.
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>

***

## Important considerations

<AccordionGroup>
  <Accordion title="The node environment must match Payphone">
    If you configure the node in `DEV`, the application in **Payphone Developer** must also be in **Test**.

    If you configure the node in `PROD`, the application in **Payphone Developer** must be in **Production**.
  </Accordion>

  <Accordion title="Handling pending payments">
    When a payment is initially pending, the agent informs the user of that status through the corresponding message.

    If Payphone later updates the result, the flow continues through the corresponding final output:

    * **Successful Payment**
    * **Failed Payment**

    <Info>
      The pending state is not exposed as an independent output of the node.
    </Info>
  </Accordion>
</AccordionGroup>
