Using Authorization Callbacks

Authorization callbacks enable you to control which consumers can make payments and when. Payment attempts trigger authorization callbacks to the merchant before the transaction is sent for processing.

The authorization callback allows you to perform the following tasks:

  • Decline unwanted payments such as the following:
    • Transactions containing expired offers,
    • Transactions where the payment amount is over regulatory or risk limits,
    • Transactions from a consumer account with frequent chargebacks and/or returns.
  • Provide up to 3,000 characters of customized, dynamic text for the receipt. Use this text to deliver valuable consumer information, such as instructions, points programs, account status, or special offers based on the consumer’s purchase history.

Available Customizations

Clients can configure their Authorization callbacks to exclude certain payment scenarios. Specifically, the callback can be skipped for:

  • Payments initiated via the API using the /make_payment endpoint,
  • Payments that are part of a recurring autopay schedule,
  • Future-dated, one-time payments.

This customization allows for more streamlined processing by eliminating unnecessary callbacks for automated or scheduled transactions.

In addition to customizing when the Authorization callback is made, clients can also customize what parameters are returned with the callback. For example, if your site does not accept cash payments, you may want to exclude the payment_longitude, payment_latitude, retailer_location_address, retailer_location_identifier, and retailer_name from the payload of your Authorization callbacks.

Other excludable parameters are marked in the Request Parameters table. To make any of these customizations, consult your PayNearMe Technical Account Manager.

Request Parameters

For electronic transactions (e.g., non-cash payments), PayNearMe automatically initiates the authorization callback after the consumer submits his/her payment data. For cash transactions, the retailer initiates the authorization callback after scanning the consumer’s Token (e.g., barcode or QR code). Once initiated, the callback pings a handler endpoint that you’ve set up on your server. This ping notification can include the following parameters:

ParameterDescriptionTypeExcludable?
site_identifierThe ID that identifies your merchant site.string
pnm_payment_identifierA unique string ID that PayNearMe generates with each payment.string
site_customer_identifierA unique string ID the merchant creates to identify consumers.string
site_order_identifierA unique string ID the merchant creates to identify the order.string
due_to_site_amountThe amount due to the merchant at settlementdec
due_to_site_currencyUSDenum
net_payment_amountThe payment amount after taking out the Site Processing Fee, PNM Processing Fee, and if applicable, the Retailer’s Fee.dec
net_payment_currencyUSDenum
payment_amountThe total payment amount the consumer submitted online or paid to the retailer.dec
payment_currencyUSDenum
payment_dateThe date of the payment in Epoch Standard time.string
pnm_withheld_amountThe total amount withheld by PayNearMe that is shared with the retailer, site, and parent site, if applicable.dec
pnm_withheld_currencyUSDenum
payment_card_typeThe type of debit or credit card payment method.string
payment_card_last4The last four digits of the credit or debit card used in the payment.string
payment_bank_nameThe name of the consumer’s bank.string
payment_bank_last4The last four digits of the bank account used in the payment.string
payment_longitudeThe longitudinal coordinate of the retail location the consumer selected for his/her cash payment. NOTE: Only included for cash transactions.string✔️
payment_latitudeThe latitudinal coordinate of the retail location the consumer has selected for his/her cash payment. NOTE: Only included for cash transactions.string✔️
retailer_location_addressThe street address and state of the retailer location. NOTE: Only included for cash transactions.string✔️
retailer_location_identifierThe PayNearMe-defined ID for the retailer location. NOTE: Only included for cash transactions.enum✔️
retailer_nameThe name of the retailer. NOTE: Only included for cash transactions.string✔️
pnm_order_identifierThe unique, PayNearMe-generated ID for this order.string
pnm_processing_feeThe amount of the processing fee that PayNearMe charges.dec
pnm_processing_currencyUSDenum
site_order_annotationA merchant-provided description of the order. This field is only echoed in the callback if the site_order_annotation parameter was included in the original
create_order request.
string
site_processing_feeThe amount of the Retailer’s processing fee.dec
site_processing_currencyUSDenum
payment_typeThe type of funding method the consumer used for the transaction. Supported values include the following:
  • ach
  • apple_pay
  • cash
  • cash_app
  • credit
  • debit
  • google_pay
  • paypal
  • pin4
  • venmo
enum✔️
payment_method_identifierThe unique identifier (i.e., token) for the payment method account.string✔️
site_channelIndicates the source of the transaction. Supported options include the following:
  • agent
  • agent-recurring
  • agent-waived
  • consumer
  • consumer-ivr
  • consumer-recurring
  • kiosk
enum
site_subchannelIndicates whether the transaction was a scheduled transaction. Supported options include the following:
  • scheduled_one_time
  • scheduled_recurring
