REDA One Help Center
EN
Language
English EN Español ES Português PT Italiano coming soon Français FR Deutsch coming soon العربية coming soon
reda.one ↗
Home / REDA Pay / Connect to Payload / Set up webhooks so statuses update automatically

Set up webhooks so statuses update automatically

A webhook is a message one system sends to another when something happens. Payload sends one to Salesforce when a payment is processed, declined, refunded, voided or rejected, and when money is deposited to or withdrawn from your bank account. REDA Pay receives these messages and updates the matching Pay Transaction, or creates a Statement Activity for a deposit. Without webhooks, a payment that is accepted today and rejected by the bank three days later stays "processed" in Salesforce until someone presses Sync Transaction by hand.

Setting this up has six parts: a public address in Salesforce that Payload can reach, access for the guest user behind that address, the address on the Pay Profile, access for the Salesforce user that processes the messages, on Payload API v2 a signing secret, and the Setup Webhooks button that registers the address with Payload. Nothing here needs code.

Before you start
  • The Pay Profile is active with its API key stored — see Sync processing accounts and activate the profile.
  • You know the profile's Payload API Version (blank or v1, or v2) — see Choose the Payload API version. It changes Part 2 and Part 5.
  • You hold REDA Pay - Admin User and the Salesforce Customize Application permission (a System Administrator has it).
  • Read Part 6 before pressing Setup Webhooks on a v1 profile: it removes every webhook registered under your Payload API key.

How the pieces fit

Payload ──(webhook message)──▶ your public Salesforce site ──▶ REDA Pay ──▶ Pay Transaction updated
                               /services/apexrest/rpay/…        (processed by the Automated Process user)

Payload needs an address it can call without logging in. In Salesforce that is a Site — a public web address belonging to your org, used here only as a mailbox for Payload's messages. REDA Pay tells Payload the full address; you only provide the site's base address. The full address ends in /services/apexrest/rpay/payload/<Pay Profile Id> for a v1 profile and /services/apexrest/rpay/payloadv2/<Pay Profile Id> for a v2 profile.

Part 1 — Create the public site

If your org already has a Salesforce Site used for integrations, you can reuse it; skip to Part 2. Otherwise:

  1. Open Setup, type Sites in the Quick Find box, and click Sites (under User Interface → Sites and Domains).
  2. If you have never created a site, register a domain first: enter a name in the domain box, click Check Availability, accept the terms and click Register My Salesforce Site Domain. The domain looks like yourcompany.my.salesforce-sites.com.
  3. Click New.
  4. Fill in: Site Label (for example Payment Callbacks), Site Name (filled automatically), Default Web Address (a short path such as rpay — this becomes part of the address), and Active Site Home Page: click the lookup and choose any page, for example UnderConstruction. Nobody will visit this page.
  5. Click Save, then Activate.

Write down the site's full address as shown in Site URL, for example https://yourcompany.my.salesforce-sites.com/rpay.

The Site Detail page of the payment-callback site (named REDA Payload in this example org): Site Label and Site Name, Active ticked, Login Not Allowed, the home pages, and the Public Access Settings button
The Site Detail page of the payment-callback site (named REDA Payload in this example org): Site Label and Site Name, Active ticked, Login Not Allowed, the home pages, and the Public Access Settings button

A site used only for webhooks. Its Site URL is what goes on the Pay Profile.

Part 2 — Give the site's guest user access

Every site has a guest user, the identity Salesforce uses for visitors who are not logged in. Payload's messages arrive as that user, so it must be allowed to run the REDA Pay class that receives them — one class for v1 and one for v2. Enable both, so a later change of the profile's version needs no further step.

  1. On the site's detail page, click Public Access Settings. This opens the guest user's profile.
  2. Scroll to Enabled Apex Class Access (called Apex Class Access in the enhanced profile interface) and click Edit.
  3. Move rpay.PayloadCallback (v1) and rpay.PayloadCallbackV2 (v2) from Available to Enabled, and click Save. The guest user needs nothing else: these classes only pass the message on to REDA Pay.
The Apex Class Access section of the site guest user profile (enhanced profile interface) listing rpay.PayloadCallback
The Apex Class Access section of the site guest user profile (enhanced profile interface) listing rpay.PayloadCallback

The guest user needs exactly these classes enabled: rpay.PayloadCallback for v1 and rpay.PayloadCallbackV2 for v2. If your org upgraded from an earlier REDA Pay version, the v2 class is not enabled until you add it here.

