Skip to content
DocsSDKDeals

Deals

Updated Jul 2026·1 min

Create deals, move them through the pipeline, and keep values and contacts in sync from your own systems.

The Deals board with opportunities in pipeline stage columns and their values.The Deals board with opportunities in pipeline stage columns and their values.

Quick example

Type-checked against @medalsocial/sdk v1.3.0 (2026-07-20). A release that changes a signature fails this page's build.

ts
import { Medal } from '@medalsocial/sdk';

const medal = new Medal(process.env.MEDAL_API_KEY as string);

// Create a deal tied to a contact
const { data: deal } = await medal.deals.create({
  title: 'Summer campaign — Solstice Coffee',
  value: 45_000,
  currency: 'NOK',
  contact_email: 'nora@solsticecoffee.no',
  end_date: '2026-09-01',
});

// Move it through the pipeline
await medal.deals.update(deal.id, { status: 'negotiating' });

// List open deals
const { data: deals } = await medal.deals.list({ limit: 50 });
console.log(deals.length, 'deals');

medal.deals.list()

List deals with cursor-based pagination and optional filters.

ts
list(options?: ListDealsOptions): Promise<PaginatedResponse<Deal>>
Added in v1.0.0

medal.deals.create()

Create a new deal.

ts
create(input: CreateDealInput): Promise<ApiResponse<DealCreateResult>>
Added in v1.0.0

medal.deals.get()

Get a deal by ID.

ts
get(id: string): Promise<ApiResponse<Deal>>
Added in v1.0.0

medal.deals.update()

Update one or more fields on a deal. Set contact_id to null to unlink.

ts
update(id: string, input: UpdateDealInput): Promise<ApiResponse<DealUpdateResult>>
Added in v1.0.0

medal.deals.remove()

Permanently delete a deal.

ts
remove(id: string): Promise<ApiResponse<DealRemoveResult>>
Added in v1.0.0