---
updatedAt: 2026-07-20T06:33:37.000Z
agentTools:
  projectIndex: https://docs.paymongo.com/llms.txt
---

# Create deal

Requires pipeline_id, stage_id, and at least one organization_ids entry. Stage must belong to that pipeline. organization_ids attaches CRM rows via organization_deal (deal has no organization column); optional lead_ids / contact_ids are independent many-to-many links; optional tag_ids links tags via deal_tag in the same transaction. Notes are not created here—use POST .../notes or read them via GET .../deals/:id relationship previews.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "contact": {
      "name": "Sales and Marketing Experience Team"
    },
    "description": "Sales API owns PayMongo's internal sales CRM: the organization/company\ncatalog, contacts, leads, deals and pipeline stages, sales activities and\ntrackers, notes, tags, tickets, and account invitations. Called by the\ninternal admin dashboard on behalf of authenticated PayMongo sales admins.\n",
    "title": "Sales API",
    "version": "1.0.0",
    "summary": "Internal sales CRM — organizations, contacts, leads, deals, pipelines, activities, and tickets.",
    "license": {
      "name": "PayMongo Internal",
      "identifier": "LicenseRef-PayMongo-Internal"
    },
    "x-paymongo-service-slug": "sales-api",
    "x-paymongo-service-tier": "tier-2",
    "x-paymongo-owner-slack": "#sales-api-channel",
    "x-paymongo-repo": "https://github.com/paymongo/sales-api",
    "x-paymongo-data-classification": "internal"
  },
  "servers": [
    {
      "url": "https://sales-api.paymongo.com",
      "description": "Production"
    },
    {
      "url": "https://sales-api.paymongo-uat.com",
      "description": "UAT"
    },
    {
      "url": "https://sales-api.paymongo-stg.com",
      "description": "Staging"
    }
  ],
  "tags": [
    {
      "name": "Deals",
      "description": "Deals and their lifecycle through pipeline stages."
    }
  ],
  "paths": {
    "/v1/internal/deals": {
      "post": {
        "description": "Requires pipeline_id, stage_id, and at least one organization_ids entry. Stage must belong to that pipeline. organization_ids attaches CRM rows via organization_deal (deal has no organization column); optional lead_ids / contact_ids are independent many-to-many links; optional tag_ids links tags via deal_tag in the same transaction. Notes are not created here—use POST .../notes or read them via GET .../deals/:id relationship previews.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDealReqDTO"
              }
            }
          },
          "description": "Deal",
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ResponseRootDTO"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/CreateDealResDTO"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseRootDTO"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseRootDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create deal",
        "tags": [
          "Deals"
        ],
        "operationId": "create_internal_deals"
      }
    }
  },
  "components": {
    "schemas": {
      "OwnerResDTO": {
        "properties": {
          "email": {
            "example": "kam@example.com",
            "type": "string"
          },
          "first_name": {
            "example": "Jane",
            "type": "string"
          },
          "id": {
            "example": "12345678",
            "type": "string"
          },
          "last_name": {
            "example": "Doe",
            "type": "string"
          },
          "status": {
            "example": "active",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorCode": {
        "enum": [
          "invalid_query_parameters",
          "invalid_request_body",
          "parameter_required",
          "not_found",
          "unauthorized",
          "internal_server_error"
        ],
        "type": "string",
        "x-enum-varnames": [
          "ErrInvalidQueryParameters",
          "ErrInvalidRequestBody",
          "ErrParameterRequired",
          "ErrNotFound",
          "ErrUnauthorized",
          "ErrInternalServerError"
        ]
      },
      "ErrorDetail": {
        "description": "Details about a specific error",
        "properties": {
          "code": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ErrorCode"
              }
            ],
            "description": "Code is an application-specific error code, expressed as a string value.",
            "example": "invalid_request_body"
          },
          "detail": {
            "description": "Detail is a human-readable explanation specific to this occurrence of the problem.",
            "example": "Explanation of error code for this case",
            "type": "string"
          },
          "source": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Source"
              }
            ],
            "description": "Source is an object containing references to the primary source of the error"
          }
        },
        "type": "object"
      },
      "ErrorResponseRootDTO": {
        "description": "Standard error response containing one or more errors",
        "properties": {
          "errors": {
            "description": "Error objects MUST be returned as an array keyed by `errors` in the top level of a JSON:API document.",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ResponseRootDTO": {
        "properties": {
          "data": {}
        },
        "type": "object"
      },
      "Source": {
        "description": "Source of the error, providing context like JSON Pointer or query parameter",
        "properties": {
          "header": {
            "description": "Header indicates the name of a single request header which caused the error.",
            "example": "X-Header-Name",
            "type": "string"
          },
          "parameter": {
            "description": "Parameter indicates which URI query parameter caused the error.",
            "example": "field_name",
            "type": "string"
          },
          "pointer": {
            "description": "Pointer is a \"JSON Pointer\" [RFC6901] to the value in the request document that caused the error.",
            "example": "/data/customers/0/attributes/name",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateDealReqDTO": {
        "properties": {
          "business_group": {
            "type": "string"
          },
          "close_details": {
            "type": "string"
          },
          "close_won_reason": {
            "type": "string"
          },
          "competitors": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "contact_ids": {
            "example": [
              "cnt_0123456789abcdef01234567"
            ],
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "type": "array"
          },
          "critical_event": {
            "type": "string"
          },
          "critical_event_date": {
            "example": "2026-07-01 10:00:00+00:00",
            "type": "string"
          },
          "currency_code": {
            "type": "string"
          },
          "current_state": {
            "type": "string"
          },
          "deal_health_status": {
            "type": "string"
          },
          "decision_criteria": {
            "type": "string"
          },
          "decision_maker_id": {
            "example": "cnt_0123456789abcdef01234567",
            "type": "string"
          },
          "decision_process": {
            "type": "string"
          },
          "description": {
            "example": "Sample description",
            "type": "string"
          },
          "expected_close_date": {
            "example": "2026-07-01 10:00:00+00:00",
            "type": "string"
          },
          "forecast_category": {
            "type": "string"
          },
          "forecast_probability": {
            "type": "number"
          },
          "help_needed": {
            "example": true,
            "type": "boolean"
          },
          "help_needed_detail": {
            "type": "string"
          },
          "impact": {
            "type": "string"
          },
          "included_in_forecast": {
            "example": true,
            "type": "boolean"
          },
          "is_closed": {
            "example": true,
            "type": "boolean"
          },
          "is_won": {
            "example": true,
            "type": "boolean"
          },
          "lead_ids": {
            "example": [
              "lead_0123456789abcdef01234567"
            ],
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "type": "array"
          },
          "loss_reason": {
            "example": [
              "lost_to_competition",
              "pricing_gap"
            ],
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": "array"
          },
          "lost_to_competitor_details": {
            "type": "string"
          },
          "monthly_incremental_gp": {
            "type": "number"
          },
          "monthly_incremental_tpv": {
            "type": "number"
          },
          "name": {
            "example": "Acme Corp",
            "type": "string"
          },
          "organization_ids": {
            "description": "OrganizationIDs must contain exactly one organization (DB junction remains M:N; code enforces 1).",
            "example": [
              "sorg_0123456789abcdef01234567"
            ],
            "items": {
              "type": "string"
            },
            "maxItems": 1,
            "minItems": 1,
            "type": "array"
          },
          "outreach_start_date": {
            "example": "2026-07-01 10:00:00+00:00",
            "type": "string"
          },
          "owners": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "pipeline_id": {
            "example": "pipe_0123456789abcdef01234567",
            "type": "string"
          },
          "point_person_id": {
            "example": "cnt_0123456789abcdef01234567",
            "type": "string"
          },
          "presenting_problem": {
            "type": "string"
          },
          "priority": {
            "example": "high",
            "type": "string"
          },
          "root_cause": {
            "type": "string"
          },
          "stage_id": {
            "example": "stg_0123456789abcdef01234567",
            "type": "string"
          },
          "tag_ids": {
            "example": [
              "tag_0123456789abcdef01234567"
            ],
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "type": "array"
          },
          "ticket_ids": {
            "example": [
              "tkt_0123456789abcdef01234567"
            ],
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "type": "array"
          },
          "value_drivers": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "contact_ids",
          "lead_ids",
          "loss_reason",
          "name",
          "organization_ids",
          "pipeline_id",
          "stage_id",
          "tag_ids",
          "ticket_ids"
        ],
        "type": "object"
      },
      "CreateDealResDTO": {
        "properties": {
          "business_group": {
            "type": "string"
          },
          "close_details": {
            "type": "string"
          },
          "close_won_reason": {
            "type": "string"
          },
          "closed_at": {
            "example": "2026-07-01 10:00:00+00:00",
            "type": "string"
          },
          "competitors": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "created_at": {
            "example": "2026-07-01 10:00:00+00:00",
            "type": "string"
          },
          "critical_event": {
            "type": "string"
          },
          "critical_event_date": {
            "example": "2026-07-01 10:00:00+00:00",
            "type": "string"
          },
          "currency_code": {
            "type": "string"
          },
          "current_state": {
            "type": "string"
          },
          "current_update": {
            "description": "latest note content",
            "type": "string"
          },
          "daily_incremental_gp": {
            "type": "number"
          },
          "deal_health_status": {
            "type": "string"
          },
          "decision_criteria": {
            "type": "string"
          },
          "decision_maker_id": {
            "example": "cnt_0123456789abcdef01234567",
            "type": "string"
          },
          "decision_process": {
            "type": "string"
          },
          "description": {
            "example": "Sample description",
            "type": "string"
          },
          "expected_close_date": {
            "example": "2026-07-01 10:00:00+00:00",
            "type": "string"
          },
          "forecast_category": {
            "type": "string"
          },
          "forecast_probability": {
            "type": "number"
          },
          "help_needed": {
            "example": true,
            "type": "boolean"
          },
          "help_needed_detail": {
            "type": "string"
          },
          "id": {
            "example": "deal_0123456789abcdef01234567",
            "type": "string"
          },
          "impact": {
            "type": "string"
          },
          "included_in_forecast": {
            "example": true,
            "type": "boolean"
          },
          "is_closed": {
            "example": true,
            "type": "boolean"
          },
          "is_won": {
            "example": true,
            "type": "boolean"
          },
          "loss_reason": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "lost_to_competitor_details": {
            "type": "string"
          },
          "monthly_incremental_gp": {
            "type": "number"
          },
          "monthly_incremental_tpv": {
            "type": "number"
          },
          "name": {
            "example": "Acme Corp",
            "type": "string"
          },
          "next_update": {
            "description": "earliest open activity subject",
            "type": "string"
          },
          "next_update_date": {
            "description": "earliest open activity due date",
            "example": "2026-07-01 10:00:00+00:00",
            "type": "string"
          },
          "outcome": {
            "enum": [
              "open",
              "won",
              "lost"
            ],
            "example": "open",
            "type": "string"
          },
          "outreach_start_date": {
            "example": "2026-07-01 10:00:00+00:00",
            "type": "string"
          },
          "owners": {
            "items": {
              "$ref": "#/components/schemas/OwnerResDTO"
            },
            "type": "array"
          },
          "pipeline_id": {
            "example": "pipe_0123456789abcdef01234567",
            "type": "string"
          },
          "point_person_id": {
            "example": "cnt_0123456789abcdef01234567",
            "type": "string"
          },
          "presenting_problem": {
            "type": "string"
          },
          "priority": {
            "example": "high",
            "type": "string"
          },
          "root_cause": {
            "type": "string"
          },
          "stage_id": {
            "example": "stg_0123456789abcdef01234567",
            "type": "string"
          },
          "updated_at": {
            "example": "2026-07-01 10:00:00+00:00",
            "type": "string"
          },
          "value_drivers": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Admin access token (JWT) for PayMongo internal dashboard users; admin-only operations require an admin_id claim."
      }
    }
  }
}
```