Part 3 — Put the site address on the Pay Profile

  1. Open the REDA Pay app → Pay Profiles → your profile → Edit.
  2. In Webhook API Base URL, paste the site's address from Part 1, including https:// and the path, for example https://yourcompany.my.salesforce-sites.com/rpay.
  3. Save.

REDA Pay appends the rest of the address itself, and chooses the v1 or v2 ending from the profile's Payload API Version. You never type the full webhook address.

Part 4 — Give the Automated Process user access

When a message arrives, Salesforce hands it to a built-in system user called Automated Process to do the work: read the message, find the Pay Transaction, ask Payload for its latest status and update the record. That user has no access to REDA Pay records until you give it some, and it does not appear in the normal Users list, so the access is granted with a short script.

  1. Open Setup → Permission Sets, open REDA Pay - Admin User, and click Clone. Name the copy REDA Pay - Automated Process and Save.
  2. Copy the clone's Id from its address bar (the 18-character value after /lightning/setup/PermSets/, or the 15 characters after id=).
  3. Open the Developer Console (gear icon → Developer Console), then Debug → Open Execute Anonymous Window, paste the line below with your Id, and click Execute:
insert new PermissionSetAssignment(
    AssigneeId = [SELECT Id FROM User WHERE Alias = 'autoproc' LIMIT 1].Id,
    PermissionSetId = '0PS000000000000AAA'   // the Id of your REDA Pay - Automated Process permission set
);

The window reports success. If it reports that the assignment already exists, the step was done before.

Part 5 — Set the webhook signing secret (v2)

On a v2 profile, Payload can sign every message it sends with a secret you choose, and REDA Pay then rejects any message whose signature does not match. It is optional — a v2 profile without a secret accepts messages without a signature check — but recommended for production.

  1. Choose a secret of up to 64 characters (letters, digits and punctuation). Keep it somewhere safe outside Salesforce; it is never shown again.
  2. On the Pay Profile, click Update Webhook Secret. The dialog Update Webhook Secret opens with one box, Webhook Signing Secret, and, behind its ⓘ icon, the help text "Up to 64 characters. Payload signs every webhook delivery with it. Run Setup Webhooks after saving."
  3. Paste the secret and click Update Secret. The message "Webhook signing secret updated successfully. Run Setup Webhooks to apply it." confirms it, and the Webhook Signing Secret field on the record now holds an encrypted value.
  4. Continue with Part 6: the secret reaches Payload only when the webhooks are registered.

Never type the secret into the Webhook Signing Secret field with Edit: the action is what encrypts it, and a value typed directly does not match what Payload signs with. A v1 profile ignores the field.

The Update Webhook Secret dialog on a Pay Profile: the Webhook Signing Secret box, its help text, and the Update Secret and Close buttons
The Update Webhook Secret dialog on a Pay Profile: the Webhook Signing Secret box, its help text, and the Update Secret and Close buttons

The secret is set here and nowhere else. Run Setup Webhooks afterwards.

Part 6 — Register the webhooks with Payload

⚠️ On a v1 profile, Setup Webhooks first deletes every webhook registered under your Payload API key, then creates REDA Pay's. If the same API key is used by another system — another Salesforce org, a website, an accounting integration — that system's webhooks are removed and it stops receiving Payload's messages. Use a separate Payload API key per system, or re-register the other system's webhooks afterwards. On a v2 profile, Setup Webhooks removes only the webhooks it registered for this profile and leaves other systems alone.

  1. On the Pay Profile, click Setup Webhooks.
  2. Read the dialog: "System will delete all the existng webhooks and create new webhook setup."
  3. Click Setup Webhooks. Wait for "Webhook setup created successfully." and close the dialog.
  4. Open the profile's Webhook Setup tab. It lists one Pay Profile Webhook record per event, each with the Webhook Id Payload assigned and the Webhook URL REDA Pay registered. Webhook Setup Datetime [Payload] on the profile is filled.
Profile versionRows on the Webhook Setup tabEventsWebhook URL ends in
v1 (or blank)Tenpayment, processed, authorized, credit, refund, reversal, void, decline, deposit, reject/services/apexrest/rpay/payload/<Pay Profile Id>
v2Elevenpayment, processed, authorized, payout, refund, withdraw, reversal, void, decline, deposit, reject/services/apexrest/rpay/payloadv2/<Pay Profile Id>
The Webhook Setup tab of a Pay Profile listing ten Pay Profile Webhooks — payment, processed, authorized, credit, refund, reversal, void, decline, deposit, reject — with their Webhook Id and Webhook URL columns
The Webhook Setup tab of a Pay Profile listing ten Pay Profile Webhooks — payment, processed, authorized, credit, refund, reversal, void, decline, deposit, reject — with their Webhook Id and Webhook URL columns

