I didn't find any data.table solutions, this is how I got it though:
library(dplyr)
earlierPurchases <- vector()
for(i in 1:nrow(DT)) {
temp <- dplyr::filter(DT, zip == zip[i] & date < date[i])
earlierPurchases[i] <- sum(temp$purchaseAmount)
}
DT <- cbind(DT, earlierPurchases)
It worked quite fast.