Run an auth only transaction

Background
Before starting this tutorial, make sure you understand the following topics from the Quick start section:

You may want to authorize a transaction (auth only) and capture it at a later time.

Please note that auth only transaction(s) are currently only available through the following alternative payment methods (APMs):

You can run an auth only transaction using any of the four integration methods, depending on the payment method:

Multi Iframe (Express APM) for Auth Only

To run an auth only transaction using the multi iframe (also known as Express APM), follow the steps below.

  1. Prepare Your Checkout Page

    Follow steps 1-2 of the Express APM tutorial.

  2. Request an Express Iframe URL

    Follow step 3 of the Express APM tutorial.

    Include isAuthOnly: true in the body of your request.

    If the APM supports it, you can also include Pay Later messaging.

    curl -X POST https://api.nexiopaysandbox.com/apm/v3/token \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'Authorization: Basic [Base64_encoded_login]'
      -d '{
      "data": {
        "amount": 4.00,
        "currency": "USD",
        "customer": {
          "orderNumber": "12345678",
          "firstName": "John",
          "lastName": "Doe",
          "email": "[email protected]",
          "billToCountry": "US"
        },
        "totalTaxAmount": 0,
        "cart": {
          "items": [
            {
              "item": "E200",
              "description": "Platinum set",
              "quantity": 2,
              "price": 2
            }
          ]
        }
      },
      "customerRedirectUrl": "https://[your-ecommerce-website]",
      "uiOptions": {
        "displaySubmitButton": true
      },
      "isAuthOnly": true
    }'
    

    A successful response includes the expressIFrameUrl. Copy or store this for use in step 3.

    {
      "expiration": "2021-07-22T20:49:50.000Z",
      "token": "830d36f6-a5e3-4455-9600-3a55b63e2fc2",
      "asyncTraceId": "830d36f6-a5e3-4455-9600-3a55b63e2fc2",
      "expressIFrameUrl": "https://www.api.nexiopaysandbox.com/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2",
      "redirectUrls": [
        {
          "paymentMethod": "klarna",
          "url": "https://api.nexiopaysandbox.com/apm/v3/popup?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=klarna"
        }
      ],
      "buttonIFrameUrls": [
        {
          "paymentMethod": "klarna",
          "url": "https://api.nexiopaysandbox.com/apm/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=klarna"
        },
        {
          "paymentMethod": "braintreePayPal",
          "url": "https://api.nexiopaysandbox.com/apm/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=braintreePayPal"
        }
      ]
    }
    

  3. Complete the Payment Process

    Follow steps 4-6 of the Express APM tutorial.

    A successful auth only transaction returns a status of authOnlyPending or authOnly.

Individual Iframe (Button URLs) for Auth Only

To run an auth only transaction through an APM using the button iframe URLs, follow the steps below.

  1. Prepare Your Checkout Page

    Follow steps 1-3 of the Button Iframe URLs tutorial.

  2. Request the APM Button Iframe URLs

    Follow step 4 of the Button Iframe URLs tutorial.
    Include isAuthOnly: true in the body of your request.

    If the APM supports it, you can also include Pay Later messaging.

    curl -X POST https://api.nexiopaysandbox.com/apm/v3/token \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'Authorization: Basic [Base64_encoded_login]'
      -d '{
      "data": {
        "amount": 4.00,
        "currency": "USD",
        "customer": {
          "orderNumber": "12345678",
          "firstName": "John",
          "lastName": "Doe",
          "email": "[email protected]",
          "billToCountry": "US"
        },
        "totalTaxAmount": 0,
        "cart": {
          "items": [
            {
              "item": "E200",
              "description": "Platinum set",
              "quantity": 2,
              "price": 2
            }
          ]
        }
      },
      "customerRedirectUrl": "https://[your-ecommerce-website]",
      "isAuthOnly": true
    }'
    

A successful request returns an array of buttonIFrameUrls. This array is a list of all APMs currently enabled on your merchant account. Copy the url associated with the wanted payment method.

{
  "expiration": "2021-07-22T20:49:50.000Z",
  "token": "830d36f6-a5e3-4455-9600-3a55b63e2fc2",
  "asyncTraceId": "830d36f6-a5e3-4455-9600-3a55b63e2fc2",
  "expressIFrameUrl": "https://www.api.nexiopaysandbox.com/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2",
  "redirectUrls": [
    {
      "paymentMethod": "klarna",
      "url": "https://api.nexiopaysandbox.com/apm/v3/popup?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=klarna"
    }
  ],
  "buttonIFrameUrls": [
    {
      "paymentMethod": "klarna",
      "url": "https://api.nexiopaysandbox.com/apm/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=klarna"
    },
    {
      "paymentMethod": "braintreePayPal",
      "url": "https://api.nexiopaysandbox.com/apm/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=braintreePayPal"
    }
  ]
}
  1. Complete the Payment Process

    Follow steps 5-7 of the Button Iframe URLs tutorial.

    A successful auth only transaction returns a status of authOnlyPending or authOnly.

    📘

    Note

    If the customer selected PayPal (with Braintree) as the payment method, then, in the event posted to your window, the response includes an apm.token parameter. Save the apm.token value somewhere in order to use it again (probably similar to how you save TokenEx tokens already).

