The Opportunity object

Attributes

id string

Unique identifier for the object.

created_at string

ISO 8601 timestamp of when the object was created.

updated_at string

ISO 8601 timestamp of when the object was last updated.

opportunity_from string required
party_name string required
customer_name string
title string
opportunity_type string
status string

Default: Open

order_lost_reason string
expected_closing string
currency string
opportunity_amount number
sales_stage string

Default: Prospecting

probability number

Default: 100

customer_address string
address_display string
territory string
customer_group string
contact_person string
contact_display string
contact_email string
contact_mobile string
company string required
transaction_date string required
first_response_time integer
language string
base_opportunity_amount number
base_total number
total number
conversion_rate number
no_of_employees string
annual_revenue number
industry string
market_segment string
opportunity_owner string
website string
whatsapp string
phone string
phone_ext string
job_title string
city string
state string
country string
utm_source string
utm_campaign string
utm_medium string
utm_content string
The Opportunity object
{
  "id": "opportunity_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "opportunity_from": "opportunity_from_example",
  "party_name": "party_name_example",
  "customer_name": "customer_name_example",
  "title": "title_example",
  "opportunity_type": "opportunity_type_example",
  "status": "Open",
  "order_lost_reason": "order_lost_reason_example",
  "expected_closing": "expected_closing_example",
  "currency": "USD",
  "opportunity_amount": 0,
  "sales_stage": "Prospecting",
  "probability": 100,
  "customer_address": "customer_address_example",
  "address_display": "address_display_example",
  "territory": "territory_example",
  "customer_group": "customer_group_example",
  "contact_person": "contact_person_example",
  "contact_display": "contact_display_example",
  "contact_email": "[email protected]",
  "contact_mobile": "contact_mobile_example",
  "company": "Example Corp",
  "transaction_date": "2024-01-15",
  "first_response_time": 0,
  "language": "language_example",
  "base_opportunity_amount": 0,
  "base_total": 0,
  "total": 0,
  "conversion_rate": 0,
  "no_of_employees": "no_of_employees_example",
  "annual_revenue": 0,
  "industry": "industry_example",
  "market_segment": "market_segment_example",
  "opportunity_owner": "opportunity_owner_example",
  "website": "website_example",
  "whatsapp": "whatsapp_example",
  "phone": "phone_example",
  "phone_ext": "phone_ext_example",
  "job_title": "job_title_example",
  "city": "city_example",
  "state": "state_example",
  "country": "country_example",
  "utm_source": "utm_source_example",
  "utm_campaign": "utm_campaign_example",
  "utm_medium": "utm_medium_example",
  "utm_content": "utm_content_example"
}
GET /api/crm/opportunity/{id}

Retrieve a opportunity

Retrieves the details of an existing opportunity. Supply the unique opportunity ID that was returned from a previous request.

Path parameters

id string required

The identifier of the opportunity to retrieve.

Returns

Returns the opportunity object if a valid identifier was provided.

GET /api/crm/opportunity/{id}
curl https://api.overplane.dev/api/crm/opportunity/opportunity_abc123 \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "opportunity_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "opportunity_from": "opportunity_from_example",
  "party_name": "party_name_example",
  "customer_name": "customer_name_example",
  "title": "title_example",
  "opportunity_type": "opportunity_type_example",
  "status": "Open",
  "order_lost_reason": "order_lost_reason_example",
  "expected_closing": "expected_closing_example",
  "currency": "USD",
  "opportunity_amount": 0,
  "sales_stage": "Prospecting",
  "probability": 100,
  "customer_address": "customer_address_example",
  "address_display": "address_display_example",
  "territory": "territory_example",
  "customer_group": "customer_group_example",
  "contact_person": "contact_person_example",
  "contact_display": "contact_display_example",
  "contact_email": "[email protected]",
  "contact_mobile": "contact_mobile_example",
  "company": "Example Corp",
  "transaction_date": "2024-01-15",
  "first_response_time": 0,
  "language": "language_example",
  "base_opportunity_amount": 0,
  "base_total": 0,
  "total": 0,
  "conversion_rate": 0,
  "no_of_employees": "no_of_employees_example",
  "annual_revenue": 0,
  "industry": "industry_example",
  "market_segment": "market_segment_example",
  "opportunity_owner": "opportunity_owner_example",
  "website": "website_example",
  "whatsapp": "whatsapp_example",
  "phone": "phone_example",
  "phone_ext": "phone_ext_example",
  "job_title": "job_title_example",
  "city": "city_example",
  "state": "state_example",
  "country": "country_example",
  "utm_source": "utm_source_example",
  "utm_campaign": "utm_campaign_example",
  "utm_medium": "utm_medium_example",
  "utm_content": "utm_content_example"
}
GET /api/crm/opportunity

List all opportunitys

Returns a list of opportunitys. The results are sorted by creation date, with the most recently created appearing first.

Query parameters

limit integer

Maximum number of objects to return. Default: 20.

offset integer

Number of objects to skip for pagination. Default: 0.

Returns

