# Set-up

{% hint style="danger" %}
As of 25 June 2025, the PaySG team will not be issuing API keys for new users until further notice.
{% endhint %}

## Instructions&#x20;

To automate payment creation using FormSG's form responses, follow the instructions in the [Creating a form and payment service ](#creating-a-form-and-payment-service)and [Plumber set-up sections](#plumber-set-up).

To automate the above ***and*** the sending of emails or e-letters to payers, follow the instructions in the [Creating a form and payment service](#creating-a-form-and-payment-service), [Plumber set-up](#plumber-set-up) and Sending [emails](#sending-emails) / [letters](#sending-letters) sections.

## Creating a form and payment service

You will need:

1. A form and its corresponding secret key.&#x20;
2. A payment service and an API key, issued to you by the PaySG team (go.gov.sg/contact-paysg)

### Form creation

1. Create a storage mode form on FormSG and **save your secret key securely**. You’ll need this to view responses and to link the form to Plumber.&#x20;
2. The following fields should be included in your form, as these will be used in PaySG to create your payment link later on. These fields are included in the template provided. The fields may be renamed if necessary, but the details must either be collected through the form or manually input in Plumber ([Creating payments with PaySG](#creating-payments-with-paysg)).
   1. **Reference ID**&#x20;

      If not required for your use case, you can manually input a placeholder (e.g. N.A.) on Plumber.
   2. **Name**
   3. **Payment amount**

      For forms without fixed responses/dropdown, use a "Decimal" field on FormSG and enable Number validation to only accept values ≥ 0.50 and <= 999999,99 (card payments) / 200000 (PayNow payments).&#x20;
   4. The following fields are ***optional:***
      1. **Email**&#x20;

         Note that PaySG sends automated payment receipt emails only if an email is included. If an email is not included, payers will not receive payment receipt emails. They may reference the original payment link to view receipts after successful payment.
      2. **Address**
      3. **Identifier (e.g. NRIC/FIN)**

### Payment service creation

1. For one-time payments, follow the steps in our [payment service creation](https://guide.pay.gov.sg/start-using-the-dashboard/payment-services) guide. For subscriptions, follow the steps in our [subscriptions](https://guide.pay.gov.sg/start-using-the-dashboard/subscriptions) guide.
2. Log in to staging.pay.gov.sg and pay.gov.sg before contacting us (go.gov.sg/contact-paysg) to get an API key. You will need this to connect the payment service to Plumber.  Ensure that you include the email address for the API key to be issued to. You may refer to our [FAQ on API keys](https://guide.pay.gov.sg/faq/api-keys) for more information.

## Plumber set-up

### Accepting FormSG responses

Follow the interactive demo below or refer to Plumber's [guide](https://guide.plumber.gov.sg/user-guides/actions/paysg) to learn how to connect FormSG and PaySG on Plumber to create payment links.

{% embed url="<https://app.arcade.software/share/NjCC73aLeaMNrUOlrwE4>" %}

### Converting payment amount into cents

The payment amount from your form must be converted into cents before you can create payment links using PaySG.

{% embed url="<https://app.arcade.software/share/7g9dgXdgyeIroo3oWAlK>" %}

### Creating payments with PaySG

Follow the interactive demo below or refer to Plumber's [guide](https://guide.plumber.gov.sg/user-guides/actions/paysg) to learn how to connect PaySG and create payment links.

{% embed url="<https://app.arcade.software/share/iOB9EPqyFQ8CJsdHVIzV>" %}

<figure><img src="https://3185298559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuqMHPbRxvRp3K0CMQMjE%2Fuploads%2F0eqPB3aeQIZ4R4Q2Af6i%2Fplumber%20paysg.png?alt=media&#x26;token=2efee38c-5eea-4158-a3b9-b013c57733d7" alt=""><figcaption></figcaption></figure>

## Sending emails&#x20;

Follow the interactive demo below to send **PaySG's default payment emails:**

{% embed url="<https://app.arcade.software/share/yvvrDfEgQPqFayJGJ8do>" %}

Follow the interactive demo below to send **customised emails using Postman**:

{% embed url="<https://app.arcade.software/share/BJOJvFBQZEI3DiYEyFP4>" %}

## Sending letters

You may view a demonstration at [go.gov.sg/paysg-fine-demo](https://go.gov.sg/paysg-fine-demo). Please use your gov.sg email for form input.

* [Submit your letter template to LetterSG.](https://go.gov.sg/lettersg-onboarding)
* Once you've been onboarded to LetterSG, refer to Plumber's guide on [connecting LetterSG to Plumber](https://guide.plumber.gov.sg/user-guides/actions/lettersg).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guide.pay.gov.sg/start-using-the-dashboard/payment-workflows-with-plumber/set-up.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
