Search code examples
javascriptapigoogle-apps-scriptgmailgoogle-workspace

How to request and send payments via Gmail API and Google Apps Script


I want to request and send payments via Gmail API and Google Apps Script.

Here is documentation for using Google Apps Script with the Gmail API.

Here is information on how to manually request and send payments using Gmail.

Here is information for developers on how to use Google Pay.

So, based on that, there seems like there should be a way to use Google Apps Script to tap into the Gmail API to send and receive payments. But I can't find any documentation how to do that.

So how can I accomplish that?

Code.gs
// Send an email with a file from Google Drive attached as a PDF.
var file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz');
GmailApp.sendEmail('[email protected]', 'Attachment example', 'Please see the attached file.', {
    attachments: [file.getAs(MimeType.PDF)],
    name: 'Automatic Emailer Script'
});

Solution

  • There is currently no API or Apps Script service available for that use-case.

    You should go to the Google Issue Tracker and submit a feature request for this.