A paginated list of opportunity objects.

GET /api/crm/opportunity
curl https://api.overplane.dev/api/crm/opportunity \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "data": [
    {
      "id": "opportunity_abc123",
      "created_at": "2024-01-15T09: 30: 00Z",
      "updated_at": "2024-01-15T09: 30: 00Z",
      "opportunity_from": "opportunity_from_example",
      "party_name": "party_name_example",
      "customer_name": "customer_name_example",
      "title": "title_example",
      "opportunity_type": "opportunity_type_example",
      "status": "Open",
      "order_lost_reason": "order_lost_reason_example",
      "expected_closing": "expected_closing_example",
      "currency": "USD",
      "opportunity_amount": 0,
      "sales_stage": "Prospecting",
      "probability": 100,
      "customer_address": "customer_address_example",
      "address_display": "address_display_example",
      "territory": "territory_example",
      "customer_group": "customer_group_example",
      "contact_person": "contact_person_example",
      "contact_display": "contact_display_example",
      "contact_email": "[email protected]",
      "contact_mobile": "contact_mobile_example",
      "company": "Example Corp",
      "transaction_date": "2024-01-15",
      "first_response_time": 0,
      "language": "language_example",
      "base_opportunity_amount": 0,
      "base_total": 0,
      "total": 0,
      "conversion_rate": 0,
      "no_of_employees": "no_of_employees_example",
      "annual_revenue": 0,
      "industry": "industry_example",
      "market_segment": "market_segment_example",
      "opportunity_owner": "opportunity_owner_example",
      "website": "website_example",
      "whatsapp": "whatsapp_example",
      "phone": "phone_example",
      "phone_ext": "phone_ext_example",
      "job_title": "job_title_example",
      "city": "city_example",
      "state": "state_example",
      "country": "country_example",
      "utm_source": "utm_source_example",
      "utm_campaign": "utm_campaign_example",
      "utm_medium": "utm_medium_example",
      "utm_content": "utm_content_example"
    }
  ],
  "has_more": false,
  "total": 1
}
POST /api/crm/opportunity

Create a opportunity

Creates a new opportunity object.

Body parameters

opportunity_from string required
party_name string required
customer_name string
title string
opportunity_type string
status string

Default: Open

order_lost_reason string
expected_closing string
currency string
opportunity_amount number
sales_stage string

Default: Prospecting

probability number

Default: 100

customer_address string
address_display string
territory string
customer_group string
contact_person string
contact_display string
contact_email string
contact_mobile string
company string required
transaction_date string required
first_response_time integer
language string
base_opportunity_amount number
base_total number
total number
conversion_rate number
no_of_employees string
annual_revenue number
industry string
market_segment string
opportunity_owner string
website string
whatsapp string
phone string
phone_ext string
job_title string
city string
state string
country string
utm_source string
utm_campaign string
utm_medium string
utm_content string

Returns

Returns the newly created opportunity object if the call succeeded.

POST /api/crm/opportunity
curl https://api.overplane.dev/api/crm/opportunity \
  -H "Authorization: Bearer sk_test_..." \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"opportunity_from":"opportunity_from_example","party_name":"party_name_example","company":"Example Corp","transaction_date":"2024-01-15"}'
Response
{
  "id": "opportunity_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "opportunity_from": "opportunity_from_example",
  "party_name": "party_name_example",
  "customer_name": "customer_name_example",
  "title": "title_example",
  "opportunity_type": "opportunity_type_example",
  "status": "Open",
  "order_lost_reason": "order_lost_reason_example",
  "expected_closing": "expected_closing_example",
  "currency": "USD",
  "opportunity_amount": 0,
  "sales_stage": "Prospecting",
  "probability": 100,
  "customer_address": "customer_address_example",
  "address_display": "address_display_example",
  "territory": "territory_example",
  "customer_group": "customer_group_example",
  "contact_person": "contact_person_example",
  "contact_display": "contact_display_example",
  "contact_email": "[email protected]",
  "contact_mobile": "contact_mobile_example",
  "company": "Example Corp",
  "transaction_date": "2024-01-15",
  "first_response_time": 0,
  "language": "language_example",
  "base_opportunity_amount": 0,
  "base_total": 0,
  "total": 0,
  "conversion_rate": 0,
  "no_of_employees": "no_of_employees_example",
  "annual_revenue": 0,
  "industry": "industry_example",
  "market_segment": "market_segment_example",
  "opportunity_owner": "opportunity_owner_example",
  "website": "website_example",
  "whatsapp": "whatsapp_example",
  "phone": "phone_example",
  "phone_ext": "phone_ext_example",
  "job_title": "job_title_example",
  "city": "city_example",
  "state": "state_example",
  "country": "country_example",
  "utm_source": "utm_source_example",
  "utm_campaign": "utm_campaign_example",
  "utm_medium": "utm_medium_example",
  "utm_content": "utm_content_example"
}
PATCH /api/crm/opportunity/{id}

Update a opportunity

Updates the specified opportunity by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Path parameters

