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.3 KB
Raw Blame
import { createAction, Property } from '@activepieces/pieces-framework';
import { zooAuth } from '../../auth'
import { httpClient, HttpMethod } from '@activepieces/pieces-common';

export const updateOrgPaymentAction = createAction({
  name: 'update_org_payment',
  classification: 'WRITE',
  displayName: 'Update Organization Payment Info',
  description: 'Update payment information for your organization',
  audience: 'both',
  aiMetadata: { description: 'Set the organization\'s active payment method to the supplied payment method ID. Use to change which card or method bills the org; the per-user equivalent is the user payment action. Not idempotent: it overwrites the stored payment method on each call.', idempotent: false },
  auth: zooAuth,
  // category: 'Payments',
  props: {
    paymentMethodId: Property.ShortText({
      displayName: 'Payment Method ID',
      required: true,
      description: 'ID of the payment method to use',
    }),
  },
  async run({ auth, propsValue }) {
    const response = await httpClient.sendRequest({
      method: HttpMethod.PUT,
      url: 'https://api.zoo.dev/org/payment',
      headers: {
        Authorization: `Bearer ${auth.secret_text}`,
      },
      body: {
        payment_method_id: propsValue.paymentMethodId,
      },
    });
    return response.body;
  },
});