字据 is generic 'something in writing as proof' — a homemade IOU, a handwritten receipt, an informal contract between friends or family. More formal documents are
合同 hétóng (contract),
协议 xiéyì (agreement),
收据 shōujù (official receipt). Verbs:
立字据 lì zìjù = draw up a written pledge;
打字据 dǎ zìjù = write one out.