Enabling security code verification with the API

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

You can enable security code verification while saving a card token with the iframe, with your own form, or through the API.

  1. Request a One-time-use Token

    Request an e-commerce one-time-use token. Include the object "processingOptions": { "verifyCvc": true } in the body of your request.

    curl -X POST https://api.nexiopaysandbox.com/pay/v3/token \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'Authorization: Basic [Base64_encoded_login]'
      -d '{
      "processingOptions": {
        "verifyCvc": true
      }
    }'
    

  2. Post Card Information to Nexio

    Send a POST request to the Run card transaction endpoint.
    Include the token returned from step 1 and the card information (including the CVC securityCode) 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": {
        "amount": "29.99",
        "currency": "USD"
      },
      "tokenex": {
        "token": "6ee140a0-05d1-4958-8325-b38a690dbb9d"
      },
      "card": {
        "cardHolderName": "John H Doe",
        "encryptedNumber": "cu3yRktaYFK2LUC6DpNK289tYDsGRCi7cO+GeG0hkeYFvT7Y8/oY5r53obMz6Q/BZ38gk2u2Ufwy8ojBcX2sfNjG5jplGTXA4NNlSIUjMFfiHe1sff1JFpThoiW/IIlifGlbWu+S1/9pqWPTzJ2+DcjwohbHzsDahhYewFhXgC8qsK0ypi/Shlp+CwRITyIvbVXESD0xz3YOTRHeZLlChvVqN8z4ZzN8nm0MXkmT1wcpYI73bH4KdnPwNU3s7XxvP/ernQP73SHHAOKSLlz4F6AEHFjJiCoXzeLF7LwEjRdxDJ0sKVXbRk3i9BGh+8Nle2VYgjpUWtk2763QkvZiQQ==",
        "expirationMonth": "12",
        "expirationYear": "20",
        "securityCode": 927
      }
    }'