For the complete documentation index, see llms.txt. This page is also available as Markdown.

Risk Context

The Risk Context endpoint allows you to provide PayPal with session-level fraud signals before a transaction is submitted. This data is used by PayPal's fraud evaluation systems to assess transaction risk and can improve authorisation rates.

Set the risk context before calling POST /transactions or POST /transactions/{id}/authorize to ensure the fraud signals are associated with the payment.

How It Works

1

Collect client-side signals

Gather the PayPal fraud session ID from the PayPal JavaScript SDK on the checkout page. This is typically available as a value from the PayPal client-side library.

2

Submit the risk context

Call POST /transactions/risk/context with the collected fraud signals. You receive a context token in the response.

3

Include the fraud ID in the transaction

Pass the fraud ID as the paypalFraudId header when calling POST /transactions or POST /transactions/{id}/authorize.

Set Transaction Context

Set transaction context

post
/transactions/risk/context
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
paymentProviderContractstringRequired

Payment Provider contract

trackingIdstringOptional

A unique ID to track each transaction

dataobjectOptional
Responses
200

Successful

application/json
trackingIdstringRequired

A unique ID to track each transaction

post
/transactions/risk/context

Using the paypalFraudId Header

The paypalFraudId header is accepted on the following endpoints:

  • POST /transactions — Create Transaction

  • POST /transactions/{id}/authorize — Authorize Transaction

Pass the GUID value returned from the risk context response as paypalFraudId in those requests.

Was this helpful?