> For the complete documentation index, see [llms.txt](https://docs.number.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.number.tech/documentation/getting-started/integration-options/text2pay.md).

# Text2Pay

One of our most popular features enables you to generate payment links on demand through the API and deliver them directly to cardholders via SMS or email.

The API call needed to invoke this activity is shown here: [Text to Pay](https://docs.number.tech/api-reference/rest-api/text-to-pay)

With a single API call, you can configure the payment experience by controlling visible and read-only fields, customizing form behavior and styling, and including a personalized message for the recipient. The payment form can be pre-populated with customer information such as name, address, and Patient ID. You may also provide reference data or other contextual information, which will be associated with the transaction after authorization.

#### Field Descriptions&#x20;

MessageType: ( TEXT,EMAIL,URLONLY )\
RefID: ( user defined field )&#x20;\
RPGUID: ( user defined field )

*MessageBody:* (here you can create a custom message to send via text or email)&#x20;\
\&#xNAN;*AcctHolderID:* ( NOT USED )&#x20;\
\&#xNAN;*Amount:* ( payment amount )&#x20;\
\&#xNAN;*ConsentID:* ( NOT USED )&#x20;\
\&#xNAN;*DueOn:* ( can be shown in message to indicate when payment is due  )\
\&#xNAN;*EINDEX:* ( can be used to indicate encrypted webhook )&#x20;\
\&#xNAN;*MerchID:* ( Must provide a valid Merchant record index for the Account used )&#x20;\
\&#xNAN;*TXID:* (NOT USED)&#x20;\
\&#xNAN;*WType:*  ( use SW here )&#x20;\
\&#xNAN;*RedirectURL:*  ( we can redirect to your site and pass real-time info after authorization )&#x20;\
\&#xNAN;*WidgetURL:* ( we will provide you the proper address for your payment form )\
\&#xNAN;*ExpiresOn:* ( we can display the link expiration date within your message)&#x20;\
\&#xNAN;*SingleUse:* ( enter a 1 to restrict the link to be used more than one time for payment )&#x20;\
\&#xNAN;*OptParam:* (this provides a means for us to configure and style the payment form)\
\&#xNAN;*Questions:* ( NOT USED )&#x20;

#### Defining your Form&#x20;

The OPTPARAM field defines the payment form in terms of visible fields, read-only fields, styles and behavior.  We use a specific tool to generate this value found here  <https://easypay8.com/byowidget/> .  You may select the options you desire then press GENERATE OPTPARAMS.  We are always glad to assist you with defining your form as this is a very important part of collecting payments. &#x20;

#### Sending a Custom TEXT Message&#x20;

here you can use the *MessageBody Field* &#x20;

When sending a TEXT/SMS, it is best to keep the message short and sweet. it is for this reason we have a DEFAULT message which you can use by simply leaving this field empty.&#x20;

We will simply pull a few details from your request such as:

MERCHANT NAME, AMOUNT, PAYMENT DUE DATE, LINK EXPIRATION

**The resulting text message will read as Follows**&#x20;

<sup>*You have a Payment Due to ( Merchant Name ) of (Amount) due on ( Due Date ) .  Follow the link below to make payment (Payment Link) This Link Expires on ( Exp Date )*</sup>&#x20;

If you decide to create your own message we will append the following to your message:

<sup>*Follow the link below to make payment (Payment Link) This Link Expires on ( Exp Date )*</sup>&#x20;

#### Sending a Custom EMAIL Message&#x20;

For the Email Option you must create a custom message. To help create your message we have provided some Variable fields: Please include the "||" characters.&#x20;

* ||Merch1||  when we see this in your message we will replace it with the actual Merchant name
* ||PayLink||  when we see this in your message we will replace it with the payment link
* ||DueOn||  when we see this we will replace it with the Date you specify for payment due date
* ||ExpOn||  when we see this we will replace it with the Date you specify for payment link expiration Date&#x20;

Here is an example Custom Message for EMAIL using the variables above

\<b>Dear John Doe,\</b>\<br />\<br />This is a friendly reminder that you have an outstanding balance of \<br /> $26.56 for your visit on 5/5/2026 with ||Merch1||. \<br />\<br />This payment is due on ||DueOn||. You can easily review your statement and submit your payment securely through our patient Portal \<br />\<br />Or you can also safely follow the link shown here.\<br />||PayLink||\<br/>This Link Expires on ||ExpOn||\<br />\<br />\<b>Thank You\<b>\<br/>||Merch1|| Billing Dept\</b>

&#x20; Here is the resulting email message:&#x20;

<figure><img src="/files/Tpx191S9jMmqyukrBIB5" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.number.tech/documentation/getting-started/integration-options/text2pay.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
