Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

1.0 KB
Raw Blame

import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { createAction, Property } from '@activepieces/pieces-framework';
import { trueLayerCommon } from '../../common';

export const getPayout = createAction({
  auth: trueLayerCommon.auth,
  name: 'get-payout',
  classification: 'READ',
  displayName: 'Get payout',
  description: 'Returns payout details. ',
  audience: 'both',
  aiMetadata: { description: 'Retrieve the details and current status of a single payout by its ID. Use to check the outcome or state of a payout you previously created; read-only and safe to repeat.', idempotent: true },
  props: {
    id: Property.ShortText({
      displayName: 'ID of the payout',
      required: true,
    }),
  },
  run: async (ctx) => {
    const response = await  httpClient.sendRequest({
      method: HttpMethod.GET,
      url: `${trueLayerCommon.baseUrl}/v3/payouts/${ctx.propsValue.id}`,
      headers: {
        Authorization: `${ctx.auth}`,
      }
    })

    return response.body;

  },
});