id string required

The identifier of the opportunity to update.

Body parameters

opportunity_from string
party_name string
customer_name string
title string
opportunity_type string
status string

Default: Open

order_lost_reason string
expected_closing string
currency string
opportunity_amount number
sales_stage string

Default: Prospecting

probability number

Default: 100

customer_address string
address_display string
territory string
customer_group string
contact_person string
contact_display string
contact_email string
contact_mobile string
company string
transaction_date string
first_response_time integer
language string
base_opportunity_amount number
base_total number
total number
conversion_rate number
no_of_employees string
annual_revenue number
industry string
market_segment string
opportunity_owner string
website string
whatsapp string
phone string
phone_ext string
job_title string
city string
state string
country string
utm_source string
utm_campaign string
utm_medium string
utm_content string

Returns

Returns the updated opportunity object.

PATCH /api/crm/opportunity/{id}
curl https://api.overplane.dev/api/crm/opportunity/opportunity_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X PATCH \
  -H "Content-Type: application/json" \
  -d '{"opportunity_from":"opportunity_from_example","party_name":"party_name_example"}'
Response
{
  "id": "opportunity_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "opportunity_from": "opportunity_from_example",
  "party_name": "party_name_example",
  "customer_name": "customer_name_example",
  "title": "title_example",
  "opportunity_type": "opportunity_type_example",
  "status": "Open",
  "order_lost_reason": "order_lost_reason_example",
  "expected_closing": "expected_closing_example",
  "currency": "USD",
  "opportunity_amount": 0,
  "sales_stage": "Prospecting",
  "probability": 100,
  "customer_address": "customer_address_example",
  "address_display": "address_display_example",
  "territory": "territory_example",
  "customer_group": "customer_group_example",
  "contact_person": "contact_person_example",
  "contact_display": "contact_display_example",
  "contact_email": "[email protected]",
  "contact_mobile": "contact_mobile_example",
  "company": "Example Corp",
  "transaction_date": "2024-01-15",
  "first_response_time": 0,
  "language": "language_example",
  "base_opportunity_amount": 0,
  "base_total": 0,
  "total": 0,
  "conversion_rate": 0,
  "no_of_employees": "no_of_employees_example",
  "annual_revenue": 0,
  "industry": "industry_example",
  "market_segment": "market_segment_example",
  "opportunity_owner": "opportunity_owner_example",
  "website": "website_example",
  "whatsapp": "whatsapp_example",
  "phone": "phone_example",
  "phone_ext": "phone_ext_example",
  "job_title": "job_title_example",
  "city": "city_example",
  "state": "state_example",
  "country": "country_example",
  "utm_source": "utm_source_example",
  "utm_campaign": "utm_campaign_example",
  "utm_medium": "utm_medium_example",
  "utm_content": "utm_content_example"
}
DELETE /api/crm/opportunity/{id}

Delete a opportunity

Permanently deletes a opportunity. This cannot be undone.

Path parameters

id string required

The identifier of the opportunity to delete.

Returns

Returns a confirmation that the opportunity has been deleted.

DELETE /api/crm/opportunity/{id}
curl https://api.overplane.dev/api/crm/opportunity/opportunity_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X DELETE
Response
{
  "id": "opportunity_abc123",
  "deleted": true
}

Line items

Child objects that belong to this opportunity. These are accessed via the parent's ID.

Opportunity Item

Attributes

idx integer
opportunity_id string required
item_code string
qty number
item_group string
brand string
uom string
item_name string
description string
image string
image_view string
rate number required
base_amount number required
amount number required
base_rate number required

Endpoints

GET /api/crm/opportunity-item?parent_id={id}
POST /api/crm/opportunity-item
PATCH /api/crm/opportunity-item/{id}
DELETE /api/crm/opportunity-item/{id}
POST /api/crm/opportunity-item/reorder
Opportunity Item object
{
  "id": "opportunity-item_abc123",
  "idx": 1,
  "opportunity_id": "opportunity_id_example",
  "item_code": "item_code_example",
  "qty": 1,
  "item_group": "item_group_example",
  "brand": "brand_example",
  "uom": "uom_example",
  "item_name": "item_name_example",
  "description": "description_example",
  "image": "image_example",
  "image_view": "image_view_example",
  "rate": 0,
  "base_amount": 0,
  "amount": 0,
  "base_rate": 0
}

Opportunity Lost Reason Detail

Attributes

idx integer
opportunity_id string required
lost_reason string

Endpoints

GET /api/crm/opportunity-lost-reason-detail?parent_id={id}
POST /api/crm/opportunity-lost-reason-detail
PATCH /api/crm/opportunity-lost-reason-detail/{id}
DELETE /api/crm/opportunity-lost-reason-detail/{id}
POST /api/crm/opportunity-lost-reason-detail/reorder
Opportunity Lost Reason Detail object
{
  "id": "opportunity-lost-reason-detail_abc123",
  "idx": 1,
  "opportunity_id": "opportunity_id_example",
  "lost_reason": "lost_reason_example"
}