The direct object of ditransitive verbs is the so-called accusative object answering the question “who” or “what” (German: “wen” oder “was”), the indirect object is the so-called “dative object” answering the question “to whom or what” or “for whom or what” (German: “wem” oder “was”) (note the “m”).
To understand the status of the objects of ditransitive verbs, it's important to remind ourselves that ditransitive verbs are those that obligatorily require both a direct object and an indirect object to complete their meaning.
Direct Object (DO) (accusative object, because it is in the accusative case): The direct object is the noun or noun phrase to which the action of the verb is targeted. It answers the question “who” or “what” after the verb. Example: In the sentence “She gave him a book,” “a book” is the direct object because it's what is being given. Note: most* transitive verbs take an accusative object: “He baked a cake.”
Indirect Object (IO) (dative object): The indirect object is the recipient or beneficiary of the direct object. It usually answers the question “to whom” or “for whom” the action is done (in our example: to WHOM something is given). In the sentence “She gave him a book,” “him” is the indirect object because it denotes the recipient of the book. Note, by the way, that in this case you can see from the morpho-syntactic form of the personal pronoun “him” that it is in the dative case. (“whom” - “him” … - but that's not always the case, esp. in English).
Grammatically, both the direct and indirect objects are considered complements of the ditransitive verb. They are BOTH essential to the meaning of the sentence. Removing either the direct or indirect object would result in an incomplete and, thus, ungrammatical sentence or a different meaning altogether.
*Just as an aside and in case anybody was wondering: yes, there is a special class of so-called dative verbs, i.e. transitive verbs that take an obligatory dative object only. Here, the direct object is in the dative case and there is no accusative object.
For example consider:
English: | “She helps him.” | German: | “Sie hilft ihm.” | |
English: | “He trusts her.” | German: | “Er vertraut ihr.” | |
English: | “The book belongs to me”. | German: | “Das Buch gehört mir.” |