# Create Marketplace Listing — Discogs

> Creates a new listing in the Discogs marketplace. See the documentation

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

## Description

Creates a new listing in the Discogs marketplace. [See the documentation](https://www.discogs.com/developers#page:marketplace,header:marketplace-new-listing)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `releaseId` | `integer` | Yes | The ID of the release you are listing for sale. |
| `condition` | `string` | Yes | Select the condition of the item. |
| `sleeveCondition` | `string` | No | Select the condition of the sleeve. |
| `price` | `string` | Yes | The price of the item (in the seller's currency). Format 00.00 |
| `comments` | `string` | No | Any remarks about the item that will be displayed to buyers. |
| `allowOffers` | `boolean` | Yes | Whether or not to allow buyers to make offers on the item. |
| `status` | `string` | Yes | The status of the listing. |
| `externalId` | `string` | No | A freeform field that can be used for the seller’s own reference. Information stored here will not be displayed to anyone other than the seller. This field is called “Private Comments” on the Discogs website. |
| `location` | `string` | No | A freeform field that is intended to help identify an item’s physical storage location. Information stored here will not be displayed to anyone other than the seller. This field will be visible on the inventory management page and will be available in inventory exports via the website. |
| `weight` | `string` | No | The weight, in grams, of this listing, for the purpose of calculating shipping. Set this field to auto to have the weight automatically estimated for you. Format 00.00 |
| `formatQuantity` | `string` | No | The number of items this listing counts as, for the purpose of calculating shipping. This field is called "Counts As" on the Discogs website. Format 00.00 |

## 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": "discogs",
      },
    },
  },
)

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: "discogs-create-marketplace-listing",
  arguments: {
    releaseId: 10,
    condition: "Condition",
  },
})
```

**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: "discogs-create-marketplace-listing",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    discogs: { authProvisionId: "apn_xxxxxxx" },
    releaseId: 10,
    condition: "Condition",
  },
})

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": "discogs-create-marketplace-listing",
    "configured_props": {
      "discogs": { "authProvisionId": "apn_xxxxxxx" },
      "releaseId": 10,
      "condition": "Condition"
    }
  }'
```

---

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