enum✔️
agent_nameThe first and last name of the agent that created the payment. This field is only returned for immediate payments made by agents in the Embedded Form. It will not display for recurring or scheduled payments.string✔️
agent_emailThis field is only returned for immediate payments made by agents in the Embedded Form. It will not display for recurring or scheduled payments.string✔️
pricing_schedule_nameSpecifies the pricing category associated with the payment. Supported options include the following:
  • agent
  • agent_recurring
  • consumer
  • consumer_recurring
enum
settlement_methodThe ID of the bank account where funds for this payment will be settled. string✔️
signatureThe HMAC signature of the callback (v3.0) or the MD5 signature of the callback (v2.0) used to authenticate it as a genuine PayNearMe callback.string

Response Parameters

Once you receive the authorization callback, you have 10 seconds to approve or decline the transaction with a response containing the following parameters:

Response ParameterDescriptionTypeReq
pnm_order_identifierThe unique, PayNearMe-generated ID for this order.stringR
accept_paymentIndicates whether you want to accept the payment. Supported values for this field include the following: 
  • yes
  • no
enumR
site_payment_identifierAn arbitrary, merchant-defined string that identifies the payment. If specified, PayNearMe will echo this value back during the Confirmation callback. To correlate Authorization and Confirmation calls, use the pnm_payment_identifier parameter rather than the site_payment_identifier.stringO
decline_reasonA customized text string that indicates the reason the authorization was declined. The string may be static or dynamically generated and may optionally include parameters for data to be supplied by PayNearMe.stringO
receiptUp to 3,000 characters of a customized text string for the receipt. The string may be static or dynamically generated and may optionally include parameters for data to be supplied by PayNearMe. Receipt verbiage must adhere to the following specifications: 
  • Messages can be 3,000 characters or less.
  • Only 40 monospaced characters per printed line.
  • Use <br> to indicate line breaks.
  • To center align a line of text, prefix the line with a carat (^).
If this parameter is not included in your callback response, the receipt will display your site’s default messaging for approved and declined transactions.
stringO

If PayNearMe does not receive a response to the authorization callback, the transaction is automatically voided.

🚧

Velocity Limits

PayNearMe enforces velocity limits for each consumer regardless of callback status. These limits include a rolling, per 24-hour limit (e.g., $500 for cash payments) and a rolling, per 30-day limit (e.g., $10,000 for cash payments) for each payment type. If a consumer attempts to make payments that exceed these limits, PayNearMe will automatically decline the transaction without sending the Authorization callback to the merchant.

Sample Code

The following code samples display a sample callback request and an approved and declined server response from:

{
  "pnm_order_identifier": "87549788233",
  "pnm_payment_identifier": "646587045351",
  "site_order_identifier": "276900000",
  "site_customer_identifier": "276900000",
  "site_payment_identifier": "SPI-123",
  "version": "3.0",
  "net_payment_amount": "150.00",
  "net_payment_currency": "USD",
  "payment_amount": "150.00",
  "payment_currency": "USD",
  "timestamp": "1742415312",
  "status": "payment",
  "pnm_withheld_amount": "1.00",
  "pnm_withheld_currency": "USD",
  "due_to_site_amount": "149.00",
  "due_to_site_currency": "USD",
  "standin": "false",
  "payment_timestamp": "2025-03-19 13:15:11 -0700",
  "order_payee_identifier": "S9150977386",
  "settlement_method": "SM685563976",
  "payment_type": "ach",
  "payment_method_identifier": "e2bbc1324d126",
  "site_identifier": "S9150977386",
  "payment_bank_name": "JPMorgan Chase",
  "payment_bank_last4": "5044",
  "site_channel": "consumer",
  "pricing_schedule_name": "consumer",
  "signature": "826ce38202f6c041ed1b242ba34b44ef283e151629e4143f216cef7db630666b"
}
{
	"payment_authorization_response": {
		"version":"3.0",
		"authorization": {
			"pnm_order_identifier":"87549788233",
			"accept_payment":"yes",
			"receipt":"^Thank you for your payment<br>^of $<pnm_payment /> to Beaver County Water Authority.<br>^For questions call 555-555-5555.",
			"memo":"2025-03-19 12:21:45 -0700",
			"site_payment_identifier":"SPI-123"
		}
	}
}
{
	"payment_authorization_response": {
		"version":"3.0",
		"authorization": {
			"pnm_order_identifier":"87549788233",
			"accept_payment":"no",
			"decline_reason":"Account Suspended",
			"receipt":"^Payments cannot be made at this time.<br>^Please call Customer Service at 555-555-5555.",
			"memo":"2025-03-19 12:21:45 -0700",
			"site_payment_identifier":"SPI-123"
		}
	}
}