godaddy api purchase domain doesn't fulfill schema

16 Views Asked by At

I'm trying using godaddy api to purchase domain

but get this error

"code":"INVALID_BODY", "message":"Request body doesn't fulfill schema, see details in fields"

$domain="moga3.com";
$AKEY="";
$SKEY="";
$contactRegistrant = [ "nameFirst" => "Raidel", "nameMiddle" => "", "nameLast" =>"Arooja", "organization" => "US IT Company", "jobTitle" => "Developer", "email" => "[email protected]", "phone" => "+1.4242258420", "fax" => "", "addressMailing" => [ "address1" => "US IT Company", "address2" => "IL,60015,US", "city" => "Illinois", "state" => "IL", "postalCode" => "60015", "country" => "US" ] ];
$form_params = [ 
          "domain" => $domain,
          "consent" => [ 
                  "agreementKeys" => ["DNRA"],
                  "agreedBy" => "Luis Gonzalez",
                  "agreedAt" => "2024-03-05T05:46:12Z" 
          ],
           "period"=>1,
          "nameServers" => ["ns50.domaincontrol.com","ns60.domaincontrol.com"],
           "renewAuto"=> 'false',
           "privacy"=> 'false',
          "contactRegistrant" => $contactRegistrant,
          "contactAdmin" => $contactRegistrant,
          "contactTech" => $contactRegistrant,
          "contactBilling" => $contactRegistrant 
  ];
  $headers = ['Authorization' => "sso-key $AKEY:$SKEY",'Content-Type' => 'application/json'];

  $url = '/v1/domains/purchase';

    try {
          $client = new GuzzleHttp\Client ( ['base_uri' => 'https://api.ote-godaddy.com','verify' => true ]);
          $responce = $client->post( $url, ['headers' => $headers,'form_params' => $form_params   ] );
            echo ( json_encode ( $responce ) );
      echo $responce->getBody ();
    } catch ( Exception $e ) {
        echo (  $e->getMessage () );
    }

I do not know where is the error Error I get :

Request body doesn't fulfill schema, see details in `fields

any help appricated

thanks

0

There are 0 best solutions below