How to get payment invoices for the successful payments made

hi,

we’re using Square Node SDK in one of our production apps and we charge the users by making authenticated POST requests to https://connect.squareup.com/v2/locations/<SOME-LOCATION-HERE>/transactions. The response is something like this:

{ 
  transaction: 
   { id: 'SOME_ID',
     location_id: 'SOME_LOCATION_ID',
     created_at: '2020-05-22T10:09:12Z',
     tenders: [ [Object] ],
     reference_id: 'SOME_REFERENCE_ID',
     product: 'EXTERNAL_API' },
  idempotency_key: 'SOME_KEY',
  reference_id: 'SOME_REFERENCE_ID' 
}

However, while these succeed and we get what we wanted in the first place – we need to send invoices for these payments back to the user in mailers and I couldn’t find any api on the documentation that accomplishes that. What should I do?

Since it seems like you’re talking about paid payments, do you mean receipts instead of invoices? The V2 Payments API (which has replaced V2 Transactions, which is what you’re using), has a receipt_url that you can send to the customer if needed: https://developer.squareup.com/reference/square/payments-api/get-payment. Let me know if I misunderstood, though.