Skip to content

Adding 3922 Statements

Use the addF3922Statements mutation to add 3922 statements. More complete and up-to-date documentation for the addF3922Statements mutation is available as part of the introspective GraphQL documentation.

The example mutation below illustrates adding two statements.

mutation {
  addF3922Statements(
    statements: [
      {
        dateOptionExercised: "2021-01-19"
        exercisePricePerShare: "8000.00"
        numberSharesTransferred: 7
        recipientAddress1: "784 East 77th Street"
        recipientCity: "New York"
        recipientFirstName: "Leif"
        recipientLastName: "Babson"
        recipientState: "NY"
        recipientTin: "200213492"
        recipientZipCode: "10162"
        senderAddress1: "406 Chambers Street"
        senderCity: "New York"
        senderName: "Empire Savings Bank"
        senderState: "NY"
        senderTin: "104123456"
        senderZipCode: "10282"
        tags: ["group 7", "New York"]
        uploaderId: "3f898d55-229e-4ed3-a130-c76ca53349ab"
      }
      {
        dateOptionExercised: "2021-04-27"
        exercisePricePerShare: "6881.27"
        numberSharesTransferred: 52
        recipientAddress1: "617 West 53rd Street"
        recipientAddress2: "Apartment 1022"
        recipientCity: "New York"
        recipientFirstName: "Anjelica"
        recipientLastName: "Heximer"
        recipientState: "NY"
        recipientTin: "200223492"
        recipientZipCode: "10019"
        senderAddress1: "406 Chambers Street"
        senderCity: "New York"
        senderName: "Empire Savings Bank"
        senderState: "NY"
        senderTin: "104123456"
        senderZipCode: "10282"
        tags: ["group 7", "New York", "send for review"]
        uploaderId: "f9ba9513-bdc0-4b78-9bb0-4ae77dd474bf"
      }
    ]
  ) {
    errors
    statements {
      recordNumber
      statement {
        otxId
        uploaderId
        recipientFirstName
        recipientLastName
        tags
      }
      messages
    }
  }
}

The code snippets below illustrate running the query. See the documentation on authentication for information about obtaining the credential data passed in the header.