A v1 profile: ten webhooks, one per Payload event. A v2 profile lists eleven. If fewer appear, the registration failed part-way: fix the cause and run Setup Webhooks again.

The Webhook Setup tab of a v2 Pay Profile listing eleven Pay Profile Webhooks whose Webhook URL contains /payloadv2/
The Webhook Setup tab of a v2 Pay Profile listing eleven Pay Profile Webhooks whose Webhook URL contains /payloadv2/

The same tab on a v2 profile: eleven rows, and the address contains /payloadv2/.

Run Setup Webhooks again whenever you change the Webhook API Base URL, replace the API key, change the Payload API Version, or set a new signing secret.

Check that it works

Take a small test payment (see Take a payment) and open its Pay Transaction. Within a few minutes the Status, Status Code and Funding Status fields update without anyone pressing Sync Transaction. For a bank payment, the funding status moves from pending to batched when Payload batches it, and a deposit to your bank account later creates a Statement Activity — see Reconcile deposits and payouts.

If nothing updates, check in this order:

CheckWhereWhat to look for
The site is activeSetup → SitesStatus Active
Guest user has the class for the profile's versionSite → Public Access Settings → Enabled Apex Class Accessrpay.PayloadCallback (v1) and rpay.PayloadCallbackV2 (v2) enabled
Base URL matches the sitePay Profile → Webhook API Base URLSame scheme, domain and path as the Site URL, nothing added
Webhooks exist at Payload for the right versionPay Profile → Webhook Setup tabTen (v1) or eleven (v2) records with Webhook Ids; the URL ends in /payload/ or /payloadv2/ to match the profile's version
The signing secret matchesPay Profile → Update Webhook Secret, then Setup WebhooksIf the secret was changed without re-registering, messages are rejected: set it again and run Setup Webhooks
Messages are being processedREDA Pay app → REDA Pay Logs → Attention NeededA log naming a sync or statement process with an error
Automated Process has accessPart 4Re-run the script; if it reports the assignment exists, access is in place

What the messages contain

A message tells REDA Pay only which transaction changed. REDA Pay then asks Payload for that transaction's current state and stores the answer, so the record always reflects Payload, not the message. Messages about transactions Salesforce has never seen are ignored. Deposit and withdrawal messages create or refresh a Statement Activity. On v2, a message whose signature does not match the profile's secret is refused before any of this happens.

Mistakes to avoid

MistakeWhat happensFix
Pressing Setup Webhooks on a v1 profile whose API key is shared with another systemThe other system stops receiving Payload's messagesUse one API key per system, or re-register the other system's webhooks
Base URL that is not the site address — a page path added, or the full callback address pasted inREDA Pay appends its own path to whatever you enter, so the registered address is wrong and messages never arriveEnter only the site address, exactly as shown in Site URL
Guest user without the class for the profile's versionPayload's messages are rejected; statuses never updateEnable rpay.PayloadCallback and rpay.PayloadCallbackV2 on the guest profile
Switching the profile to v2 without running Setup WebhooksPayload keeps posting to the v1 addressRun Setup Webhooks after changing the version
Typing the signing secret into the field instead of using the actionThe stored value does not match Payload's; v2 messages are refusedUse Update Webhook Secret, then Setup Webhooks
Skipping Part 4Messages arrive but the update fails; a REDA Pay Log may show the errorAssign the cloned permission set to the Automated Process user
Changing the API key and not re-registeringWebhooks stay registered under the old keyRun Setup Webhooks again

FAQ

Any active Salesforce site address works, as long as its guest user has the classes enabled. A dedicated site keeps the integration's guest user separate from your portal's.

It contains your site domain and the Pay Profile's record Id, nothing more. Messages only name a transaction; REDA Pay re-reads the transaction from Payload before changing anything, and on v2 it checks the signature first.

Payments are recorded without them. Webhooks keep the records current afterwards — declines, rejections, refunds made outside Salesforce, deposits — so every production org should have them.

On v1, no: Setup Webhooks on either profile removes the other's webhooks, so only the profile that registered last receives messages. On v2 each profile keeps its own set. Prefer one API key per profile.

Where to go next