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

# Get Quote Entity From Sale Id

> Get a Quote for a sale

NsApiSlow threshold: 5000 ms.



## OpenAPI

````yaml /openapi/agent/openapi-v3-QuoteAgent.json post /api/v1/Agents/Quote/GetQuoteEntityFromSaleId
openapi: 3.0.0
info:
  version: v1-Agents
  title: SuperOffice Agent API v1
  description: SuperOffice Agent API - QuoteAgent
  contact:
    name: SuperOffice DevNet
    url: https://docs.superoffice.com/en/api/index.html
    email: sdk@superoffice.com
servers:
  - url: http://localhost:56350
  - url: https://localhost:56350
security: []
tags: []
externalDocs:
  description: >-
    The SuperOffice DevNet Community has more documentation, examples, and
    discussion forums.
  url: https://community.superoffice.com/en/developer/
paths:
  /api/v1/Agents/Quote/GetQuoteEntityFromSaleId:
    post:
      tags:
        - Quote_Agent
      summary: Get Quote Entity From Sale Id
      description: |-
        Get a Quote for a sale

        NsApiSlow threshold: 5000 ms.
      operationId: v1QuoteAgent_GetQuoteEntityFromSaleId
      parameters:
        - name: $select
          in: query
          description: >-
            Optional comma separated list of properties to include in the
            result. Other fields are then nulled out to reduce payload size:
            "Name,department,category". Default = show all fields.
          required: false
          schema:
            type: string
        - name: Accept-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code.
          required: false
          schema:
            type: string
        - name: SO-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code. Overrides Accept-Language value.
          required: false
          schema:
            type: string
        - name: SO-Culture
          in: header
          description: >-
            Number, date formatting in a specified culture (iso2 language) code.
            Partially overrides SO-Language/Accept-Language value. Ignored if no
            Language set.
          required: false
          schema:
            type: string
        - name: SO-TimeZone
          in: header
          description: >-
            Specify the timezone code that you would like date/time responses
            converted to.
          required: false
          schema:
            type: string
        - name: SO-AppToken
          in: header
          description: >-
            The application token that identifies the partner app. Used when
            calling Online WebAPI from a server.
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.QuoteCarriers.GetQuoteEntityFromSaleIdRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.QuoteCarriers.GetQuoteEntityFromSaleIdRequest
          application/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.QuoteCarriers.GetQuoteEntityFromSaleIdRequest
          text/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.QuoteCarriers.GetQuoteEntityFromSaleIdRequest
          application/x-www-form-urlencoded:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.QuoteCarriers.GetQuoteEntityFromSaleIdRequest
          application/json-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.QuoteCarriers.GetQuoteEntityFromSaleIdRequest
          application/merge-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.QuoteCarriers.GetQuoteEntityFromSaleIdRequest
        description: SaleId
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.QuoteEntity'
            text/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.QuoteEntity'
            application/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.QuoteEntity'
            text/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.QuoteEntity'
            application/json-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.QuoteEntity'
            application/merge-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.QuoteEntity'
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.WebApi.v1.Carriers.QuoteCarriers.GetQuoteEntityFromSaleIdRequest:
      description: 'GetQuoteEntityFromSaleId: Get a Quote for a sale'
      type: object
      properties:
        SaleId:
          format: int32
          type: integer
    SuperOffice.CRM.Services.QuoteEntity:
      description: "Quote methods\r\n<para />\r\nCarrier object for QuoteEntity.\r\nServices for the QuoteEntity Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IQuoteAgent\">Quote Agent</see>."
      type: object
      properties:
        QuoteId:
          format: int32
          description: Primary key
          type: integer
        SaleId:
          format: int32
          description: The foreign key to the corresponding sale
          type: integer
        QuoteConnectionId:
          format: int32
          description: >-
            The connection in the CRM system to where this quote came from.
            Identifies the ERP connection used for this quote. Each quote is
            bound to one and only one connection.
          type: integer
        ERPQuoteKey:
          description: >-
            Foreign key of quote (if available). The key in the ERP system that
            identifies this sale's Quote (as opposed to the later Order
            information)
          type: string
        ERPOrderKey:
          description: >-
            The key in the ERP system that identifies this sale's Order, as
            transferred and possibly later edited in the ERP system.  Only
            filled out if there exists a corresponding order representation of
            the quote in the ERP system.
          type: string
        ActiveQuoteVersionId:
          format: int32
          description: >-
            The primary key of the Quote Version that is currently active. (The
            active version will always be the latest version.)
          type: integer
        AcceptedQuoteAlternativeId:
          format: int32
          description: >-
            The primary key of the Quote Alternative which was finally accepted
            by the customer. Set when the user is marking a quote as accepted.
          type: integer
        UseValuesFromQuote:
          format: int32
          description: >-
            If true, then the Earning, Earning_Percent and Amount fields are
            populated from the QuoteVersion.QuoteAlternative (current revision,
            most-likely alternative).
          type: integer
        DocumentId:
          format: int32
          description: The ID of the main Quote Document
          type: integer
        PoNumber:
          description: Customer's Purchase order number
          type: string
        OrderComment:
          description: >-
            A comment that is intended for the Invoice, Order, Packing list and
            similar stages - AFTER the quote has become an order and goes to ERP
            for processing
          type: string
        PreferredEmailCulture:
          description: >-
            When emails are sent (offer or confirmation), a language can be
            chosen in the GUI; this field saves the most recent choice and can
            be used to default the next such choice. Default-default is user's
            current language
          type: string
        QuoteVersions:
          description: Array og QuoteVersions connected to the quote.
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.QuoteVersion'
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Services.QuoteVersion:
      description: "Information about a version of the .\r\n<para />\r\nCarrier object for QuoteVersion.\r\nServices for the QuoteVersion Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IQuoteAgent\">Quote Agent</see>."
      type: object
      properties:
        QuoteVersionId:
          format: int32
          description: Primary key
          type: integer
        ERPQuoteVersionKey:
          description: >-
            Key in the ERP system that uniquely identifies this Version within
            the ERP system (if available, the field may be empty).
          type: string
        QuoteId:
          format: int32
          description: >-
            Foreign key to CRM quote (the conceptual parent). Owning Quote of
            this Quote Version.
          type: integer
        Description:
          description: >-
            Description of Version. Potentially longer text description,
            typically used in a tooltip. Max 2K.
          type: string
        Number:
          description: A quote number that the user (or ERP connector) can fill out.
          type: string
        State:
          description: Current state of this quote version.
          enum:
            - Unknown
            - Draft
            - DraftNotCalculated
            - DraftNeedsApproval
            - DraftApproved
            - DraftNotApproved
            - Sent
            - Archived
            - Lost
            - Sold
          type: string
        ArchivedState:
          description: >-
            State that this quote version had, right before it was changed to
            Archived; in this way we can show what happened before the
            archiving.
          enum:
            - Unknown
            - Draft
            - DraftNotCalculated
            - DraftNeedsApproval
            - DraftApproved
            - DraftNotApproved
            - Sent
            - Archived
            - Lost
            - Sold
          type: string
        Status:
          description: >-
            If there was a problem with for instance calculation, this field is
            set to warning or error.
          enum:
            - Ok
            - OkWithInfo
            - Warning
            - Error
          type: string
        Reason:
          description: >-
            If there was a problem, this field contains a localized explanation
            of the problem and possible steps to fix it that the user can be
            shown.
          type: string
        LikelyQuoteAlternativeId:
          format: int32
          description: >-
            The alternative that is considered most likely to be accepted. Used
            to calculate probable income.
          type: integer
        SentDate:
          format: date-time
          description: The date the version was sent to the customer.
          type: string
        FollowupId:
          format: int32
          description: >-
            Link to a follow-up activity, created when this quote version was
            sent to the customer.
          type: integer
        ExpirationDate:
          format: date-time
          description: >-
            Last date the quote Version is valid, expiration is at midnight end
            of this day.
          type: string
        DeliveryCountryId:
          format: int32
          description: >-
            Country of delivery address, typically copied from the contact
            record
          type: integer
        HasOwnDeliveryAddress:
          description: The delivery address is not the same as the contact's Street address
          type: boolean
        InvoiceCountryId:
          format: int32
          description: Country of invoice address, typically copied from contact record
          type: integer
        HasOwnInvoiceAddress:
          description: >-
            The quote has an address for Invoicing. This will typically be
            copied from the company's addresses.
          type: boolean
        ERPPaymentTermsKey:
          description: >-
            Either a List id to an id from a connector provided list, or, if the
            connection doesn’t support lists, a text. For instance: ‘Standard 30
            days’.
          type: string
        ERPPaymentTypeKey:
          description: >-
            Either a List id to an id from a connector provided list, or, if the
            connection doesn’t support lists, a text. For instance: 'Invoice'.
          type: string
        ERPDeliveryTermsKey:
          description: >-
            Either a List id to an id from a connector provided list, or, if the
            connection doesn’t support lists, a text. For instance: ‘FOB’ (‘Free
            on board’).
          type: string
        ERPDeliveryTypeKey:
          description: >-
            Either a List id to an id from a connector provided list, or, if the
            connection doesn’t support lists, a text. For instance: ‘Air’.
          type: string
        Rank:
          format: int32
          description: Rank/Version number, starts at 1
          type: integer
        ApprovedBy:
          format: int32
          description: Id of associate who approved (or rejected approval) for this version
          type: integer
        ApprovedText:
          description: Text with comments on why approval was granted (or rejected)
          type: string
        ApprovedRegisteredBy:
          format: int32
          description: >-
            Id of associate who actually entered the approval; might be
            different from ApprovedBy (f.x. due to telephone
            consultation/approval)
          type: integer
        ApprovedRegisteredDate:
          format: date-time
          description: When was approval granted or rejected
          type: string
        ExtraField1:
          description: >-
            Optional information added by Quote Connector; usable in the quote
            document merge process
          type: string
        ExtraField2:
          description: >-
            Optional information added by Quote Connector; usable in the quote
            document merge process
          type: string
        ExtraField3:
          description: >-
            Optional information added by Quote Connector; usable in the quote
            document merge process
          type: string
        ExtraField4:
          description: >-
            Optional information added by Quote Connector; usable in the quote
            document merge process
          type: string
        ExtraField5:
          description: >-
            Optional information added by Quote Connector; usable in the quote
            document merge process
          type: string
        LastRecalculated:
          format: date-time
          description: >-
            When this version was last subjected to a total recalculation. This
            field must be set by the connector, since the connector may choose
            to ignore a RecalculateVersion call based on policies and possibly
            the current value of this field. SuperOffice will set this field to
            1.1.1760 whenever any change occurs to the quote, to indicate that a
            recalculation is needed.
          type: string
        Updated:
          format: date-time
          description: Last updated when  in UTC.
          type: string
        UpdatedAssociateId:
          format: int32
          description: Last updated by whom
          type: integer
        Registered:
          format: date-time
          description: Registered when  in UTC.
          type: string
        RegisteredAssociateId:
          format: int32
          description: Registered by whom
          type: integer
        RequestAssociateId:
          format: int32
          description: User to whom the request proposal should be delivered
          type: integer
        RequestComment:
          description: Comment for why quote should be approved
          type: string
        QuoteAlternatives:
          description: The QuoteAlternatives for the QuoteVersion
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.QuoteAlternative'
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Security.TableRight:
      description: "Wraps a table right together with an explanatory reason.\r\nCode can indicate why access is restricted."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string
    SuperOffice.CRM.Security.FieldProperty:
      description: >-
        Class holding properties like field length, field type about a field in
        the carrier.
      type: object
      properties:
        FieldRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldRight'
        FieldType:
          type: string
        FieldLength:
          format: int32
          description: ''
          type: integer
    SuperOffice.CRM.Services.QuoteAlternative:
      description: "Information about a connection to the ERP system.\r\n<para />\r\nCarrier object for QuoteAlternative.\r\nServices for the QuoteAlternative Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IQuoteAgent\">Quote Agent</see>."
      type: object
      properties:
        QuoteAlternativeId:
          format: int32
          description: Primary key
          type: integer
        ERPQuoteAlternativeKey:
          description: >-
            Key that identifies this alternative in the ERP system, if it exists
            there.
          type: string
        QuoteVersionId:
          format: int32
          description: >-
            The version that owns this alternative (the chain is Sale 1->1 Quote
            1->+ QuoteVersion 1->+ QuoteAlternative.
          type: integer
        Name:
          description: >-
            Name of Alternative. Shown in tab in user interface, intentionally
            kept short
          type: string
        Description:
          description: >-
            The tool-tip to use in the user interface (on the tab, for
            instance).
          type: string
        Status:
          description: >-
            If there was a problem with for instance calculation, this field is
            set to warning or error.
          enum:
            - Ok
            - OkWithInfo
            - Warning
            - Error
          type: string
        Reason:
          description: >-
            If there was a problem, this field contains a localized explanation
            of the problem and possible steps to fix it that the user can be
            shown.
          type: string
        ERPDiscountPercent:
          format: double
          description: >-
            The discount the system calculates based on customer /amount /
            whatever. Can be overridden by the sales rep in the field
            ‘DiscountPercent’ or ‘DiscountAmount’. Both the two
            ‘ERPDiscountPercent’ and ‘ERPDiscountAmount’ shall be filled out. If
            UserValueOverride is 'None', then the ERPDiscountAmount shall be
            copied into DiscountAmount and ERPDiscountPercent into
            DiscountPercent. The Percentage is given in integer form, i.e. ‘12%’
            is represented as ‘12’.
          type: number
        ERPDiscountAmount:
          format: double
          description: >-
            The discount the system calculates based on customer /amount /
            whatever. Can be overridden by the user in the field
            ‘DiscountPercent’ or ‘DiscountAmount’. Both the two
            ‘ERPDiscountPercent’ and ‘ERPDiscountAmount’ shall be filled out. If
            UserValueOverride is 'None', then the ERPDiscountAmount shall be
            copied into DiscountAmount and ERPDiscountPercent into
            DiscountPercent.
          type: number
        DiscountPercent:
          format: double
          description: >-
            The discount the sales rep specifies, in percent. Both the two
            ‘DiscountPercent’ and ‘DiscountAmount’ shall be filled out, but the
            UserValueOverride field must be set to the field the user actually
            changed. If this field is filled out by the user, it overrides the
            discount suggested by the connector. If the user has not filled any
            values, the system will copy the ERP discount percent value into
            this field. The Percentage is given in integer form, i.e. ‘12%’ is
            represented as ‘12’.
          type: number
        DiscountAmount:
          format: double
          description: >-
            The discount the sales rep specifies, in whatever currency the sale
            is in. Both the two ‘DiscountPercent’ and ‘DiscountAmount’ shall be
            filled out, but the UserValueOverride field must be set to the field
            the user actually changed. If this field is filled out by the user,
            it overrides the discount suggested by the connector. If the user
            has not filled any values, the system will copy the ERP discount
            amount value into this field.
          type: number
        UserValueOverride:
          description: >-
            Has the pre-calculated (from ERP) price information been overridden,
            and how. If the user has filled out the discountpercentage field,
            then the UserValueOverride field is set to OverridePercent. (The
            DiscountAmount, EarningPercent, EarningAmount and TotalPrice fields
            are calculated based on the discountPercent.)
          enum:
            - None
            - Total
            - DiscountPercent
            - DiscountAmount
            - EarningPercent
            - EarningAmount
          type: string
        VATInfo:
          description: >-
            Extra info about VAT that the connector might insert. This field has
            no business logic in the CRM code, but is available as a merge field
            in the quote documents.
          type: string
        VAT:
          format: double
          description: >-
            Tax/VAT - THIS IS AN AMOUNT, available as a merge field in the quote
            document. The SuperOffice quote connector will calculate this field
            based on the vat PERCENTAGES on the individual lines; other
            connectors may implement other algorithms at will.
          type: number
        EarningPercent:
          format: double
          description: >-
            The earning on this alternative, in percent of total. The Percentage
            is given in integer form, i.e. ‘12%’ is represented as ‘12’.
          type: number
        EarningAmount:
          format: double
          description: Earning on this alternative, as an absolute amount
          type: number
        SubTotal:
          format: double
          description: >-
            Value to help the user interface, is computed by summing the
            totalprice of the quotelines, and NOT by summing their subtotals
          type: number
        TotalPrice:
          format: double
          description: >-
            Sum of the QuoteLines.TotalPrice - AlternativeDiscount or
            QuoteLines.TotalCost + Earning based on what, if anything, the user
            has entered last. Shall be calculated by the connector.
          type: number
        ExtraField1:
          description: >-
            Optional information added by Quote Connector; usable in the quote
            document merge process
          type: string
        ExtraField2:
          description: >-
            Optional information added by Quote Connector; usable in the quote
            document merge process
          type: string
        ExtraField3:
          description: >-
            Optional information added by Quote Connector; usable in the quote
            document merge process
          type: string
        ExtraField4:
          description: >-
            Optional information added by Quote Connector; usable in the quote
            document merge process
          type: string
        ExtraField5:
          description: >-
            Optional information added by Quote Connector; usable in the quote
            document merge process
          type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Security.FieldRight:
      description: "Wraps the field right together with an explanatory reason.\r\nAlso adds logical operators to the field rights so that they can be easily combined."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string

````

## Related topics

- [SuperOffice.WebApi.Data.Quote GetQuoteEntityFromSaleIdRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Quote_GetQuoteEntityFromSaleIdRequest.md)
- [Retrieve quote info](/en/automation/crmscript/howto/quote/get.md)
- [NSQuoteAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteAgent.md)
- [SuperOffice.WebApi.Agents.QuoteAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.QuoteAgent.md)
- [NSQuoteEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteEntity.md)
- [Get Quote Entity](/en/api/reference/restful/agent/quote_agent/get-quote-entity.md)
