Skip to main content
Version: 1.28 (Current)

Get Transaction Details

Audience: Low-code Engineers

Skill Prerequisites: Actions, Tokens, JSON, PayPal business account

Asks PayPal for the details of a transaction, such as its status, amount and payer, and saves PayPal's answer as JSON in a token. Use it to check a payment on your server, instead of trusting what the browser or a notification says.

note

This action is part of the PayPal add-on (DnnSharp.PayPal). The add-on is installed separately and needs the PAYPAL feature in your license. If it isn't licensed, the action fails with a "not licensed" error. If you don't see the PayPal actions, the add-on isn't installed.

Typical Use Cases​

  • Confirm a payment reported by an IPN before you record it, using the IPN's txn_id
  • Check the status of a payment taken with PayPal - Express Checkout, for example one that was Pending
  • Show payment details, such as the payer's email and the amount, on an order page

Don't use it to​

  • Look up a subscription. It needs a transaction ID, not a subscription profile ID such as I-DF3S35GWL16Y.
  • Look up Authorize.Net or Stripe payments. It only works with PayPal.
Action NameDescription
PayPal - Express CheckoutTakes the payment and returns its transaction ID. It explains the whole PayPal flow.
PayPal - Parse IPN RequestReads PayPal notifications, which include a txn_id for payments.
Cancel Express Checkout SubscriptionCancels a PayPal subscription.
Parse JSON Into TokensTurns the JSON this action returns into tokens.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
API UsernameThe API username of your PayPal account's classic API (NVP/SOAP) credentials. Use the sandbox credentials when Go Live is off.Yesempty stringYes
API PasswordThe API password that goes with the username.Yesempty stringYes
API SignatureThe API signature that goes with the username.Yesempty stringYes
Go LiveWhen on, the request goes to PayPal's live API. When off, it goes to the PayPal sandbox (api-3t.sandbox.paypal.com). Use the same setting as the payment you're looking up.YesfalseNo
Transaction IdThe PayPal transaction ID, for example [PayPalTransactionId] from Express Checkout or [Ipn:txn_id] from an IPN.Yesempty stringYes

Output Parameters Reference​

ParameterDescription
JSON TokenThe name of the token that gets PayPal's answer, without brackets, for example PayPalTransactionJson. If it's empty, the action fails with the error No JSON Token name provided.

What's in the JSON​

The action calls PayPal's classic NVP GetTransactionDetails method (version 109.0). It turns PayPal's answer into a flat JSON object: each field PayPal returns becomes a property, and every value is text. For example:

{
"ACK": "Success",
"TRANSACTIONID": "8AB12345CD678901E",
"PAYMENTSTATUS": "Completed",
"AMT": "49.95",
"CURRENCYCODE": "USD",
"EMAIL": "buyer@example.com",
"PAYERID": "ABCDEFGHIJKLM"
}

Which fields you get depends on the transaction. See PayPal's documentation of GetTransactionDetails for the full list. Use Parse JSON Into Tokens to read them, for example as [Txn:PAYMENTSTATUS].

If PayPal can't return the transaction, for example because the ID is wrong or the credentials are for the other environment, ACK is Failure, and L_ERRORCODE0 and L_LONGMESSAGE0 explain why. If PayPal can't be reached or answers with an HTTP error, the JSON only has L_ERRORCODE0 set to -1 and a general L_LONGMESSAGE0, and the details are in the log.

Considerations​

  • Check ACK. The action doesn't fail when PayPal returns an error, and it has no On Error list. Always check ACK before you use the other fields.
  • Keep the credentials out of the action. The API password is a password field, but the signature isn't, and both are stored with the action. Use tokens, for example from a setting.
  • Don't show the whole JSON to users. It can include the payer's name, email and address.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Check whether a pending payment has completed​

These actions look up the transaction saved for an order, then mark the order as paid if PayPal says it's completed. The credentials come from tokens.

[
{
"Title": "Get Transaction Details",
"ActionType": "PayPal.GetTransactionDetails",
"Description": "Look up the order's PayPal transaction",
"Parameters": {
"PayPalExpressId": "[PayPalApiUser]",
"PayPalExpressPassword": "[PayPalApiPassword]",
"PayPalExpressSignature": "[PayPalApiSignature]",
"PayPalExpressLiveMode": true,
"TransactionId": "[PayPalTransactionId]",
"JsonToken": "PayPalTransactionJson"
}
},
{
"Title": "Parse JSON Into Tokens",
"ActionType": "ParseJsonIntoTokens",
"Description": "Read PayPal's answer",
"Parameters": {
"JsonString": "[PayPalTransactionJson]",
"BaseTokenName": "Txn"
}
},
{
"Title": "Run SQL Query",
"ActionType": "RunSql",
"Description": "Mark the order as paid",
"Condition": "[Txn:ACK] == \"Success\" && [Txn:PAYMENTSTATUS] == \"Completed\"",
"Parameters": {
"SqlQuery": "UPDATE Orders SET Status = 'Paid' WHERE OrderId = @OrderId",
"BindTokens": [
{
"name": "OrderId",
"value": "[OrderId]"
}
]
}
}
]

Revised 09/27/2026