<PAGE>

                                                                    EXHIBIT 10.8
                                                                    ------------


                          STOCK RESTRICTION AGREEMENT
                          ---------------------------

     AGREEMENT made this 22nd day of May, 1998, between eDOCS, INC., a Delaware
corporation (the "Company") and ________________ (the "Employee").

     WHEREAS, the Company and the Employee desire to impose certain restrictions
on transfer and rights to repurchase with respect to shares of common stock of
the Company owned by the Employee as hereinafter set forth;

     NOW, THEREFORE, for valuable consideration, receipt of which is
acknowledged, the parties hereto agree as follows:

     1.  Shares.  The Company has issued to the Employee and the Employee is the
holder and owner of, subject to terms and conditions of this Agreement,
          shares (the "Shares") of Common Stock, $.001 par value, of the Company
---------
(the "Common Stock), which were issued at a purchase price of $.05 per share.
The Employee agrees that the Shares shall be subject to the Purchase Option set
forth in Section 2 of this Agreement and the restrictions on transfer set forth
in Section 4 of this Agreement.

     2.  Purchase Option.
         ---------------

         (a) In the event that the Employee ceases to be employed by the Company
     for any reason or no reason, with or without cause, prior to May 22, 2001
     the Company shall have the right and option (the "Purchase Option") to
     purchase from the Employee, for a sum of $.05 per share (the "Option
     Price"), up to that percentage of the Shares as is set forth in the second
     column of the table set forth below opposite the period in which the
     Employee ceases to be so employed.


                                                Percentage of Shares Subject to
If Cessation of Employment Occurs:                    the Purchase Option
---------------------------------                     -------------------
Before June 22, 1998                                          75%

     Thereafter on and after the 22nd day of each successive month, the number
of Shares subject to the Purchase Option shall decrease by 2.08% for the next
thirty five (35) months and 2.2% on the thirty sixth (36th) month thereafter.

         (b) For purposes of this Agreement, employment with the Company shall
     include employment with a parent or subsidiary of the Company.

         (c) In the event of a "Change of Control Transaction," as defined
     below, (i) the term of the Purchase Option shall be shortened by 12 months
     (unless the term of the Purchase Option shall at the date of the Change in
     Control of the Company be less than 12 months, in which case such term
     shall expire) and (ii) the number of Shares then subject to the Purchase
     Option shall decrease by
<PAGE>

                                      -2-


     _______ Shares (unless the number of Shares subject to the Purchase Option
     is less than _______ Shares, in which case no Shares shall remain subject
     to the Purchase Option).

         (d) For purposes hereof, the term "Change of Control Transaction" means
     any merger, consolidation, sale of all or substantially all of the assets
     of the Company or any sale or issuance of stock, in a single or related
     series of transactions, where the number of shares of voting stock
     outstanding immediately before the effective date of such Change of Control
     Transaction are converted into, exchanged for or represent less than fifty
     (50%) percent of the voting stock of the surviving or resulting company
     immediately after such Change of Control Transaction, provided that the
     initial equity financing round by the Company involving the issuance of
     Series A Convertible Preferred Stock (the "Series A Financing") and any
     subsequent round of equity financing, in which investors in the Series A
     Financing participate shall not be deemed a Change of Control Transaction.

         (e) In the event that the Employee's termination is due to a reason
     that does not constitute cause, then a Joint Committee (as defined below)
     may, but without any legally binding obligation to do so, determine to
     recommend to the Board of Directors of the Company that it reduce the
     percentage of Shares subject to the Purchase Option. The Joint Committee
     shall consist of one (1) representative of the holders of Series A
     Convertible Preferred Stock and two (2) representatives of the founders of
     the Company, Kevin E. Laracey, Kris Canekeratne or James Moran (whomever is
     not the Employee hereunder).

     3.  Exercise of Purchase Option and Closing.
         ---------------------------------------

         (a) The Company may exercise the Purchase Option by delivering or
     mailing to the Employee (or his estate), in accordance with Section 12,
     within 60 days after the termination of the employment of the Employee with
     the Company, a written notice of exercise of the Purchase Option. Such
     notice shall specify the number of Shares to be purchased. If and to the
     extent the Purchase Option is not so exercised by the giving of such a
     notice within such 60-day period, the Purchase Option shall automatically
     expire and terminate effective upon the expiration of such 60-day period.

         (b) The sale of the Shares to be sold to the Company pursuant to this
     Section 3 shall be made at the principal executive office of the Company on
     the 15th day following the date of the Company's written election to
     purchase (or if such 15th day is not a business day, then on the next
     succeeding business day).  Such sale shall be effected by delivery to the
     Company of (i) a certificate or certificates evidencing the Shares to be
     purchased by it, and (ii) stock assignments therefor endorsed by the
     Employee for transfer to the Company, against payment
<PAGE>

                                      -3-

     by the Company to the Employee of the aggregate Option Price for such
     Shares to be purchased by the Company.

         (c) After the time at which any Shares are required to be delivered to
     the Company for transfer to the Company pursuant to subsection (b) above,
     the Company shall not pay any dividend to the Employee on account of such
     Shares nor permit the Employee to exercise any of the privileges or rights
     of a stockholder with respect to such Shares, but shall, in so far as
     permitted by law, treat the Company as the owner of such Shares.

         (d) The Option Price may be payable, at the option of the Company, in
     cancellation of all or a portion of any outstanding indebtedness of the
     Employee to the Company or in cash (by check) or both.

         (e) The Company shall not purchase any fraction of a Share upon
     exercise of the Purchase Option, and any fraction of a Share resulting from
     a computation made pursuant to Section 2 of this Agreement shall be rounded
     to the nearest whole Share (with any one-half Share being rounded upward).

         (f) If the Employee becomes obligated to sell Shares to the Company
     under this Agreement and fails to deliver such Shares to the Company in
     accordance with the terms of this Agreement, the Company may, at its
     option, in addition to all other remedies it may have, send to the Employee
     by registered mail, return receipt requested, the Option Price. Thereupon,
     the Company, upon written notice to the Employee, (i) shall cancel on its
     books the certificate or certificates representing the Shares to be sold;
     and (ii) shall issue, in lieu thereof, a new certificate or certificates in
     the name of the Company representing such Shares which may remain; and
     thereupon all of the Employee's rights in and to such Shares shall
     terminate.

     4.  Restrictions on Transfer.
         ------------------------

         (a) Except as otherwise provided in subsection (c) below, the Employee
     shall not, during the term of the Purchase Option, sell, assign, transfer,
     pledge, hypothecate or otherwise dispose of, by operation of law or
     otherwise (collectively "transfer"), any of the Shares, or any interest
     herein, unless and until such Shares are no longer subject to the Purchase
     Option.

         (b) If requested by the Company and the managing underwriter in
     conjunction with a public offering of the Company's securities, the
     Employee agrees to enter into a lock-up agreement pursuant to which the
     Employee will not, from the date of such lock-up agreement and through a
     period of no more than 180 days following the effective date of the first
     registration statement for a public offering of the Company's securities,
     and for a period of no more than 90 days following the effective date of
     any subsequent registration statement, sell, assign,
<PAGE>

                                      -4-

     transfer, pledge, hypothecate, mortgage or otherwise dispose of, by gift or
     otherwise, or in any way encumber, any of the Shares owned by the Employee,
     except as otherwise provided in subsection (c) below. Notwithstanding the
     foregoing, the Employee shall not be required to enter into such lock-up
     agreement with respect to a public offering unless all of the directors and
     executive officers of the Company agree in connection with such public
     offering to enter into lock-up agreements in substantially the same form,
     and for the same period, as those requested of the Employee.

         (c) Notwithstanding the foregoing, subject to the restrictions on
     transfer set forth in any Stockholders Agreement to which the Employee is a
     party, the Employee may transfer any or all of his Shares (a) by way of
     gift to any member of his family (i.e., spouse, sibling, child (natural or
     adopted), or any other lineal ancestor or descendant) or to any trust,
     partnership or limited liability company for the benefit of, or the
     ownership interests of which are wholly owned by, any such family member of
     the Employee (each, a "Permitted Transferee"), or (b) by will or the laws
     of descent and distribution to or for the benefit of a Permitted
     Transferee, provided that any such Permitted Transferee, as a condition to
     such transfer, shall execute an Instrument of Adherence in the form of
     Exhibit B hereto, agreeing to be bound by the terms of this Agreement to
     the same extent as if such Permitted Transferee were the Employee.

     5.  Effect of Prohibited Transfer.  The Company shall not be required (a)
         -----------------------------
to transfer on its books any of the Shares which shall have been sold or
transferred in violation of any of the provisions set forth in this Agreement,
or (b) to treat as owner of such Shares or to pay dividends to any transferee to
whom any such Shares shall have been so sold or transferred.

     6.  Restrictive Legend.  All certificates representing Shares shall have
         ------------------
affixed thereto a legend in substantially the following form, in addition to any
other legends that may be required under federal or state securities laws:

         "The shares of stock represented by this certificate are subject to
         restrictions on transfer and an option to purchase set forth in a
         certain Stock Restriction Agreement between the corporation and the
         registered owner of these shares (or his predecessor in interest), and
         such Agreement is available for inspection without charge at the
         office of the Secretary of the corporation."

     7.  Adjustments for Stock Splits, Stock Dividends, etc.
         ---------------------------------------------------

         (a) If from time to time during the term of the Purchase Option there
     is any stock split-up, stock dividend, stock distribution or other
     reclassification of the Common Stock of the Company, any and all new,
     substituted or additional
<PAGE>

                                      -5-

     securities to which the Employee is entitled by reason of his ownership of
     the Shares shall be immediately subject to the Purchase Option, the
     restrictions on transfer and other provisions of this Agreement in the same
     manner and to the same extent as the Shares, and the Option Price shall be
     appropriately adjusted.

         (b) If the Shares are converted into or exchanged for, or stockholders
     of the Company receive by reason of any distribution in total or partial
     liquidation, securities of another corporation, or other property
     (including cash), pursuant to any merger or consolidation of the Company or
     acquisition of its assets, then the rights of the Company under this
     Agreement shall inure to the benefit of the Company's successor and this
     Agreement shall apply to the securities or other property received upon
     such conversion, exchange or distribution in the same manner and to the
     same extent as the Shares.

     8.  Severability.  The invalidity or unenforceability of any provision of
         ------------
this Agreement shall not affect the validity or enforceability of any other
provision of this Agreement, and each other provision of this Agreement shall be
severable and enforceable to the extent permitted by law.

     9.  Waiver.  Any provision contained in this Agreement may be waived,
         ------
either generally or in any particular instance, by the Board of Directors of the
Company.

     10. Binding Effect.  This Agreement shall be binding upon and inure to the
         --------------
benefit of the Company and the Employee and their respective heirs, executors,
administrators, legal representatives, successors and assigns, subject to the
restrictions on transfer set forth in Section 4 of this Agreement.

     11. No Rights To Employment.  Nothing contained in this Agreement shall be
         -----------------------
construed as giving the Employee any right to be retained, in any position, as
an employee of the Company.

     12. Notice.  All notices required or permitted hereunder shall be in
         ------
writing and deemed effectively given upon personal delivery or upon deposit in
the United States Post Office, by registered or certified mail, postage prepaid,
addressed to the other party hereto at the address shown beneath his or its
respective signature to this Agreement, or at such other address or addresses as
either party shall designate to the other in accordance with this Section 12.

     13. Pronouns.  Whenever the context may require, any pronouns used in this
         --------
Agreement shall include the corresponding masculine, feminine or neuter forms,
and the singular form of nouns and pronouns shall include the plural, and vice
versa.

     14. Entire Agreement.  This Agreement constitutes the entire agreement
         ----------------
between the parties, and supersedes all prior agreements and understandings,
relating to the subject matter of this Agreement.
<PAGE>

                                      -6-

     15. Amendment.  This Agreement may be amended or modified only by a
         ---------
written instrument executed by both the Company and the Employee.



                     [This Space Intentionally Left Blank.]
<PAGE>

                                      -7-


     16.  Governing Law.  This Agreement shall be construed, interpreted and
          -------------
enforced in accordance with the laws of The Commonwealth of Massachusetts
without regard to conflicts of laws principles.

     IN WITNESS WHEREOF, the parties hereto have executed this Agreement as of
the day and year first above written.


                              eDOCS, INC.


                              By:
                                  ----------------------
                                  Title:

                              Address:
                                      ------------------

                                      ------------------

                              EMPLOYEE:


                              By:
                                  ---------------------


                              Address:
                                      ------------------

                                      ------------------