Payment Sale Action

Capture a payment without any prior authorization and create a payment record. The payment sale transaction consists of an authorize request and a capture request made to the payment gateway at the same time. This way, the merchant can request funds to be transferred to the merchant account in a single command, with no further action required.

To access Commerce Payments resources, you need the following permissions: Salesforce Order Management License or Salesforce B2B Commerce License, and PaymentsAPIUser user permission. This permission is available with the Salesforce Order Management or B2B Commerce License. Your Salesforce admin assigns it to your user profile.

The payment sale API handles only one payment at a time. Bulk requests aren’t supported.

This object is available in API version 54.0 and later.

Supported REST HTTP Methods 

URI: /services/data/v54.0/actions/standard/paymentSale

Formats: JSON

HTTP Methods: POST

Authentication: Authorization: Bearer token

Inputs 

InputTypeDescription
amountnumberRequired. The amount of the payment sale request.
paymentGatewayIdIDRequired. The ID of the Salesforce payment gateway record that represents the external payment gateway used for processing the sale request.
paymentMethodIdIDRequired. The ID of the Salesforce payment method that contains customer payment information.
currencyIsoCodestringRequired for multicurrency orgs. Three-letter ISO 4217 currency code associated with the payment output.
idempotencyKeystringOptional. Key used to ensure idempotency and avoid duplicate payments.

Outputs 

OutputTypeDescription
actionNamestringThe name of the action performed. Becomes paymentSale following a Payment Sale action.
errorsstringFollowing a 400 error response, the error objects show information about the error that occurred. Contains a status code, message, and list of fields.
isSuccessbooleanShows whether the payment sale request was successful.
outputValuesIDThe ID of the new payment request record.