Add invoice preview API

cc/ @austinheap