4 min read

getOnePayout Documentation

Overview

This node is designed to interface with the Stripe payments API to retrieve details about a specific payout. It utilizes an integration module to communicate with the Stripe service and fetch payout information based on a provided payout ID. This function is particularly useful for applications where businesses need to audit their payment transactions or analyze payout data.

Purpose

Settings

Inputs

  1. payoutId
    • Input Type: String
    • Description: This parameter accepts the unique identifier for the payout you want to retrieve. If this parameter is not provided in the inputs, the function will attempt to source it from the configuration settings.
    • Default Value: None (required field).

Config

  1. payoutId
    • Input Type: String
    • Description: This serves as an alternative source for the payout ID if it is not included in the inputs. It allows flexibility in specifying payout IDs without altering the input structure.
    • Default Value: None (required field).

Context

How it Works

  1. The node is called with an object containing inputs, config, and an optional context.
  2. It attempts to create a connection instance to Stripe using a secure connection, passing the context that may include authentication details.
  3. The function checks for the presence of payoutId:
    • It first looks in the inputs. If unavailable, it then checks the config.
    • If neither is provided, it throws an error indicating that the payout ID is a required field.
  4. Using the integration instance, it calls the method getOnePayout with the established payout ID.
  5. The result is returned as an object containing the payout data or an error message if something goes wrong.

Data Expectations

Use Cases & Examples

Use Cases

  1. Payout Tracking:
    • Businesses can use this function to track and verify individual payouts as part of their financial audits or reporting processes.
  2. Customer Support:
    • Customer service teams can utilize this functionality to retrieve payout details on behalf of merchants who have questions regarding their payouts.
  3. Financial Analytics:
    • Data analysts can implement this logic to gather payout data regularly for analysis regarding revenues, expenses, and cash flow.

Example Configuration

Use Case: Payout Tracking

Scenario: A business wants to retrieve a specific payout made to a vendor for services rendered.

Sample Configuration Data:

json
{
  "inputs": {
    "payoutId": "po_1Gr8t1BtH1M8tN2XPcydzd8Y"
  },
  "config": {
    "payoutId": ""
  },
  "context": {
    "apiKey": "your-stripe-api-key"
  }
}

Explanation: In this scenario, the relevant payout ID is provided directly in the inputs. The config does not have a payout ID set, as it will not be used. The context includes an API key with permissions to access Stripe, ensuring that the function can retrieve the payout information securely.

By configuring the function accurately, the business can successfully call getOnePayout, retrieving detailed data on the specified payout for further analysis or verification tasks.