Customizing the Secure Smart Link
Smart Link URLs that use Smart Tokens require SSL-encrypted connections. Smart Tokens contain encoded information from the order, such as consumer name, address, mobile number, email, DOB, and language preferences (if provided). Smart Tokens can be configured to move consumers directly into specific payment flows and to expire after a specified number of seconds. Merchants can also encode the Smart Token with customized redirect URLs for scenarios like successful payments, abandoned payments, expired Smart Links, errors, etc.
The encrypted Smart Link URL (i.e., secure_smart_link
) returned in the /create_order, /find_orders, and /get_smart_token API responses contains all the consumer data passed in with the order and will display all payment types configured for the merchant site. To enforce specific flows or define specific redirect URLs, use the /get_smart_token call to customize the behavior of the Smart Link. Use the following parameters to update and configure the Smart Token.
Name | Description | Type | Required? |
---|---|---|---|
flow_debit | Indicates whether to include a debit card payment flow in the UI. | bool | O |
flow_credit | Indicates whether to include a credit card payment flow in the UI. | bool | O |
flow_ach | Indicates whether to include the bank account payment flow in the UI. | bool | O |
flow_retailer | Indicates whether to include the cash payment flow in the UI. | bool | O |
flow_apple_pay | Indicates whether to include the Apple Pay payment flow in the UI. | bool | O |
flow_google_pay | Indicates whether to include the Google Pay payment flow in the UI. | bool | O |
flow_paypal | Indicates whether to include the PayPal payment flow in the UI. | bool | O |
flow_venmo | Indicates whether to include the Venmo payment flow in the UI. | bool | O |
flow_pin4 | Indicates whether to include the Pin4 disbursement flow in the UI. | bool | O |
flow_cash_app | Indicates whether to include the Cash App payment flow in the UI | bool | O |
flow_push_debit | Indicates whether to include the debit disbursement flow in the UI. | bool | O |
flow_push_ach | Indicates whether to include the bank account disbursement flow in the UI. | bool | O |
flow_push_paypal | Indicates whether to include the PayPal disbursement flow in the UI. | bool | O |
flow_secure_all | Indicates whether to display all payment types available for your Merchant site. | bool | O |
flow_edit_schedule | Gives the consumer the ability to cancel the Autopay schedule associated with the order. | bool | O |
flow_tokenize | Indicates whether to include the payment method tokenization flow in the UI. | bool | O |
flow_hide_saved_payment_methods | When set to true , this setting hides existing, previously tokenized payment methods for all actions (i.e., pay , withdrawal , tokenize , and auto_pay ). When set to false , this setting shows all previously tokenized payment methods for all actions. When unset or nil, the Embedded Client will hide saved payment methods for the tokenize action and show saved payment methods for the pay and withdrawal actions. | bool | O |
link_lifetime_seconds | Defines the number of seconds the Smart Link (i.e., secure_smart_link ) will be active and accessible before expiring. In the event of expiration, the merchant will need to regenerate the smart token by making another /get_smart_token call. | num | O |
short_order_url | If set to true , PayNearMe returns a shortened Order Tracking URL in the response. | string | O |
flow_pay_url | The URL that displays after a successful payment is made. | string | O |
flow_no_pay_url | The URL that displays when no payment is made. | string | O |
flow_add_url | The URL that displays after a payment method has been captured, tokenized, and successfully added to a consumer’s account. | string | O |
flow_no_add_url | The URL that displays when a payment type is not captured and tokenized. | string | O |
flow_return_url | The URL that displays when the payment or tokenization flow completes. | string | O |
flow_expired_url | The URL that displays when the consumer attempts to access an expired Smart Link URL. | string | O |
flow_error_url | The URL that displays when an error occurs in the payment or tokenization flow. | string | O |
flow_venmo_return_url | The URL that displays after completing a Venmo payment. | string | O |
flow_show_all_ppas | Indicates whether to show all payment methods created for the order, regardless of which browser the consumer used to tokenize the payment methods (i.e., removes cookie restrictions enforced by the different browsers). | bool | O |
flow_trustly | Indicates whether to include a Guaranteed ACH method via Trustly. | bool | O |
ext_customer_enrollment_date | Records the date of the consumer's first transaction with the client in YYYY-MM-DD format. This field is required for Guaranteed ACH payments. | string | O |
ext_customer_date_of_birth_pii | Records the consumer's birth date in YYYY-MM-DD format. NOTE: Parameters suffixed with _pii contain personal identifying information (PII). PayNearMe encrypts parameter values containing PII before storing and only returns specific and/or redacted information in the response. This field is required for Guaranteed ACH payments. | string | O |
ext_customer_tax_id_pii | Records the consumer’s Social Security Number or other Tax ID. NOTE: Parameters suffixed with _pii contain personal identifying information (PII). PayNearMe encrypts parameter values containing PII before storing and only returns specific and/or redacted information in the response. This field is required for Guaranteed ACH payments. | string | O |
flow_bank_oauth_redirect_url | Indicates the URL where consumers should be redirected to when logging into native bank applications that use OAuth login authorization flows. Rather than having to remember and type in a password in a new browser window, OAuth logins enable consumers to log in via the banking app on their phone using saved passwords or biometric authentication (like FaceID or fingerprints). For the Embedded Client, this link should redirect players back to the “Complete Your Payment Details” screen. | string | O |
flow_trustly_reconnect | Identifies the payment method the client wants to reauthorize for a Guaranteed ACH payments. This parameter should only be included when a bank revokes a previously authorized payment method. See Handling an Expired Bank Authorization for more information. | string | O |
Configuring for One Payment Type
To drop a consumer into a specific payment flow, perform the /get_smart_token
call and specify the flow in the request. This call will respond with a regenerated Smart Token that is encrypted with both the order information and the specified payment flow.
curl -X POST https:// www.paynearme-sandbox.com/json-api/get_smart_token -L\
-d flow_ach=true \
-d flow_pay_url=www.successpayurl.com \
-d site_customer_identifier=987654321 \
-d site_identifier=S2155373459 \
-d timestamp=1631051815 \
-d version=2.0 \
-d signature=2d4a97a97d06ec3bb4a72ab52ff45bd9
{
"status": "ok",
"orders": [
{
"pnm_order_identifier": "85089038072",
"site_order_identifier": "5579365601",
"secure_smart_token": "SA0tAlfH7jy3g2H4g04lT!Qk61bpU8eOyk6uNfDoKgtVZTJSuICycRWXjqtFjjOi!2EldKvsVjiCWlyMCyg4EuNy5B0aQW3wNwrASmVlNWc=",
"secure_smart_link": "https://www.paynearme-sandbox.com/ssl/SA0tAlfH7jy3g2H4g04lT!Qk61bpU8eOyk6uNfDoKgtVZTJSuICycRWXjqtFjjOi!2EldKvsVjiCWlyMCyg4EuNy5B0aQW3wNwrASmVlNWc=",
"order_tracking_url": "https://www.paynearme-sandbox.com/85089038072/ch?pay_url=www.successpayurl.com"
}
]
}
Notice that both the secure_smart_link
and the order_tracking_url
values are returned with this call. Both URLs will display the same UI; however, the Smart Link URL (i.e., secure_smart_link
value) encrypts the order information, payment flows, and return URLs within the Smart Token, preloads all relevant consumer data (e.g., name, address, saved payment types, etc.) into the payment form, and—if configured—will expire after a specified number of seconds. The order_tracking_url
displays specified payment flow codes and the return URLs in cleartext within the Smart Link URL.
The Smart Link URL returned in the call above was configured to only accept payments via bank accounts. For new payment types, when the consumer clicks the link, PayNearMe will display a screen like the following.