Redirect URLs for Auth Only

To run an auth only transaction through an APM using the redirect URLs, follow the steps below.

  1. Prepare Your Checkout Page

    Follow steps 1-2 of the Redirect URLs tutorial.

  2. Request the Redirect URL

    Follow step 3 of the Redirect URLs tutorial.
    Include isAuthOnly: true in the body of your request.

    If the APM supports it, you can also include Pay Later messaging.

    curl -X POST https://api.nexiopaysandbox.com/apm/v3/token \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'Authorization: Basic [Base64_encoded_login]'
      -d '{
      "data": {
        "amount": 4.00,
        "currency": "USD",
        "customer": {
          "orderNumber": "12345678",
          "firstName": "John",
          "lastName": "Doe",
          "email": "[email protected]",
          "billToCountry": "US"
        },
        "totalTaxAmount": 0,
        "cart": {
          "items": [
            {
              "item": "E200",
              "description": "Platinum set",
              "quantity": 2,
              "price": 2
            }
          ]
        }
      },
      "customerRedirectUrl": "https://[your-ecommerce-website]",
      "isAuthOnly": true
    }'
    

    A successful request returns an array of redirectUrls. This array is a list of all APMs currently enabled on your merchant account. Copy the url of the APM you want (for use in step 3).

    {
      "expiration": "2021-07-22T20:49:50.000Z",
      "token": "830d36f6-a5e3-4455-9600-3a55b63e2fc2",
      "asyncTraceId": "830d36f6-a5e3-4455-9600-3a55b63e2fc2",
      "expressIFrameUrl": "https://www.api.nexiopaysandbox.com/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2",
      "redirectUrls": [
        {
          "paymentMethod": "klarna",
          "url": "https://api.nexiopaysandbox.com/apm/v3/popup?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=klarna"
        },
        {
          "paymentMethod": "payPal",
          "url": "https://www.api.nexiopaysandbox.com/v3/popup?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=payPal"
        }
      ],
      "buttonIFrameUrls": [
        {
          "paymentMethod": "klarna",
          "url": "https://api.nexiopaysandbox.com/apm/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=klarna"
        },
        {
          "paymentMethod": "braintreePayPal",
          "url": "https://api.nexiopaysandbox.com/apm/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=braintreePayPal"
        }
      ]
    }
    

  3. Complete the Payment Process

    Follow steps 4-6 of the Redirect URLs tutorial.
    A successful auth only transaction returns a status of authOnlyPending or authOnly.

Custom DIV for Auth Only

To run an auth only transaction through an APM using the button iframe URLs to help you get the HTML content for the DIV, follow the steps below.

  1. Prepare Your Checkout Page

    Follow step 5a of the Custom DIV for Google Pay tutorial.

  2. Request the APM Button Iframe URLs

    Follow step 5b of the Custom DIV for Google Pay tutorial.
    Include isAuthOnly: true in the body of your request.

    curl -X POST https://api.nexiopaysandbox.com/apm/v3/token \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'Authorization: Basic [Base64_encoded_login]'
      -d '{
      "data": {
        "amount": 4.00,
        "currency": "USD",
        "customer": {
          "orderNumber": "12345678",
          "firstName": "John",
          "lastName": "Doe",
          "email": "[email protected]",
          "billToAddressOne": "2147 West Silverlake Drive",
          "billToCity": "Scranton",
          "billToState": "PA",
          "billToPostal": "18503",
          "billToCountry": "US"
        }
      },
      "customerRedirectUrl": "https://[your-ecommerce-website]",
      "isAuthOnly": true
    }'
    

A successful request returns an array of buttonIFrameUrls. This array is a list of all APMs currently enabled on your merchant account. Copy the url associated with the Google Pay payment method.

{
  "expiration": "2021-07-22T20:49:50.000Z",
  "token": "830d36f6-a5e3-4455-9600-3a55b63e2fc2",
  "asyncTraceId": "830d36f6-a5e3-4455-9600-3a55b63e2fc2",
  "expressIFrameUrl": "https://www.api.nexiopaysandbox.com/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2",
  "redirectUrls": [
    {
      "paymentMethod": "klarna",
      "url": "https://api.nexiopaysandbox.com/apm/v3/popup?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=klarna"
    }
  ],
  "buttonIFrameUrls": [
    {
      "paymentMethod": "klarna",
      "url": "https://api.nexiopaysandbox.com/apm/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=klarna"
    },
    {
      "paymentMethod": "braintreePayPal",
      "url": "https://api.nexiopaysandbox.com/apm/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=braintreePayPal"
    },
    {
      "paymentMethod": "googlePayCyberSource",
      "url": "https://api.nexiopaysandbox.com/apm/v3?token=830d36f6-a5e3-4455-9600-3a55b63e2fc2&paymentMethod=googlePayCyberSource"
    }
  ]
}
  1. Complete the Payment Process

    Follow steps 5c-5d and steps 6-7 of the Custom DIV for Google Pay tutorial.

    A successful auth only transaction returns a status of authOnlyPending or authOnly.