Payment APIs

B2B and D2C Commerce implements a group of payment APIs to support tokenizing shopper credit cards without storing that information natively.

Required Editions
Available in: Enterprise, Unlimited, and Developer Editions
Available in: B2B Commerce and D2C Commerce

Shopper actions trigger payment API calls to a third-party service provider via the Payment Adapter framework. The APIs support tokenizing shopper credit cards so that no personal information is stored natively. Together with the licensed Salesforce Order Management (SOM) or 1C OM, the Payment Adapter framework exposes additional APIs. SOM manages the capture and refund flows and provides an integrated customer order lifecycle, including fulfillment and service.

These APIs initiate payments processing.

  • SetPaymentMethod tokenizes the shopper’s credit card and returns a token.
  • PlaceOrder (returns Auth Code) validates the cart, reserves inventory, converts cart to order, authorizes payment, and activates the order in SOM. The payment authorization reserves funds from the available credit of the credit card, but it’s not a payment. To the shopper, it can display as pending.

After the transaction is tokenized and the order placed, any of these APIs and corresponding transactions can occur.

Diagram summarizing API calls

  • Authorization reversals release the funds reserved by the payment authorization, removing them from pending transactions.
  • Capture consumes the funds reserved by the payment authorization.
  • Sale is a transaction type where Authorization and Capture are executed as part of a single request. If successful, the order is fulfilled immediately.
  • Void cancels the transfer of funds to the merchant account before settlement. When a payment is processed, funds are held. The balance is deducted from the customer’s credit limit, but not yet transferred to the merchant account. At a later point, all transactions are batched for settlement, and the funds are transferred to the merchant’s account. A transaction can be voided after purchase but before settlement.
  • Refund is a transaction request that transfers the amount from the merchant’s account to the customer’s account.

In addition, A PostAuth API is required for client-side payment component implementations. The gateway adapter reads fields from the PostAuth Request class to validate the client-side transaction with the payment gateway. For more on the PostAuth objects, see PostAuthorizationRequest Class

For more information on the other payment APIs, see Commerce Connect REST Payment APIs.