(No Ratings Yet)
Loading...
, Author: Oleksandr

How to connect FONDY to more than 2000 services. #3 Sending invoices to clients using Google Sheets and Zapier

We`ve already learned how to save payments to Google Sheets document and how to create transactional emails with a custom design. Today let`s find out how to send invoices to the clients by adding a single row to the Google Sheets document. As a result, we should get this sequence:

Firstly, create a table in Google Drive with the following structure: http://bit.ly/32mjmVN

This structure is minimally necessary, it can be modified to fit your needs, but the required fields must be preserved:

  • amount — enter without a separator, to set an invoice for 220.33 EUR, you need to specify the amount 22033 in the cell.
  • currency — a list of supported currencies can be found here: https://docs.fondy.eu/docs/page/27/
  • email — of the client whom you want to send the letter with the invoice
  • description — description of the invoice, for example, “Payment for a webinar”
  • invoice# — unique invoice identifier, if for some reason the client was unable to get the invoice (in the past), the new Google Sheets entry should have a different identifier
  • checkout url — link to the payment that will be generated through the FONDY API after working out Zap, and which will be sent to the client by email. It can also be sent to the client through the messenger, or in another convenient way.

Next, go to Zapier and create the first step: When this happens …1. New Spreadsheet Row in Google Sheets.

Make sure that the records are parsed:

Next, we will need to send the received data to the endpoint of FONDY API (look at. documents pt.3, and link). For this in Do this …2. set a Custom Request:

{
“request”: {
“server_callback_url”: “http://myshop/callback/",
“order_id”: “{{invoice#}}”,
“currency”: “{{currency}}”,
“merchant_id”: {1396424},
“order_desc”: “{{desription}}”,
“amount”: {{amount}},
“sender_email”: “{{email}}”
}
}

  • Headers: content-type=application/json

where {1396424} — your merchant ID received during the registration at FONDY Merchant Portal

This is how the config should look like:

Let`s test sending invoice data to API. You shall get a token in response:

If you didn`t get a token, make sure that:

  • you specified the correct merchant_id
  • a unique identificator is used for invoice# field
  • you use the currency allowed for your merchant (this can be clarified in the support service: support@fondy.eu)
  • you indicated in Header the attribute content-type
  • server_callback_url is optional, but it may come in handy in order to receive Webhook in the future for successful payment and setting up additional actions (for example, send an email if the payment was successful). In this parameter, you can specify the Webhook URL for Zapier

If at this stage you still have difficulties and token does not return, try to send debugging data that was parsed from Gooogle Sheets using curl:

curl -X POST \
https://api.fondy.eu/api/checkout/token \
-H ‘content-type: application/json’ \
-d ‘{
“request”: {
“server_callback_url”: “http://myshop/callback/",
“order_id”: “test_invoice_1233131”,
“currency”: “USD”,
“merchant_id”: “1396424”,
“order_desc”: “Invoice description”,
“amount”: “100”
}
}’

In the next step, we need to find the entry in the original Google Sheets document from step 1, and put in the checkout url field a link to the payment, which is formed as https://api.fondy.eu/api/checkout?token={token} where {token}  is a token obtained in the previous step:

Make sure the record was found:

Next, let`s change the checkout url field: Do this …4. Update Spreadsheet Row in Google Sheets:

In the field Custom Value for Row ID set an ID got on step 3. Lookup Spreadsheet Row in Google Sheets

In the field checkout url specify https://api.fondy.eu/api/checkout?token={{response__token}}

Testing:

Make sure that the record is updated in Google Sheets:

Now the received link can be sent to the client, or added to the step of sending email via Zapier:

Now let`s send a letter through SMTP by Zapier. Add a step: Do this …5. Send Email

Specify SMTP settings for your mail server. It could be gmailyahoooutlook or your corporate SMTP:

Also specify Subject, Body HTML, From Name. Sender Email can be got from step 1:

Do not forget to add a checkout url to the Body:

Now we can test the whole chain, and, as a result, receive the letter:

And follow the payment link:

Thus, you can create bulk invoice mailings to your customers without even entering your FONDY merchant portal.

#about-fondy

Comments are closed.