Apex Reference Guide
Summer '26 (API version 67.0)
Spring '26 (API version 66.0)
Winter '26 (API version 65.0)
Summer '25 (API version 64.0)
Spring '25 (API version 63.0)
Winter '25 (API version 62.0)
Summer '24 (API version 61.0)
Spring '24 (API version 60.0)
Winter '24 (API version 59.0)
Summer '23 (API version 58.0)
Spring '23 (API version 57.0)
Winter '23 (API version 56.0)
Summer '22 (API version 55.0)
Spring '22 (API version 54.0)
Winter '22 (API version 53.0)
Summer '21 (API version 52.0)
Release Notes
CommerceOrders Namespace
AccountType Enum
AccountHolderType Enum
BankType Enum
CardCategory Enum
CardType Enum
NotificationStatus Enum
PaymentMethodIdType Enum
RequestType Enum
RetryCategory Enum
RetryDecision Enum
SalesforceResultCode Enum
StandardEntryClassCode Enum
ComplianceMgmt Namespace
Context Namespace
DataRetrieval Namespace
ExternalService Namespace
Flowtesting Namespace
IssueCreditMemo Namespace
ind_mfg_sample_mgmt_apex Namespace
IndustriesDigitalLending Namespace
InvoiceWriteOff Namespace
PlaceQuote Namespace
renew_assets_summary Namespace
RevSignaling Namespace
RevSalesTrxn Namespace
RulesAppln Namespace
runtime_industries_cpq Namespace
runtime_industries_insurance Namespace
Slack Namespace
CommercePayments Namespace
Use the CommercePayments namespace to provide a
safe and customizable platform for managing customer payments and refunds.
To review CommercePayments use cases and walkthroughs, go to Use Cases for the CommercePayments Namespace.
The following are the classes in the CommercePayments namespace.
-
AbstractResponse Class
Contains the normalized response fields from payment gateways that are common to all the other gateway responses. -
AbstractTransactionResponse Class
Abstract class for storing normalized information sent from payment gateways about a payment transaction. Holds the common response fields sent from payment gateways for authorization, sale, capture, and refund transactions. -
AccountType Enum
Specifies the account type. -
AccountHolderType Enum
Specifies the type of the account holder. -
AddressRequest Class
Contains address request data that is sent to a gateway adapter during a service call. -
AlternativePaymentMethodRequest Class
The class contains information about the alternative payment method that are required for a gateway to process the request. -
AlternativePaymentMethodResponse Class
The class contains the response details of the alternative payment method. -
AuditParamsRequest
AuditParamsRequest is used for audit parameters in a transaction request. This is an abstract request class that is extended by the BaseRequest class. -
AuthApiPaymentMethodRequest Class
Sends information about a payment method to a gateway adapter during an authorization service call. -
AuthorizationRequest Class
Sends information about an authorization request to a gateway adapter during a service call. This class extends the BaseRequest class and inherits all its methods. -
AuthorizationResponse Class
Response sent by the payment gateway adapter for an authorization service. -
AuthorizationReversalRequest Class
Sends information about an authorization reversal request to a gateway adapter during a service call. -
AuthorizationReversalResponse Class
Response sent by the payment gateway following a payment authorization reversal service. -
BankType Enum
Specifies the bank type. -
BankPaymentMethodRequest Class
Sends data related to a bank payment method to a gateway adapter during a service call. -
BankPaymentMethodResponse Class
This class contains information about the bank payment method response. The gateway adapter reads the gateway response and generates a BankPaymentMethodResponse, populating the required fields to create a bank payment method. -
BaseApiPaymentMethodRequest Class
Abstract class used to send information about a payment method to a gateway adapter during a service call. -
BaseNotification Class
Abstract class for storing notification information sent from payment gateways. -
BasePaymentMethodRequest Class
Abstract class for storing information about payment methods. -
BaseRequest Class
BaseRequest is extended by all the request classes. -
CaptureNotification Class
When a payment gateway sends a notification for a capture transaction, the payment gateway adapter creates the CaptureNotification object to store information about the notification. -
CaptureRequest Class
Represents a capture request. This class extends the BaseRequest class and inherits all its methods. -
CaptureResponse Class
The payment gateway adapter sends this response for the capture request type. This class extends AbstractResponse and inherits its methods. -
CardCategory Enum
Defines whether the payment method represents a credit card or a debit card. -
CardPaymentMethodRequest Class
Sends data related to a card payment method to a gateway adapter during a service call. -
CardPaymentMethodResponse Class
This class contains details about the card payment method. -
CardType Enum
Specifies the credit card issuer. -
CustomMetadataTypeInfo Class
Access information about custom metadata. The PaymentGatewayAdapter can send CustomMetadataTypeInfo to transaction requests through the response object’s SalesforceResultCodeInfo. -
EnhancedPaymentDataInput Class
Sends enhanced payment data, including Level 2 and Level 3 fields, to the gateway adapter as part of the service call. -
GatewayErrorResponse Class
Use to respond with an error indication following errors from the PaymentGateway adapter, such as request-forbidden responses, custom validation errors, or expired API tokens. -
GatewayNotificationResponse Class
When the payment gateway sends a notification to the payments platform, the platform responds with a GatewayNotificationResponse indicating whether the platform succeeded or failed at receiving the notification. -
GatewayResponse Interface
Generic payment gateway response interface. This class extends the CaptureResponse, AbstractTransactionResponse, and AbstractResponse classes and inherits all their properties. It has no unique methods or parameters. -
NotificationClient Class
Communicates with the payment platform regarding the gateway’s notification. -
NotificationSaveResult Class
Contains the result of the payment platform’s attempt to record data from the gateway’s notification. -
NotificationStatus Enum
Shows whether the payments platform successfully received the notification from the gateway. -
PaymentGatewayAdapter Interface
PaymentGatewayAdapters can implement this interface in order to process requests. -
PaymentGatewayAsyncAdapter Interface
Implement the interface to allow customers to process payments asynchronously. -
PaymentGatewayContext Class
Wraps the information related to a payment request. -
PaymentGatewayNotificationContext Class
Wraps the information related to a gateway notification. -
PaymentGatewayNotificationRequest Class
Contains the notification request data from the gateway. -
PaymentMethodDetailsResponse Class
This class contains the details about the payment method. -
LineItemInput Class
Sends the list of individual line items associated with the payment to the gateway adapter. -
PaymentMethodIdType Enum
Specifies the ID of the payment method type. -
PaymentMethodTokenizationRequest Class
Stores data about a request to tokenize a card payment method. The tokenization process occurs in the payment gateway. This process replaces sensitive customer data, such as a card number or CVV, with unique identification symbols. The symbols are used while the data is handled by Salesforce, the payment gateway, and the customer bank, allowing Salesforce to store the token without storing sensitive customer data. -
PaymentMethodTokenizationResponse Class
Gateway response sent by payment gateway adapters for the payment method tokenization request. The response includes the payment method’s token ID value. -
PaymentsHttp Class
Makes an HTTP request to start the interaction with the payment gateway. -
PostAuthApiPaymentMethodRequest Class
Sends information about a payment method to a gateway adapter during a postauthorization service call. -
PostAuthorizationRequest Class
Sends information about a postauthorization request to a gateway adapter during a service call. -
PostAuthorizationResponse Class
Response sent by the payment gateway adapter for a postauthorization service. -
ReferencedRefundNotification Class
When a payment gateway sends a notification for a refund transaction, the payment gateway adapter creates the ReferencedRefundNotification object to store information about notification. -
ReferencedRefundRequest
Access information about the referenced refund requests. Extends the RefundRequest class. -
ReferencedRefundResponse Class
The payment gateway adapter sends this response for the ReferencedRefund request type. -
RefundRequest Class
Sends data related to a refund to the payment gateway adapter. -
RequestType Enum
Defines the type of payment transaction request made to the payment gateway. -
RetryCategory Enum
Specifies the retry category. -
RetryDecision Enum
Specifies the retry decision. -
SaleApiPaymentMethodRequest Class
Sends data related to a card payment method to a gateway adapter during a sale service call. -
SaleNotification Class
When a payment gateway sends a notification for a sale payment, the payment gateway adapter creates the SaleNotification object to store information about notification. -
SaleRequest Class
Stores information about a sales request. -
SaleResponse Class
Response sent by payment gateway adapters for a sales service. -
SalesforceResultCode Enum
Defines the gateway call status values in Salesforce based on the call status values that the payment gateway returned. -
SalesforceResultCodeInfo
Stores Salesforce result code information from payment gateway adapters. -
StandardEntryClassCode Enum
Specifies the three-letter code that identifies the type of electronic payment transaction being processed within the Automated Clearing House (ACH) network. -
TokenizeNotification Class
When a payment gateway sends a notification for a payment method tokenization, the payment gateway adapter creates the TokenizeNotification object to store information about notification.