Skip to main content

Setup & Configuration

1. Confido Settings (Custom Setting)

Settings__c — Hierarchy Custom Setting. Configure at Setup → Custom Settings → Confido Settings → Manage.
FieldAPI NameDescription
Confido API TokenApiToken__cYour Confido API key. Required for all API calls.
Confido Webhook SecretWebhookSecret__cHMAC secret for verifying incoming webhooks.
Production EnvironmentProductionEnvironment__cCheckbox. Checked = api.gravity-legal.com; unchecked = api.sandbox.gravity-legal.com.

2. Remote Site Settings

Pre-configured; both active by default:
  • productionhttps://api.gravity-legal.com
  • sandboxhttps://api.sandbox.gravity-legal.com

3. Webhook Configuration

Point your Confido webhook to:
https://<your-salesforce-domain>/services/apexrest/confido_core/webhook
The endpoint verifies the X-SIGNATURE header using HMAC-SHA512 with your WebhookSecret__c. Must be exposed via a Salesforce Site or Community (public REST resource).

4. Sync Bank Accounts

Bank accounts are managed in Confido, not Salesforce. Sync them before creating payment links using the LWC button or the invocable action.

Client__c

FieldDescription
NameClient name (synced to Confido)
ConfidoId__cText(36), unique external ID, auto-populated
SyncErrorMessage__cLong Text, populated if last sync failed

Matter__c

FieldDescription
NameMatter name
Client__cLookup → Client__c
ConfidoId__cText(36), unique
SyncErrorMessage__cLong Text
FieldDescription
NameDescriptive name
BankAccount__cLookup → BankAccount__c (destination)
Client__cLookup → Client__c
Matter__cLookup → Matter__c (optional)
ConfidoId__cText(36), unique
OutstandingAmount__cCurrency, amount still owed
PaidAmount__cCurrency, amount paid so far
Status__cPicklist: unpaid, partially_paid, paid, sealed
Url__cURL, the shareable payment link
SyncErrorMessage__cLong Text

Transaction__c (auto-created via webhooks)

FieldDescription
Amount__cCurrency
AmountRefunded__cCurrency
BankAccount__cLookup → BankAccount__c
Client__cLookup → Client__c
Matter__cLookup → Matter__c
PaymentLink__cLookup → PaymentLink__c
ConfidoId__cText(36), unique
CreatedOn__cDateTime
ErrorMessage__cText(255)
LastFour__cText(255), last 4 of payment method
Method__cPicklist: ACH, CARD, CREDIT, DEBIT, MANUAL, PUSH_TO_CARD
PayerEmail__cEmail
PayerName__cText(255)
Status__cPicklist: PENDING, SUCCESSFUL, DEPOSITED, FUNDS_IN_TRANSIT, REFUNDED, PARTIALLY_REFUNDED, RETURNED, VOIDED, ERROR, CHARGED_BACK, HELD
Type__cText(255), e.g. payment, refund, return

BankAccount__c (read-only from Confido)

FieldDescription
NameNickname
Category__coperating or trust
ConfidoId__cText(36), unique
IsDefault__cCheckbox
LastFour__cText(255)
FieldDescription
NameDescriptive name
ConfidoId__cText(36), unique
PaymentLinkIds__cLong Text, comma-separated SF IDs
Url__cURL
SyncErrorMessage__cLong Text
Junction object (Master-Detail on both sides), managed automatically.

Platform Events

WebhookPayload__e and TransactionPayload__e — used internally for async webhook processing.

Invocable Flow Actions

All available in Flow Builder under Action elements. They create/update both the Salesforce record and the corresponding Confido record.

Create Client (ClientCreate)

  • Input: name (String, required)
  • Returns: List<Client__c>

Update Client (ClientUpdate)

  • Input: clientId (String, required), name (String, optional)
  • Returns: List<Client__c>

Create Matter (MatterCreate)

  • Input: clientId (String, required), name (String, required)
  • Returns: List<Matter__c>

Update Matter (MatterUpdate)

  • Input: matterId (String, required), name (String, required)
  • Returns: List<Matter__c>
  • Input: amount (Decimal, required), bankAccountId (String, required), clientId (String, required), matterId (String, optional), paymentLinkName (String, optional)
  • Returns: List<PaymentLink__c>
  • Input: paymentLinkId (String, required), amount (Decimal), bankAccountId (String), clientId (String), matterId (String) — all optional except ID
  • Returns: List<PaymentLink__c>
  • Input: paymentLinkIds (List<String>, required), aggregateLinkName (String, optional)
  • Returns: List<AggregateLink__c>
  • Input: aggregateLinkId (String, required), paymentLinkIds (List<String>, required — pass empty to delete)
  • Returns: List<AggregateLink__c>

Sync Bank Accounts (BankAccountsSync)

  • Input: None
  • Fetches all bank accounts from Confido and upserts/deletes BankAccount__c records to match.

Lightning Web Components

All exposed to App Pages, Home Pages, and Flow Screens.
ComponentDescription
confidoSettingsSettings card
confidoClientCreateClient creation form (Client Name)
confidoMatterCreateMatter creation form (Client picker + Matter Name)
confidoPaymentLinkCreateFull payment link form (Name, Bank Account, Client, Matter, Amount). Displays resulting URL.
confidoAggregateLinkCreateAggregate link from multiple payment links (multi-select with pill container)
confidoAggregateLinkUpdateUpdate an aggregate link’s payment links
confidoBankAccountsSync”Sync Bank Accounts” button, shows count of synced accounts
confidoTransactionsListRead-only table of 10 most recent transactions

Webhooks & Automatic Transaction Sync

Flow

Confido webhook
  → WebhookListener (HMAC verify)
  → WebhookPayload__e
  → Handler fetches full transaction from API
  → TransactionPayload__e
  → Upserts Transaction__c + auto-creates related Client/Matter/PaymentLink if needed

Supported Events

EventBehavior
transaction.createdCreates/updates the transaction
transaction.depositedUpdates status
transaction.funds_in_transitUpdates status
transaction.ach_returnedUpdates original + creates return txn
transaction.refundedUpdates original + creates refund txn
transaction.partially_refundedUpdates original + creates refund txn
transaction.voidedUpdates status
Note: Payout-type transactions and zero-amount transactions (e.g., trust surcharging) are auto-skipped.

Trigger Sync Behavior

ObjectBehavior
Client__cAfter Insert/Update: auto-syncs to Confido if no ConfidoId or Name changed
Matter__cAfter Insert/Update: same pattern
PaymentLink__cAfter Insert/Update: syncs if no ConfidoId or amount/bank/client/matter changed. Before/After Delete: removes from aggregate links then from Confido
AggregateLink__cAfter Insert/Update: syncs + re-creates junction records
Sync errors are stored in SyncErrorMessage__c and cleared on the next successful sync.

Quick Start Checklist

  1. ☐ Install confido_core package
  2. ☐ Set API Token in Custom Settings
  3. ☐ Set Webhook Secret in Custom Settings
  4. ☐ Check/uncheck Production Environment
  5. ☐ Verify Remote Site Settings are active
  6. ☐ Configure webhook URL in Confido
  7. ☐ Expose /webhook endpoint via SF Site or Experience Cloud
  8. ☐ Run Sync Bank Accounts
  9. ☐ Create first Client, Matter, and Payment Link
  10. ☐ Verify transactions flow in via webhooks

Dependencies