X Enterprises
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

NameTypeRequiredDescription
dealIdstringYesHubSpot internal deal ID.
propertiesstring[]NoAdditional 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

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 }
Copyright © 2026