---
schema_version: "1"
id: 0c1f847c2b113b7c984755683a8f1a5c8b963cdee0313fd953c2a1bc13a94da1
title: Authorize Payment Action
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_ref_elements_om_actions_authorize_payment.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_om_actions_authorize_payment.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f932030c7722783cb318625b63c687a39730f04beb386868cc70f49169c1d02b
description: In Salesforce Order Management, authorize a payment on a credit card. You can include details for a new credit card or reference an existing payment method.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Authorize Payment Action

In Salesforce Order Management, authorize a payment on a credit card. You can include details for a new credit card or reference an existing payment method.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">This feature requires the Salesforce Order Management add-on. To purchase, contact your Salesforce account executive.</td></tr></tbody></table>

In Flow Builder, add an Action element to your flow. Select the **Order Management** category, and search for **Authorize Payment**. To access this action from REST API, use the name `authorizePayment`.

If you're using the Enterprise edition, we recommend disabling the RollbackOnErrApexIAp permission and the RollbackOnErrApexIA preference. If you keep them enabled, the entire authorization is rolled back if there are any errors. Contact Salesforce Customer Support to disable permissions or preferences.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_note.png)

Note This action is available with the PaymentsAPIUser user permission.

## Set Input Values

Use values from earlier in the flow to set the inputs.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:17.006802721088434%">
          <col style="width:82.99319727891157%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d309785e87">Input Parameter</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d309785e89">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Input Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d309785e87 "><strong class="uicontrol">Payment Authorization Request</strong></td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d309785e89 ">
              <p>This input is an Apex-defined variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_input_authorization.htm" target="_blank">ConnectApi.AuthorizationRequest</a>, which
                includes these fields:</p>
              <ul>
                <li><strong class="uicontrol">accountId</strong> —ID of the account that contains the
                  payment transaction being authorized.</li>
                <li><strong class="uicontrol">amount</strong> —Authorization amount.</li>
                <li><strong class="uicontrol">comments</strong> —(Optional) Comments for the payment
                  authorization.</li>
                <li><strong class="uicontrol">currencyIsoCode</strong> —Three-letter ISO 4217 currency code
                  associated with the payment group record.</li>
                <li><strong class="uicontrol">effectiveDate</strong> —Date that the authorization is applied to
                  the transaction.</li>
                <li><strong class="uicontrol">paymentGatewayId</strong> —Payment gateway that processes the
                  authorization.</li>
                <li><strong class="uicontrol">paymentGroup</strong> —(Optional) Payment group for the
                  authorization. The payload must reference either a paymentGroup or a
                  paymentGroupId, but not both. This field is an Apex-defined variable of class
                  <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_input_payment_group.htm" target="_blank">ConnectApi.PaymentGroupRequest</a>, which includes these fields:<ul>
                    <li><strong class="uicontrol">createPaymentGroup</strong>—(Optional) Specifies whether to
                      create a payment group (<kbd>true</kbd>) or not
                      (<kbd>false</kbd>).</li>
                    <li><strong class="uicontrol">currencyIsoCode</strong>—(Optional) Three-letter ISO 4217 currency code associated
                      with the payment group record.</li>
                    <li><strong class="uicontrol">id</strong>—(Optional) ID of the payment group record.</li>
                    <li><strong class="uicontrol">sourceObjectId</strong>—(Optional) Source object ID of the
                      payment group record. Supports only OrderId.</li>
                  </ul>
                </li>
                <li><strong class="uicontrol">paymentMethod</strong>—Payment method for the authorization. The payload must
                  either reference an existing payment method or include details for a new payment
                  method, but not both. This field is an Apex-defined variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_input_auth_api_payment_method.htm" target="_blank">ConnectApi.AuthApiPaymentMethodRequest</a>,
                  which includes these fields: <p>This input includes the fields from the parent
                    class, <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_input_base_api_payment_method.htm" target="_blank">ConnectApi.BaseApiPaymentMethodRequest</a>.</p>
                  <ul>
                    <li><strong class="uicontrol">address</strong>—Address for the payment method. This field
                      is an Apex-defined variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_input_address.htm" target="_blank">ConnectApi.AddressRequest</a>. It
                      includes these fields, all of which are optional:<ul>
                        <li><strong class="uicontrol">city</strong></li>

                        <li><strong class="uicontrol">companyName</strong></li>

                        <li><strong class="uicontrol">country</strong></li>

                        <li><strong class="uicontrol">postalCode</strong></li>

                        <li><strong class="uicontrol">state</strong></li>

                        <li><strong class="uicontrol">street</strong></li>

                      </ul>
                    </li>

                    <li><strong class="uicontrol">cardPaymentMethod</strong> —(Optional) When using a new
                      payment method, the details of that method. This field is an Apex-defined
                      variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_input_card_payment_method.htm" target="_blank">ConnectApi.CardPaymentMethodRequest</a>,
                      which includes these fields:<ul>
                        <li><strong class="uicontrol">accountId</strong>—Salesforce account to which this
                          payment method is linked.</li>

                        <li><strong class="uicontrol">cardCategory</strong> —Valid values are
                          <kbd>CreditCard</kbd> and
                          <kbd>DebitCard</kbd>.
                        </li>

                        <li><strong class="uicontrol">cardHolderFirstName</strong>—First name of the card
                          holder.</li>

                        <li><strong class="uicontrol">cardHolderLastName</strong>—Last name of the card
                          holder.</li>

                        <li><strong class="uicontrol">cardHolderName</strong>—Full name of the card
                          holder.</li>

                        <li><strong class="uicontrol">cardNumber</strong>—Card number.</li>

                        <li><strong class="uicontrol">cardType</strong>—Valid values are:<ul>
                            <li><kbd>AmericanExpress</kbd></li>

                            <li><kbd>DinersClub</kbd></li>

                            <li><kbd>JCB</kbd></li>

                            <li><kbd>Maestro</kbd></li>

                            <li><kbd>MasterCard</kbd></li>

                            <li><kbd>Visa</kbd></li>

                          </ul>
                        </li>

                        <li><strong class="uicontrol">comments</strong> —(Optional) Comments for the payment
                          method.</li>

                        <li><strong class="uicontrol">cvv</strong>—CVV.</li>

                        <li><strong class="uicontrol">email</strong>—Email of the card holder.</li>

                        <li><strong class="uicontrol">expiryMonth</strong>—Card expiration month.</li>

                        <li><strong class="uicontrol">expiryYear</strong>—Card expiration year.</li>

                        <li><strong class="uicontrol">nickName</strong>—(Optional) Nickname for the payment
                          method.</li>

                        <li><strong class="uicontrol">startMonth</strong>—(Optional) Start month of the
                          card.</li>

                        <li><strong class="uicontrol">startYear</strong>—(Optional) Start year of the
                          card.</li>

                      </ul>
                    </li>

                    <li><strong class="uicontrol">id</strong>—(Optional) When using an existing payment
                      method, the ID of that method.</li>

                    <li><strong class="uicontrol">saveForFuture</strong>—Whether to save the payment method
                      for future use.</li>

                  </ul>
                </li>
              </ul>
            </td>
          </tr>
        </tbody>
      </table>

