fastify-xhubspot
deals.getById
Fetch a HubSpot deal by its internal ID.
deals.getById
Fetch a single HubSpot deal by its internal ID.
Signature
fastify.deals.getById(
dealId: string,
properties?: string[]
): Promise<{ id: string; properties: Record<string, string> }>
Params
| Name | Type | Required | Description |
|---|---|---|---|
dealId | string | Yes | HubSpot internal deal ID. |
properties | string[] | No | Additional property names to include in the response. |
Returns
{ id, properties }.
Throws
[xHubspot] deals.getById requires a dealId- Re-throws HubSpot API errors (e.g., 404 if not found).
Examples
Basic
const deal = await fastify.deals.getById("67890");
console.log(deal.properties.dealstage);
With extra properties
const deal = await fastify.deals.getById("67890", ["closedate", "hs_deal_stage_probability"]);
See also
- deals.update — advance the deal through stages
- deals.list — list all deals to find IDs
AI Context
package: "@xenterprises/fastify-xhubspot"
method: fastify.deals.getById(id, options?)
use-when: Fetch a single HubSpot deal by ID with optional associated objects
returns: { id, properties }
