# Get Opportunity

`GET /crm/opportunities/{id}`

Group: CRM › Opportunities · Operation ID: `getOpportunity`

Returns the opportunity with the given identifier. Use the opportunity's id, not its opportunityNumber.

[Open in the interactive reference](https://docs.api.lensing.ai/?op=getOpportunity)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | `"v1"` | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |
| `id` | path | string | yes | The unique identifier for the opportunity to return. |

## Response

`200` Success

Under `data` (getOpportunityOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The unique identifier for the opportunity. |
| `opportunityNumber` | string | no | The system-generated opportunity number, for example 'OP-1042'. Absent while none has been assigned. |
| `entityId` | string | yes | The legal entity that owns the opportunity. |
| `currency` | string | yes | The currency the opportunity is denominated in, and the currency of amount. Format ISO 4217, for example 'USD'. |
| `customerId` | string | no | The identifier of the customer or prospect this opportunity is for. customerPath says which node it points at. Absent when it points at neither. See id on GET accounting/customers/:id for a customer, or GET crm/prospects/:id for a prospect. |
| `customerPath` | string | no | The node customerId points at. 'urn:evst:everest:fin/accounting:field/node:Customer.id' when customerId is a customer, 'urn:evst:everest:crm:field/node:Prospect.id' when it is a prospect. Absent when neither resolves. |
| `endCustomerId` | string | no | The identifier of the end customer behind a partner customer. Absent unless one is on record. See id on GET accounting/customers/:id. |
| `priceBookId` | string | yes | The identifier of the price book quotes on this opportunity are priced from. See id on GET accounting/price-books/:id. |
| `stageId` | string | yes | The identifier of the stage the opportunity currently sits in. There is no endpoint for it. |
| `opportunityName` | string | no | The free-text display name of the opportunity. Absent when none is set. |
| `closeDate` | string (date) | no | The expected close date of the deal. Format YYYY-MM-DD. Absent when none is set. |
| `amount` | string (decimal) | no | The expected deal amount, as a decimal in the opportunity's currency. Absent when none is set. |
| `crmId` | string | no | The identifier of this opportunity in the external system it was imported from, for example a Salesforce record id. It is free text and not unique. Absent when none is set. |
| `dataSource` | string | no | The system the record originated from, for example 'Everest' or 'Salesforce'. Absent when none is set. |
| `lastModifiedDate` | string (date-time) | no | The date and time the opportunity record last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `quotes` | array of object | yes | Every quote linked to this opportunity. An empty array when it has none. |
| `quotes[].quoteId` | string | yes | The identifier of the linked quote. See id on GET crm/quotes/:id. |
| `quotes[].isPrimary` | boolean | yes | Whether this is a primary quote for the opportunity. It is not guaranteed to be true for exactly one quote. |

## Errors

| Code | Status |
| --- | --- |
| `NOT_FOUND` | 400 |

## Statuses

- `400` — Invalid request or business failure. Codes: NOT_FOUND
- `401` — Missing or invalid access token
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests
- `500` — Internal server error
