List Opportunities

GET https://api.chartmogul.com/v1/opportunities

Lists opportunity objects in your ChartMogul account.

curl -X GET "https://api.chartmogul.com/v1/opportunities?per_page=20&cursor=aabbcc..." \
     -u YOUR_API_KEY:
ChartMogul::Opportunity.all(
  per_page: 20,
  cursor: "aabbcc...",
)
ChartMogul.Opportunity.all(config, {
  per_page: 20,
  cursor: "aabbccdd...",
});
ChartMogul\Opportunity::all([
  "cursor" => "aabbccdd...",
  "per_page" => "20"
]);
api.ListOpportunities(&cm.ListOpportunitiesParams{
  Cursor:       cm.Cursor{PerPage: 1},
})
chartmogul.Opportunity.all(
  config,
  cursor="aabbcc...",
  per_page=20,
)
{
  "entries": [
    {
      "uuid": "39351ba6-dea0-11ee-ac96-37b2b3de29af",
      "customer_uuid": "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7",
      "owner": "[email protected]",
      "pipeline": "New Business",
      "pipeline_stage": "Discovery",
      "estimated_close_date": "2024-03-30",
      "currency": "USD",
      "amount_in_cents": 100000,
      "type": "one-time",
      "forecast_category": "best_case",
      "win_likelihood": 30,
      "custom": { "seats": 3 }
    }
    // ...and more
  ],
  "cursor": "aabbcc...",
  "has_more": true
}
#<ChartMogul::Opportunity:0x00007f82834c9368 
@entries=[
  #<ChartMogul::Opportunity:0x00000001058a8210
    @uuid="39351ba6-dea0-11ee-ac96-37b2b3de29af", 
    @created_at="2024-03-18T17:15:56.960Z", 
    @updated_at="2024-03-18T17:15:56.960Z",
    @customer_uuid="cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", 
    @owner="[email protected]",
    @pipeline="New Business", 
    @pipeline_stage="Discovery", 
    @estimated_close_date="2024-03-30", 
    @currency="USD", 
    @amount_in_cents=100000, 
    @type="one-time", 
    @forecast_category="best_case", 
    @win_likelihood=30, 
    @custom={:seats=>3}
  >,
  # ...and more
  ],
  @has_more=true, 
  @cursor="aabbcc..."
>
{
  entries: [
    {
      uuid: "39351ba6-dea0-11ee-ac96-37b2b3de29af",
      customer_uuid: "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7",
      owner: "[email protected]",
      pipeline: "New Business",
      pipeline_stage: "Discovery",
      estimated_close_date: "2024-03-30",
      currency: "USD",
      amount_in_cents: 100000,
      type: "one-time",
      forecast_category: "best_case",
      win_likelihood: 30,
      custom: { seats: 3 }
    }
    // ...and more
  ],
  cursor: "aabbcc...",
  has_more: true
}
class ChartMogul\Resource\CollectionWithCursor (3) {
  public $has_more => bool(true)
  public $cursor => string(96) "aabbcc..."
  private $elements => array(20) {
    [0] =>
    class ChartMogul\Opportunity (14) {
      protected $uuid => string(36) "39351ba6-dea0-11ee-ac96-37b2b3de29af"
      protected $customer_uuid => string(40) "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7"
      protected $owner => string(15) "[email protected]"
      protected $pipeline => string(14) "New Business"
      protected $pipeline_stage => string(9) "Discovery"
      protected $estimated_close_date => string(10) "2023-12-22"
      protected $currency => string(3) "USD"
      protected $amount_in_cents => int(100)
      protected $type => string(9) "recurring"
      protected $forecast_category => string(8) "pipeline"
      protected $win_likelihood => int(3)
      protected $custom => array(1) {
        ["seats"]=> int(3)
      }
      protected $created_at => string(24) "2024-03-13T07:33:28.356Z"
      protected $updated_at => string(24) "2024-03-13T07:33:28.356Z"
    }
  // ...and more
  }
}
(*chartmogul.Opportunities)(0x14000486b10)({
  Entries: ([]*chartmogul.Opportunity) (len=1 cap=1) {
    (*chartmogul.Opportunity)(0x1400048e1a0)({
    UUID: (string) (len=36) "39351ba6-dea0-11ee-ac96-37b2b3de29af",
    CustomerUUID: (string) (len=40) "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7",
    Owner: (string) (len=15) "[email protected]",
    Pipeline: (string) (len=14) "New Business",
    PipelineStage: (string) (len=9) "Discovery",
    EstimatedCloseDate: (string) (len=10) "2023-12-22",
    Currency: (string) (len=3) "USD",
    AmountInCents: (int) 100,
    Type: (string) (len=9) "recurring",
    ForecastCategory: (string) (len=8) "pipeline",
    WinLikelihood: (int) 3,
    Custom: (map[string]interface {}) (len=1) {
      (string) (len=13) "from_campaign": (bool) true
    },
    CreatedAt: (string) (len=24) "2024-03-13T07:33:28.356Z",
    UpdatedAt: (string) (len=24) "2024-03-13T07:33:28.356Z"
    })
  },
  Pagination: (chartmogul.Pagination) {
    Cursor: (string) (len=7) "88abf99",
    HasMore: (bool) false
  }
})
Opportunities(
  entries=[
    <Opportunity{
      "uuid": "39351ba6-dea0-11ee-ac96-37b2b3de29af",
      "customer_uuid": "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7",
      "owner": "[email protected]",
      "pipeline": "New Business",
      "pipeline_stage": "Discovery",
      "estimated_close_date": "2023-12-22",
      "currency": "USD",
      "amount_in_cents": 100,
      "type": "recurring",
      "forecast_category": "pipeline",
      "win_likelihood": 3,
      "custom": {"from_campaign": True},
      "created_at": "2024-03-13T07:33:28.356Z",
      "updated_at": "2024-03-13T07:33:28.356Z"
    }>,
    // ...and more
  ],
  has_more=True,
  cursor="aabbcc..."
)

Query parameters

customer_uuid string optional
The ChartMogul UUID of the customer associated with the opportunities.
owner string optional
The email address of the team member who is the primary salesperson responsible for this opportunity.
pipeline string optional
The sales pipeline name.
pipeline_stage string optional
The name of the current deal stage within the sales pipeline.
estimated_close_date_on_or_after datetime optional
The lower limit of the estimated close date range. Use this parameter to limit your results to opportunities expected to close on or after a certain date. Must be an ISO 8601-formatted date.
estimated_close_date_on_or_before datetime optional
The upper limit of the estimated close date range. Use this parameter to limit your results to opportunities expected to close on or before a certain date. Must be an ISO 8601-formatted date.
cursor string optional
A value that fetches the next page of opportunities. To fetch the next page of opportunities, set the cursor to the value received in the previous page response.
per_page int32 optional default: 200
A limit on the number of opportunities to return per page. The default and maximum value is 200.

Response

The response object contains the following data:

entries
A list of opportunity entries.
cursor
A reference to the next list of opportunities.
has_more
Determines whether there are more opportunities to query after this request. Returns true if there are and false if there aren’t.