View Source ExPipedrive.Deals (ex_pipedrive v0.1.0)

Pipedrive deals resource.

v2-first helpers (get/2, create/2, update/3, delete/2, list_page/2, stream/2) talk to /api/v2/deals. Prefer ExPipedrive.Search.search_deals/3 (or search_v2/3 here) for v2 itemSearch. Legacy get_deal/2, list_deals/2, and search_deals/3 remain on API v1 for compatibility.

Summary

Functions

Creates a deal via POST /api/v2/deals.

Deletes a deal via DELETE /api/v2/deals/:id.

Fetches a deal by id via GET /api/v2/deals/:id.

Lists one page of deals via API v2 cursor pagination.

Searches deals via API v2 itemSearch. See ExPipedrive.Search.search_deals/3.

Lazily streams deals across all v2 cursor pages until next_cursor is nil.

Updates a deal via PATCH /api/v2/deals/:id.

Functions

Creates a deal via POST /api/v2/deals.

Accepts a map (preferred) or %Deal{}. Returns {:ok, %Deal{}}.

Deletes a deal via DELETE /api/v2/deals/:id.

Fetches a deal by id via GET /api/v2/deals/:id.

Link to this function

get_deal(client, deal_id)

View Source
Link to this function

list_deals(client, opts \\ [])

View Source
Link to this function

list_deals_page(client, opts \\ [])

View Source
Link to this function

list_page(client, opts \\ [])

View Source

Lists one page of deals via API v2 cursor pagination.

Options: :cursor, :limit (clamped to 500), :status, and other filters.

Link to this function

search_deals(client, term, opts \\ [])

View Source
Link to this function

search_v2(client, term, opts \\ [])

View Source

Searches deals via API v2 itemSearch. See ExPipedrive.Search.search_deals/3.

Link to this function

stream(client, opts \\ [])

View Source

Lazily streams deals across all v2 cursor pages until next_cursor is nil.

Example

client
|> ExPipedrive.Deals.stream(status: "open", limit: 500)
|> Enum.to_list()
Link to this function

stream_deals(client, opts \\ [])

View Source
Link to this function

update(client, deal_id, attrs)

View Source

Updates a deal via PATCH /api/v2/deals/:id.