Running a card transaction with the API

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

Authorize and capture

To authorize and capture a transaction using the API, follow the steps below:

  1. Configure Your Account

    Contact Integrations Support to ensure your merchant ID and account have access to the proper API endpoint.
    (You may be asked to provide additional information such as Gateway, TokenEx, or Kount credentials.)

  2. Save a Card Token

    You may save a card token with your own form, with the save card token iframe or directly through the API. Card tokens can be used to process through any MID on your account. They are not restricted to a specific merchant account or currency.

  3. Post Payment Information to Nexio

    Post payment details along with the card token to the Run card transaction endpoint.

    curl -X POST https://api.nexiopaysandbox.com/pay/v3/process \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'Authorization: Basic [Base64_encoded_login]'
      -d '{
      "data": {},
      "tokenex": {
        "token": "6ee140a0-05d1-4958-8325-b38a690dbb9d"
      }
    }'
    
  4. Handle the response
    You may want to store the id returned in the response as this is the payment ID and you can use it to query the status of the transaction (using the View transaction by payment ID endpoint) within about a minute. You may also want to store the transactionId. You can only get this parameter after the transaction runs. You get it in the webhook with the transactionId (note that this parameter is not returned for legacy webhooks) or in the id returned in any of the following endpoints:

Authorize only

To authorize a transaction using the API, follow the steps below:

  1. Configure Your Account

    Contact Integrations Support to ensure your merchant ID and account have access to the proper API endpoint.
    (You may be asked to provide additional information such as Gateway, TokenEx, or Kount credentials.)

  2. Save a Card Token

    You may save a card token with your own form, with the save card token iframe or directly through the API. Card tokens can be used to process through any MID on your account. They are not restricted to a specific merchant account or currency.

  3. Post Payment Information to Nexio

    Post payment details along with the card token to the Run card transaction endpoint.

    Include the parameter isAuthOnly: true in the body of your request.

    curl -X POST https://api.nexiopaysandbox.com/pay/v3/process \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'Authorization: Basic [Base64_encoded_login]'
      -d '{
      "data": {},
      "tokenex": {
        "token": "6ee140a0-05d1-4958-8325-b38a690dbb9d"
      },
      "processingOptions": {
        "paymentType": "initialUnscheduled"
      },
      "isAuthOnly": true
    }'
    
  4. Handle the response
    You may want to store the id returned in the response as this is the payment ID and you can use it to query the status of the transaction (using the View transaction by payment ID endpoint) within about a minute. You may also want to store the transactionId. You can only get this parameter after the transaction runs. You get it in the webhook with the transactionId (note that this parameter is not returned for legacy webhooks) or in the id returned in any of the following endpoints: