The /PaymentIntent
endpoint supports handling both one-time and recurring payments. For recurring payments, a Recurring block replaces, or is
added alongside, the OneTime block in the request. Some Payment Service Providers (PSPs) require or optionally support an initial payment
(a OneTime block) AND recurring payment in the same request for authorization. You can find out the initial payment details for a given PSP
using GET /PaymentMethods
. Please see the specific payment processor articles for further details.
When using the endpoint to initiate new payments, check the org configuration and make sure you have the correct details by querying the Payment Method and Source Connectors endpoints. Some payment methods enable or require further Package Actions. Be sure to also include these in the payment intent request.
In addition to setting up new one-time or recurring payments, you can pay existing one-time payments (installments) and update existing recurring payments.
To pay an existing installment, simply exclude the Payer block and add the Id of the installment to the OneTime block. We recommend first checking the
details of the installment using GET /Installment
with the GUID or record Id.
To update the payment method, processor or other details of a recurring payment, remove the Payer block and add the identifier of the recurring payment
to the Recurring block along with a PaymentMethod block that includes the details to be changed. As with installments, we recommend first checking current
details by using GET /Recurring
with the GUID or record Id.
The endpoint also supports checking the status of payment intent inbound report processing. Use GET /PaymentIntent/{ID}
where ID is payment intent Id
of the one-time or recurring payment.
The schema below presents the entire scope of supported Payment Intent data. Please refer to the POST operation request body object schemas for details on what is required for specific operations.
SuccessURL
string
The URL the payer is redirected to when a payment has been completed successfully.
FailureURL
string
The URL the user is redirected to when a payment has failed or was cancelled.
RedirectURL
string
The URL where the user should be redirected to so additional information can be provided to complete the payment. This is primarily used for hosted payment forms of PSPs.
WebhookURL
string
URL where you want to receive webhook notifications about the status of the payment.
Origin
string
The channel used to create the payment intent, such as a payment form on a webpage. This information can be used when building customized follow-up logic in Salesforce.
CampaignId
string
Id of a Campaign record in Salesforce. When a valid value is passed, the campaign is linked to the installment or recurring payment object in Salesforce."
Payer
Any Of
Information about the payer captured in a new or existing Account and/or Contact record.
Must match one of
OneTime
object
Details for a new one-time payment. If paying an existing one-time payment (installment), only Id is needed.
Recurring
object
The recurring block contains details for creating a new recurring payment or updated an existing one based on an Id.
PaymentMethod
object
The payment processing details for the one-time payment.
Settings
object
Additional information on how the payment should be processed in Salesforce. Includes the source connector and additional parameters
like ProcessingType
that can be used for Guided Matching.
SalesforceFields
object
The SalesforceFields block is used to pass Salesforce fields and values that have been created on the object in Salesforce. To find out which fields are available, check the Object Manager in the Salesforce Setup.
PackageActions
object
Additional, package-specific actions to be performed with the payment intent.
/PaymentIntent
The /PaymentIntent
endpoint supports four POST operations: (1) create a new one-time payment, (2) create a new recurring payment, (3) pay an existing installment, and (4) update
an existing recurring payment. All actions automatically update Salesforce data accordingly.
Must match one of
SuccessURL
string
required
The URL the payer is redirected to when a payment has been completed successfully.
FailureURL
string
required
The URL the user is redirected to when a payment has failed or was cancelled.
RedirectURL
string
The URL where the user should be redirected to so additional information can be provided to complete the payment. This is primarily used for hosted payment forms of PSPs.
WebhookURL
string
URL where you want to receive webhook notifications about the status of the payment.
Origin
string
The channel used to create the payment intent, such as a payment form on a webpage. This information can be used when building customized follow-up logic in Salesforce.
CampaignId
string
Id of a Campaign record in Salesforce. When a valid value is passed, the campaign is linked to the installment or recurring payment object in Salesforce."
Payer
Any Of
required
Information about the payer captured in a new or existing Account and/or Contact record.
Must match one of
OneTime
object
required
Value of the payment in the given currency.
PaymentMethod
object
required
The payment processing details for the one-time payment.
Settings
object
Additional information on how the payment should be processed in Salesforce. Includes the source connector and additional parameters
like ProcessingType
that can be used for Guided Matching.
SalesforceFields
object
The SalesforceFields block is used to pass Salesforce fields and values that have been created on the object in Salesforce. To find out which fields are available, check the Object Manager in the Salesforce Setup.
PackageActions
object
Additional, package-specific actions to be performed with the payment intent.
{
"SuccessURL": "https://hostname/success",
"FailureURL": "https://hostname/failure",
"Payer": {
"Contact": {
"SalesforceFields": {
"FirstName": "Test",
"LastName": "Payer",
"Email": "test@findock.com",
"MailingStreet": "Any Street",
"MailingCity": "Any City",
"MailingPostalCode": "00000",
"MobilePhone": "0123456789"
}
}
},
"PaymentMethod": {
"Name": "DirectDebit",
"Parameters": {
"iban": "NL13TEST0123456789",
"holderName": "Test Payer"
}
},
"OneTime": {
"Amount": 50.0
}
}
API was called successfully.
{
"Id": "pi_1hubybk7nh45rvbt6",
"PaymentMethod": {
"Name": "CreditCard",
"Processor": "PaymentHub-Stripe",
"Target": "Stripe-Main",
"Parameters": null
},
"Settings": {
"SourceConnector": "PaymentHub-for-NPSP"
},
"RedirectURL": "https://redirect-hostname/checkout/payment-parameters"
}
/PaymentIntent/{ID}
Use this operation to get the status of the inbound report of a payment intent along with information about the related installment or recurring payment (Recurring Payment, Gift Commitment or Recurring Donation object record). To get details of the related records themselves, use the /Installment and /Recurring endpoints.
ID
string
required
The Id of the payment intent to check.
API was called successfully.
{
"Id": "pi_1hubybk7nh45rvbt6",
"Status": "Matched",
"Payer": {
"Contact": {
"Url": "/services/data/v63.0/sobjects/Contact/a0P3X00000WjR8AUAV",
"Type": "Contact",
"Id": "a0P3X00000WjR8AUAV",
"Name": "Test Payer"
},
"Account": {
"Url": "/services/data/v63.0/sobjects/Account/0011j00000itNdlAAE",
"Type": "Account",
"Id": "0011j00000itNdlAAE",
"Name": "Payer Family"
}
},
"OneTime": {
"Url": "/services/data/v63.0/sobjects/cpm__Installment__c/a083X00001aUMCnQAO",
"Type": "cpm__Installment__c",
"Id": "a083X00001aUMCnQAO",
"Status": "Collected"
}
}
Was this page helpful?