# 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' \
  -H 'access-token:  YOUR ACCESS TOKEN' \
  -H 'client:        YOUR CLIENT ID' \
  -H 'uid:           YOUR UID' \
  -d @- <<END_DATA
    { 
      "query":"
        mutation {
          addF3922Statements(
            statements: [
              {
                dateOptionExercised: \"2021-01-19\"
                exercisePricePerShare: \"8000.00\"
                numberSharesTransferred: 7
                recipientAddress1: \"784 East 77th Street\"
                recipientCity: \"New York\"
                recipientFirstName: \"Leif\"
                recipientLastName: \"Babson\"
                recipientState: \"NY\"
                recipientTin: \"200213492\"
                recipientZipCode: \"10162\"
                senderAddress1: \"406 Chambers Street\"
                senderCity: \"New York\"
                senderName: \"Empire Savings Bank\"
                senderState: \"NY\"
                senderTin: \"104123456\"
                senderZipCode: \"10282\"
                tags: [\"group 7\", \"New York\"]
                uploaderId: \"3f898d55-229e-4ed3-a130-c76ca53349ab\"
              }
              {
                dateOptionExercised: \"2021-04-27\"
                exercisePricePerShare: \"6881.27\"
                numberSharesTransferred: 52
                recipientAddress1: \"617 West 53rd Street\"
                recipientAddress2: \"Apartment 1022\"
                recipientCity: \"New York\"
                recipientFirstName: \"Anjelica\"
                recipientLastName: \"Heximer\"
                recipientState: \"NY\"
                recipientTin: \"200223492\"
                recipientZipCode: \"10019\"
                senderAddress1: \"406 Chambers Street\"
                senderCity: \"New York\"
                senderName: \"Empire Savings Bank\"
                senderState: \"NY\"
                senderTin: \"104123456\"
                senderZipCode: \"10282\"
                tags: [\"group 7\", \"New York\", \"send for review\"]
                uploaderId: \"f9ba9513-bdc0-4b78-9bb0-4ae77dd474bf\"
              }
            ]
          ) {
            errors
            statements {
              recordNumber
              statement {
                otxId
                uploaderId
                recipientFirstName
                recipientLastName
                tags
              }
              messages
            }
          }
        }
      "
    }
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" ^
  -H "access-token: YOUR ACCESS TOKEN" ^
  -H "client:       YOUR CLIENT ID" ^
  -H "uid:          YOUR UID" ^
  -d "{ \"query\":\" ^
        mutation { ^
          addF3922Statements( ^
            statements: [ ^
              { ^
                dateOptionExercised: \\\"2021-01-19\\\" ^
                exercisePricePerShare: \\\"8000.00\\\" ^
                numberSharesTransferred: 7 ^
                recipientAddress1: \\\"784 East 77th Street\\\" ^
                recipientCity: \\\"New York\\\" ^
                recipientFirstName: \\\"Leif\\\" ^
                recipientLastName: \\\"Babson\\\" ^
                recipientState: \\\"NY\\\" ^
                recipientTin: \\\"200213492\\\" ^
                recipientZipCode: \\\"10162\\\" ^
                senderAddress1: \\\"406 Chambers Street\\\" ^
                senderCity: \\\"New York\\\" ^
                senderName: \\\"Empire Savings Bank\\\" ^
                senderState: \\\"NY\\\" ^
                senderTin: \\\"104123456\\\" ^
                senderZipCode: \\\"10282\\\" ^
                tags: [\\\"group 7\\\", \\\"New York\\\"] ^
                uploaderId: \\\"3f898d55-229e-4ed3-a130-c76ca53349ab\\\" ^
              } ^
              { ^
                dateOptionExercised: \\\"2021-04-27\\\" ^
                exercisePricePerShare: \\\"6881.27\\\" ^
                numberSharesTransferred: 52 ^
                recipientAddress1: \\\"617 West 53rd Street\\\" ^
                recipientAddress2: \\\"Apartment 1022\\\" ^
                recipientCity: \\\"New York\\\" ^
                recipientFirstName: \\\"Anjelica\\\" ^
                recipientLastName: \\\"Heximer\\\" ^
                recipientState: \\\"NY\\\" ^
                recipientTin: \\\"200223492\\\" ^
                recipientZipCode: \\\"10019\\\" ^
                senderAddress1: \\\"406 Chambers Street\\\" ^
                senderCity: \\\"New York\\\" ^
                senderName: \\\"Empire Savings Bank\\\" ^
                senderState: \\\"NY\\\" ^
                senderTin: \\\"104123456\\\" ^
                senderZipCode: \\\"10282\\\" ^
                tags: [\\\"group 7\\\", \\\"New York\\\", \\\"send for review\\\"] ^
                uploaderId: \\\"f9ba9513-bdc0-4b78-9bb0-4ae77dd474bf\\\" ^
              } ^
            ] ^
          ) { ^
            errors ^
            statements { ^
              recordNumber ^
              statement { ^
                otxId ^
                uploaderId ^
                recipientFirstName ^
                recipientLastName ^
                tags ^
              } ^
              messages ^
            } ^
          } ^
        } ^
     \" }"
// Using graphql-request from
// https://github.com/prisma-labs/graphql-request
// Example tested with node version 14.16.0
import { GraphQLClient, gql } from 'graphql-request'

async function main() {
  const endpoint = 'https://sandbox.ottertax.com/v2/graphql'

  const graphQLClient = new GraphQLClient(endpoint, {
    headers: {
      'access-token': 'YOUR ACCESS TOKEN',
      'client':       'YOUR CLIENT ID',
      'uid':          'YOUR UID'
    },
  })
  const query = gql`
    mutation {
      addF3922Statements(
        statements: [
          {
            dateOptionExercised: "2021-01-19"
            exercisePricePerShare: "8000.00"
            numberSharesTransferred: 7
            recipientAddress1: "784 East 77th Street"
            recipientCity: "New York"
            recipientFirstName: "Leif"
            recipientLastName: "Babson"
            recipientState: "NY"
            recipientTin: "200213492"
            recipientZipCode: "10162"
            senderAddress1: "406 Chambers Street"
            senderCity: "New York"
            senderName: "Empire Savings Bank"
            senderState: "NY"
            senderTin: "104123456"
            senderZipCode: "10282"
            tags: ["group 7", "New York"]
            uploaderId: "3f898d55-229e-4ed3-a130-c76ca53349ab"
          }
          {
            dateOptionExercised: "2021-04-27"
            exercisePricePerShare: "6881.27"
            numberSharesTransferred: 52
            recipientAddress1: "617 West 53rd Street"
            recipientAddress2: "Apartment 1022"
            recipientCity: "New York"
            recipientFirstName: "Anjelica"
            recipientLastName: "Heximer"
            recipientState: "NY"
            recipientTin: "200223492"
            recipientZipCode: "10019"
            senderAddress1: "406 Chambers Street"
            senderCity: "New York"
            senderName: "Empire Savings Bank"
            senderState: "NY"
            senderTin: "104123456"
            senderZipCode: "10282"
            tags: ["group 7", "New York", "send for review"]
            uploaderId: "f9ba9513-bdc0-4b78-9bb0-4ae77dd474bf"
          }
        ]
      ) {
        errors
        statements {
          recordNumber
          statement {
            otxId
            uploaderId
            recipientFirstName
            recipientLastName
            tags
          }
          messages
        }
      }
    }
  `

  const data = await graphQLClient.request(query)
  console.log(JSON.stringify(data))
}

main().catch((error) => console.error(error))
<?php
// Tested with php-cli version 8.0.5.
$query =<<<'END_DATA'
  mutation {
    addF3922Statements(
      statements: [
        {
          dateOptionExercised: "2021-01-19"
          exercisePricePerShare: "8000.00"
          numberSharesTransferred: 7
          recipientAddress1: "784 East 77th Street"
          recipientCity: "New York"
          recipientFirstName: "Leif"
          recipientLastName: "Babson"
          recipientState: "NY"
          recipientTin: "200213492"
          recipientZipCode: "10162"
          senderAddress1: "406 Chambers Street"
          senderCity: "New York"
          senderName: "Empire Savings Bank"
          senderState: "NY"
          senderTin: "104123456"
          senderZipCode: "10282"
          tags: ["group 7", "New York"]
          uploaderId: "3f898d55-229e-4ed3-a130-c76ca53349ab"
        }
        {
          dateOptionExercised: "2021-04-27"
          exercisePricePerShare: "6881.27"
          numberSharesTransferred: 52
          recipientAddress1: "617 West 53rd Street"
          recipientAddress2: "Apartment 1022"
          recipientCity: "New York"
          recipientFirstName: "Anjelica"
          recipientLastName: "Heximer"
          recipientState: "NY"
          recipientTin: "200223492"
          recipientZipCode: "10019"
          senderAddress1: "406 Chambers Street"
          senderCity: "New York"
          senderName: "Empire Savings Bank"
          senderState: "NY"
          senderTin: "104123456"
          senderZipCode: "10282"
          tags: ["group 7", "New York", "send for review"]
          uploaderId: "f9ba9513-bdc0-4b78-9bb0-4ae77dd474bf"
        }
      ]
    ) {
      errors
      statements {
        recordNumber
        statement {
          otxId
          uploaderId
          recipientFirstName
          recipientLastName
          tags
        }
        messages
      }
    }
  }
END_DATA;
$payload = array ('query' => $query);
$options = array(
  'http' => array(
    'method'  => 'POST',
    'content' => json_encode( $payload ),
    'header'=>  "Content-Type: application/json\r\n" .
                "access-token: YOUR ACCESS TOKEN\r\n" .
                "client:       YOUR CLIENT ID\r\n" .
                "uid:          YOUR UID\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",
                            headers={ 'access-token': 'YOUR ACCESS TOKEN',
                                      'client':       'YOUR CLIENT ID',
                                      'uid':          'YOUR UID' })
client = Client(transport=transport, fetch_schema_from_transport=True)
query = gql(
    """
      mutation {
        addF3922Statements(
          statements: [
            {
              dateOptionExercised: "2021-01-19"
              exercisePricePerShare: "8000.00"
              numberSharesTransferred: 7
              recipientAddress1: "784 East 77th Street"
              recipientCity: "New York"
              recipientFirstName: "Leif"
              recipientLastName: "Babson"
              recipientState: "NY"
              recipientTin: "200213492"
              recipientZipCode: "10162"
              senderAddress1: "406 Chambers Street"
              senderCity: "New York"
              senderName: "Empire Savings Bank"
              senderState: "NY"
              senderTin: "104123456"
              senderZipCode: "10282"
              tags: ["group 7", "New York"]
              uploaderId: "3f898d55-229e-4ed3-a130-c76ca53349ab"
            }
            {
              dateOptionExercised: "2021-04-27"
              exercisePricePerShare: "6881.27"
              numberSharesTransferred: 52
              recipientAddress1: "617 West 53rd Street"
              recipientAddress2: "Apartment 1022"
              recipientCity: "New York"
              recipientFirstName: "Anjelica"
              recipientLastName: "Heximer"
              recipientState: "NY"
              recipientTin: "200223492"
              recipientZipCode: "10019"
              senderAddress1: "406 Chambers Street"
              senderCity: "New York"
              senderName: "Empire Savings Bank"
              senderState: "NY"
              senderTin: "104123456"
              senderZipCode: "10282"
              tags: ["group 7", "New York", "send for review"]
              uploaderId: "f9ba9513-bdc0-4b78-9bb0-4ae77dd474bf"
            }
          ]
        ) {
          errors
          statements {
            recordNumber
            statement {
              otxId
              uploaderId
              recipientFirstName
              recipientLastName
              tags
            }
            messages
          }
        }
      }
    """
)

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' )

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
headers = { 'Content-Type': 'application/json',
            'access-token': 'YOUR ACCESS TOKEN',
            'client':       'YOUR CLIENT ID',
            'uid':          'YOUR UID' }

query = <<-END_DATA
  mutation {
    addF3922Statements(
      statements: [
        {
          dateOptionExercised: "2021-01-19"
          exercisePricePerShare: "8000.00"
          numberSharesTransferred: 7
          recipientAddress1: "784 East 77th Street"
          recipientCity: "New York"
          recipientFirstName: "Leif"
          recipientLastName: "Babson"
          recipientState: "NY"
          recipientTin: "200213492"
          recipientZipCode: "10162"
          senderAddress1: "406 Chambers Street"
          senderCity: "New York"
          senderName: "Empire Savings Bank"
          senderState: "NY"
          senderTin: "104123456"
          senderZipCode: "10282"
          tags: ["group 7", "New York"]
          uploaderId: "3f898d55-229e-4ed3-a130-c76ca53349ab"
        }
        {
          dateOptionExercised: "2021-04-27"
          exercisePricePerShare: "6881.27"
          numberSharesTransferred: 52
          recipientAddress1: "617 West 53rd Street"
          recipientAddress2: "Apartment 1022"
          recipientCity: "New York"
          recipientFirstName: "Anjelica"
          recipientLastName: "Heximer"
          recipientState: "NY"
          recipientTin: "200223492"
          recipientZipCode: "10019"
          senderAddress1: "406 Chambers Street"
          senderCity: "New York"
          senderName: "Empire Savings Bank"
          senderState: "NY"
          senderTin: "104123456"
          senderZipCode: "10282"
          tags: ["group 7", "New York", "send for review"]
          uploaderId: "f9ba9513-bdc0-4b78-9bb0-4ae77dd474bf"
        }
      ]
    ) {
      errors
      statements {
        recordNumber
        statement {
          otxId
          uploaderId
          recipientFirstName
          recipientLastName
          tags
        }
        messages
      }
    }
  }
END_DATA
request = Net::HTTP::Post.new(uri.request_uri, headers )
request.body = {query: query}.to_json
response = http.request(request)
if( response.code == '200' )
  payload = JSON.parse( response.body )
  STDOUT.puts( payload )
else
  STDOUT.puts( "Response code was #{response.code}:\n#{response.inspect}" )
end