# Create Offering — Paigo

> Creates a new offering in the Paigo platform. See the documentation

- Key: `paigo-create-offering`
- Type: Action (Write)
- Version: 0.0.2
- App: Paigo (`paigo`) — https://pipedream.com/apps/paigo.md
- This page (HTML): https://pipedream.com/apps/paigo/actions/create-offering
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/paigo/actions/create-offering/create-offering.mjs

## Description

Creates a new offering in the Paigo platform. [See the documentation](http://www.api.docs.paigo.tech/#tag/Offerings/operation/Create%20an%20offering)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `offeringName` | `string` | Yes | A friendly, human-readable name for the offering. |
| `dimensionIds` | `string[]` | No | Array of the identifier of the dimensions that this offering contains. Dimensions specify the type of usage that is being billed for. Options are loaded from the connected account. |
| `offeringVisibility` | `string` | No | The visibility of the offering, specifically if its private or public. Public offerings are designed to be shared among customers. Private offerings are typically used for enterprise deals which contain discounts or prepaid credits. |
| `offeringType` | `string` | No | The type of offering |
| `billingCycle` | `string` | No | The time frame when an automatic bill should be sent. Leave empty for no automated billing |
| `subscriptionPrice` | `string` | No | The price of the subscription. Only positive number string is allowed. Only required if offeringType is subscription. |
| `freeTrialLength` | `string` | No | The length of time for a free trial. This is a number of days. Only positive number string is allowed. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "paigo",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "paigo-create-offering",
  arguments: {
    offeringName: "Offering Name",
    dimensionIds: ["Dimension IDs"],
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "paigo-create-offering",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    paigo: { authProvisionId: "apn_xxxxxxx" },
    offeringName: "Offering Name",
    dimensionIds: ["Dimension IDs"],
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "paigo-create-offering",
    "configured_props": {
      "paigo": { "authProvisionId": "apn_xxxxxxx" },
      "offeringName": "Offering Name",
      "dimensionIds": ["Dimension IDs"]
    }
  }'
```

---

- App: https://pipedream.com/apps/paigo.md · All apps: https://pipedream.com/apps
