> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endaoment.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a stock donation pledge

> 
    Creates a new donation pledge for a stock donation to Endaoment.

    Authentication is optional:
    - Authenticated users will have the pledge associated with their account
    - Unauthenticated users can still create pledges but won't have them linked to any account

    This endpoint allows users to:
    - Register their intention to donate stocks to Endaoment
    - Provide broker and stock details
    - Specify the receiving fund
    - Provide donor identity information for the donation receipt
    - Include optional lot information for tax purposes
    



## OpenAPI

````yaml https://api.endaoment.org/oas-json post /v2/donation-pledges/stock
openapi: 3.0.0
info:
  title: Endaoment API
  description: The official Endaoment API endpoints
  version: 0.0.1
  contact: {}
servers:
  - url: https://api.endaoment.org
    description: Production
security: []
tags: []
paths:
  /v2/donation-pledges/stock:
    post:
      tags:
        - Donation Pledges
      summary: Create a stock donation pledge
      description: |2-

            Creates a new donation pledge for a stock donation to Endaoment.

            Authentication is optional:
            - Authenticated users will have the pledge associated with their account
            - Unauthenticated users can still create pledges but won't have them linked to any account

            This endpoint allows users to:
            - Register their intention to donate stocks to Endaoment
            - Provide broker and stock details
            - Specify the receiving fund
            - Provide donor identity information for the donation receipt
            - Include optional lot information for tax purposes
            
      operationId: DonationPledgesController_createStockPledge
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StockPledgeInputDto'
      responses:
        '200':
          description: Stock donation pledge successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDonationPledgeResponseDto'
        '400':
          description: >-
            Invalid input data provided or custom broker name is missing when
            broker name is "other"
      security:
        - bearer: []
components:
  schemas:
    StockPledgeInputDto:
      type: object
      properties:
        updateIdentity:
          type: boolean
          description: >-
            Whether to update the user global identity with the provided donor
            information
          example: true
          default: false
        shareMyEmail:
          type: boolean
          description: Whether to share donor email with the receiving organization
          example: false
          default: false
        stockPledgeData:
          description: Stock pledge details including donor and broker information
          allOf:
            - $ref: '#/components/schemas/StockPledgeDataDto'
        receivingEntityType:
          type: string
          description: Type of entity receiving the pledge
          enum:
            - org
            - fund
            - subproject
          example: fund
        receivingEntityId:
          type: string
          description: Unique identifier of the receiving entity
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        idempotencyKey:
          type: string
          description: Client-generated key to ensure idempotency of the request
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        recommendationId:
          type: string
          description: Unique identifier of the recommendation that led to this pledge
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        isRebalanceRequested:
          type: boolean
          description: >-
            Whether the fund needs its investments rebalanced after the pledge
            is fulfilled
          example: false
          default: false
      required:
        - stockPledgeData
        - receivingEntityType
        - receivingEntityId
        - idempotencyKey
    CreateDonationPledgeResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the created donation pledge
          example: 123e4567-e89b-12d3-a456-426614174000
          format: uuid
      required:
        - id
    StockPledgeDataDto:
      type: object
      properties:
        shares:
          type: number
          description: Number of shares being donated
          example: 100
        ticker:
          type: string
          description: Stock ticker symbol
          example: AAPL
        donorData:
          description: Donor information
          allOf:
            - $ref: '#/components/schemas/StockDonorDataDto'
        brokerData:
          description: Broker information
          allOf:
            - $ref: '#/components/schemas/BrokerDataDto'
        signature:
          type: string
          description: >-
            Base64 encoded PNG signature of the donor. The signature must be a
            PNG in `base64` encoding, which can be generated using the
            `react-signature-canvas` library, for example. The string must be in
            the following format:
            `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...`
          example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
        lots:
          description: Information about individual lots of shares being donated
          type: array
          items:
            $ref: '#/components/schemas/StockLotDataDto'
      required:
        - shares
        - ticker
        - donorData
        - brokerData
        - signature
    StockDonorDataDto:
      type: object
      properties:
        addressLine1:
          type: string
          description: First line of donor address
          example: 123 Main St
          maxLength: 255
        addressLine2:
          type: string
          description: Second line of donor address (optional)
          example: Apt 4B
          maxLength: 255
        city:
          type: string
          description: City of donor address
          example: San Francisco
          maxLength: 255
        country:
          type: string
          description: Country code in ISO 3166-1 alpha-3 format
          example: USA
          enum:
            - USA
        firstName:
          type: string
          description: Donor first name
          example: John
          maxLength: 255
        lastName:
          type: string
          description: Donor last name
          example: Doe
          maxLength: 255
        receiptEmail:
          type: string
          description: Email address for receiving donation receipt
          example: john.doe@example.com
        state:
          type: string
          description: State of donor address
          example: CA
          maxLength: 255
        zipcode:
          type: string
          description: ZIP code of donor address
          example: '94105'
          maxLength: 255
      required:
        - addressLine1
        - city
        - country
        - firstName
        - lastName
        - receiptEmail
        - state
        - zipcode
    BrokerDataDto:
      type: object
      properties:
        brokerContactName:
          type: string
          description: Name of the broker contact person
          example: Jane Smith
        brokerEmail:
          type: string
          description: Email address of the broker
          example: jane.smith@brokerage.com
        brokerName:
          type: string
          description: Name of the brokerage firm
          example: Fidelity
        brokerPhone:
          type: string
          description: Phone number of the broker
          example: +1 (555) 987-6543
        brokerageAccountNumber:
          type: string
          description: Brokerage account number
          example: '123456789'
        customBrokerName:
          type: string
          description: Custom broker name (required when brokerName is "other")
          example: Local Investment Partners LLC
      required:
        - brokerContactName
        - brokerEmail
        - brokerName
        - brokerPhone
        - brokerageAccountNumber
    StockLotDataDto:
      type: object
      properties:
        numberOfShares:
          type: number
          description: Number of shares in this lot
          example: 50
          minimum: 0
        purchasePrice:
          type: number
          description: Purchase price per share in this lot
          example: 150.75
          minimum: 0
        purchaseDate:
          format: date-time
          type: string
          description: Date when the shares in this lot were purchased
          example: '2023-01-15T00:00:00.000Z'
        employeeStockPlan:
          type: string
          description: Type of employee stock plan (if applicable)
          enum:
            - Exercised
            - ESPP
            - Restricted
          example: RSU
        lotId:
          type: string
          description: Alphanumeric identifier for this lot
          example: LOT123
          pattern: ^[a-zA-Z0-9]+$
      required:
        - numberOfShares
        - purchasePrice
        - purchaseDate
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````