Now I am develop in app purchase in flutter, after I send a verify request, the response body of json contains last receipt info and receipt, I found the fields of last receipt info and receipt are different. which one should I store in database on my server? should I store both of them? should I merge the latest receipt info and receipt?
You should store the last last_receipt_info
(they are not ordered, so sort by purchase_date_ms
before) AND the pending_renewal_info
matching your purchase (necessary for managing grace periods).
IAP is hard and since you're asking for something somewhat basic, I would recommend to read (a lot ?) of articles about IAP on iOS.
One more bit of advice: Apple is going to release StoreKit 2, which will change the way things are working. So if I were you, I would definitely look into this if you're only beginning implementing IAP in your app.
Here is the official video about StoreKit 2.