Skip to content

Confirming Your Registration

You must confirm your registration using a GraphQL mutation which takes the following format:

mutation {
confirmRegistration(
  confirmationToken: "YOUR CONFIRMATION TOKEN",
  password: "YOUR SECURE PASSWORD"
) {
    message
  }
}

Upon successful registration confirmation, you receive the message "Registration confirmation succeeded. You can log in and begin processing statements."

The examples below illustrate running the mutation in several different languages.

# Terminate lines with \ character to allow command to span multiple lines.
# Escape quotation marks in body of mutation or query with backslashes.
# Use here document for data stream.
# Tested using the bash interpreter on Linux.
curl 'https://sandbox.ottertax.com/v2/graphql' \
  -i \
  -X POST \
  -H 'content-type:  application/json' \
  -d @- <<END_DATA
    {
      "query":"
      mutation {
        confirmRegistration(
          confirmationToken: \"YOUR CONFIRMATION TOKEN\"
          password: \"YOUR SECURE PASSWORD\"
        ) {
          message
        }
      }
      "
    }
END_DATA
:: Terminate lines with ^ character to allow command to span multiple lines.
:: Precede quotation marks in body of mutation or query with triple backslashes.
:: Precede other quotation marks in data stream with single backslashes.
:: Tested using a command prompt on Windows 10.
curl "https://sandbox.ottertax.com/v2/graphql" ^
  -i ^
  -X POST ^
  -H "content-type: application/json" ^
  -d "{ \"query\":\" ^
      mutation { ^
        confirmRegistration( ^
          confirmationToken: \\\"YOUR CONFIRMATION TOKEN\\\" ^
          password: \\\"YOUR SECURE PASSWORD\\\" ^
        ) { ^
          message ^
        } ^
      } ^
      \" }"
// Using graphql-request from
// https://github.com/prisma-labs/graphql-request
// Example tested with node version 14.16.0
import { request, gql } from 'graphql-request'

const query = gql`
mutation {
confirmRegistration(
  confirmationToken: "YOUR CONFIRMATION TOKEN",
  password: "YOUR SECURE PASSWORD"
) {
    message
  }
}
`

request('https://sandbox.ottertax.com/v2/graphql', query)
.then((data) => console.log(data))
<?php
// Tested with php-cli version 8.0.5.
$query =<<<'END_DATA'
  mutation {
  confirmRegistration(
    confirmationToken: "YOUR CONFIRMATION TOKEN",
    password: "YOUR SECURE PASSWORD"
  ) {
      message
    }
  }
END_DATA;
$payload = array ('query' => $query);
$options = array(
  'http' => array(
    'method'  => 'POST',
    'content' => json_encode( $payload ),
    'header'=>  "Content-Type: application/json\r\n"
    )
);

$context  = stream_context_create( $options );
$response = file_get_contents( 'https://sandbox.ottertax.com/v2/graphql',
                               false, $context );
if( $response === FALSE ) {
  echo "Call to server failed.\n";
} else {
  echo $response . "\n";
}
?>
# Using GQL from
# https://github.com/graphql-python/gql
# Tested using python version 3.8.8
from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport

transport = AIOHTTPTransport(url="https://sandbox.ottertax.com/v2/graphql/")
client = Client(transport=transport, fetch_schema_from_transport=True)
query = gql(
    """
        mutation {
        confirmRegistration(
          confirmationToken: "YOUR CONFIRMATION TOKEN",
          password:          "YOUR SECURE PASSWORD"
        ) {
            message
          }
        }
    """
)

result = client.execute(query)
print(result)
# If you wish to use a library instead, see
# https://github.com/github/graphql-client
# Tested using ruby 2.7.2.
require( 'net/http' )
require( 'uri' )
require( 'json' )

query = <<-END_QUERY
mutation {
confirmRegistration(
  confirmationToken: "YOUR CONFIRMATION TOKEN",
  password: "YOUR SECURE PASSWORD"
) {
    message
  }
}
END_QUERY

uri = URI( 'https://sandbox.ottertax.com/v2/graphql' )
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER

request = Net::HTTP::Post.new( uri.request_uri,
                              {'Content-Type': 'application/json'} )
request.body = {query: query}.to_json
response = http.request(request)
if( response.code == '200' )
  json = JSON.parse( response.body )
  message = json.dig( 'data', 'confirmRegistration', 'message' )
  STDOUT.puts( message )
else
  STDOUT.puts( "Response code was #{response.code}:\n#{response.inspect}" )
end