If the consumer has a saved bank account, PayNearMe displays the following screen after the Smart Link is clicked.

Configuring for Multiple Payment Types
Rather than offer consumers all payment types at once, you can encode the Smart Link to only display your preferred payment types. Use this feature for promotional events or as a method of risk mitigation for specific customers who may have too many returns or chargebacks associated with certain payment types. Like the call for the single payment type configuration, this call regenerates the Smart Token to encrypt additional parameters.
curl -X POST https://www.paynearme-sandbox.com/json-api/get_smart_token -L \
-d flow_google_pay=true \
-d flow_debit=true \
-d flow_credit=true \
-d flow_ach=true \
-d flow_retailer=true \
-d flow_pay_url=www.successpayurl.com \
-d pnm_order_identifier=987654321 \
-d site_identifier=S2155373459 \
-d timestamp=1631133464 \
-d version=3.0 \
-d signature=1d526cce620a78b64da951f110cb011a
{
"status": "ok",
"orders": [
{
"pnm_order_identifier": "87221295581",
"secure_smart_token": "edlGTjhOj8jKxNYVpugNJ!Dt7hfImBiL4LyQcaIDR0k9akbJ5FyQPNwf0cQRZhDT$Ho83W4UQC0qyPnPzyh40gQjlm7GGzk41VF7NgyRHcLSR2q2fg2fBg==",
"secure_smart_link": "https://www.paynearme-sandbox.com/ssl/edlGTjhOj8jKxNYVpugNJ!Dt7hfImBiL4LyQcaIDR0k9akbJ5FyQPNwf0cQRZhDT$Ho83W4UQC0qyPnPzyh40gQjlm7GGzk41VF7NgyRHcLSR2q2fg2fBg==",
"order_tracking_url": "https://www.paynearme-sandbox.com/87221295581/regp?pay_url=www.successpayurl.com"
}
]
}
When a consumer clicks the encrypted Smart Link generated above (i.e., the value in the secure_smart_link
parameter), the following screen displays.

Updated 5 months ago