## Store Output Values

Use output values later in the flow. The values are assigned when a response is received from the payment gateway.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:17.513134851138354%">
          <col style="width:82.48686514886164%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d309785e353">Output Parameter</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d309785e355">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Output Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d309785e353 "><strong class="uicontrol">Payment Authorization Response</strong></td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d309785e355 ">
              <p>This output is an Apex-defined variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_output_authorization_output.htm" target="_blank">ConnectApi.AuthorizationResponse</a>, which
                includes these fields:</p>
              <ul>
                <li><strong class="uicontrol">error</strong> —If an error is returned, details about that error.
                  This field is an Apex-defined variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_output_error_response.htm" target="_blank">ConnectApi.ErrorResponse</a>, which includes these fields:<ul>
                    <li><strong class="uicontrol">errorCode</strong>—Error code.</li>
                    <li><strong class="uicontrol">message</strong>—More detail, if available.</li>
                  </ul>
                </li>
                <li><strong class="uicontrol">gatewayResponse</strong> —Response from the payment gateway. This
                  field is an Apex-defined variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_output_authorization_gateway_response.htm" target="_blank">ConnectApi.AuthorizationGatewayResponse</a>, which includes this field:<ul>
                    <li><strong class="uicontrol">gatewayAuthorizationCode</strong>—Payment authorization
                      code.</li>
                  </ul>
                </li>
                <li><strong class="uicontrol">paymentAuthorization</strong> —Details about the payment
                  authorization. This field is an Apex-defined variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_output_payment_authorization_output.htm" target="_blank">ConnectApi.PaymentAuthorizationResponse</a>, which includes these fields:<ul>
                    <li><strong class="uicontrol">accountId</strong> —ID of the account that contains the
                      payment transaction being authorized.</li>
                    <li><strong class="uicontrol">amount</strong> —Amount that the gateway authorized for the
                      payment transaction.</li>
                    <li><strong class="uicontrol">currencyIsoCode</strong> —Three-letter ISO 4217 currency code
                      associated with the payment group record.</li>
                    <li><strong class="uicontrol">effectiveDate</strong>—Date that the authorization becomes
                      effective.</li>
                    <li><strong class="uicontrol">expirationDate</strong>—Date that the authorization
                      expires.</li>
                    <li><strong class="uicontrol">id</strong>—ID of the payment authorization record.</li>
                    <li><strong class="uicontrol">paymentAuthorizationNumber</strong>—System-defined number for
                      the payment authorization record.</li>
                    <li><strong class="uicontrol">requestDate</strong>—Date that the authorization
                      occurred.</li>
                    <li><strong class="uicontrol">status</strong>—Status of the payment authorization as
                      returned by the gateway.</li>
                  </ul>
                </li>
                <li><strong class="uicontrol">paymentGatewayLogs</strong> —Payment gateway log information about
                  the authorization transaction. This field is a list of Apex-defined variables of
                  class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_output_gateway_log_output.htm" target="_blank">ConnectApi.GatewayLogResponse</a>, each of which includes these fields:<ul>
                    <li><strong class="uicontrol">createdDate</strong>—Date when the gateway log was
                      created.</li>
                    <li><strong class="uicontrol">gatewayResultCode</strong>—Result codes that show the status
                      of a transaction as it is passed to the financial institution and then
                      returned to the client.</li>
                    <li><strong class="uicontrol">id</strong>—ID of the gateway log record.</li>
                    <li><strong class="uicontrol">interactionStatus</strong>—Gateway interaction status. It can
                      be <code>SUCCESS</code>, <code>FAILED</code>, or <code>TIMEOUT</code>.</li>
                  </ul>
                </li>
                <li><strong class="uicontrol">paymentGroup</strong> —Details about the payment group. This field
                  is an Apex-defined variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_output_payment_group.htm" target="_blank">ConnectApi.PaymentGroupResponse</a>, which includes these fields:<ul>
                    <li><strong class="uicontrol">currencyIsoCode</strong> —Three-letter ISO 4217 currency code
                      associated with the payment group record.</li>
                    <li><strong class="uicontrol">id</strong>—ID of the payment group record.</li>
                    <li><strong class="uicontrol">sourceObjectId</strong>—Source object ID of the payment group
                      record.</li>
                  </ul>
                </li>
                <li><strong class="uicontrol">paymentMethod</strong> —Details about the payment method. This
                  field is an Apex-defined variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_output_payment_method_output.htm" target="_blank">ConnectApi.PaymentMethodResponse</a>, which includes these fields:<ul>
                    <li><strong class="uicontrol">accountId</strong> —ID of the account for the payment
                      method.</li>
                    <li><strong class="uicontrol">id</strong>—ID of the payment method.</li>
                    <li><strong class="uicontrol">status</strong>—Status of the payment method.</li>
                  </ul>
                </li>
              </ul>
            </td>
          </tr>
        </tbody>
      </table>

## Usage

Use this action in custom flows that require payment authorization, such as adding an item to an order or an uneven exchange. Before using it, verify with your payment provider that it supports payment authorization calls from Salesforce Order Management.