• GoDaddy Community
  • VPS & Dedicated Servers
  • VPS & Dedicated Servers

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Coding issue in PHP app

    Hellow,

    I try purchase some not existing domain in my php app in developer mode, but I have some error

     

    Server error: `POST https://api.ote-godaddy.com/v1/domains/purchase` 
    resulted in a `500 Internal Server Error` response:
    {"code":"-1073456591","message":"[P3OWGDCOMM001]
    {gdBasketPurchase.PurchaseBasketXML.1}BasketPurchase has
    invalid/missin (truncated...)

     

    This is my code:

     

            $client = new Client(['base_uri' => 'https://api.ote-godaddy.com']);
            $options = [];
            $key = 'key';
            $secret = 'secret';
            $options['headers']['Accept']        = 'application/json';
            $options['headers']['Authorization'] = 'sso-key ' . $key . ':' . $secret;
            $options['json'] = [
                "domain"=> 'vsedoljnorabotathoroshee4no.net',
                "renewAuto"=> true,
                "privacy"=> false,
                "period"=> 1,
                "consent"=> [
                    "agreementKeys"=> [
                        "DNRA"
                    ],
                    "agreedAt"=> "2017-09-28T13:57:31Z",
                    "agreedBy"=> "127.0.0.1"
                ],
                "contactBilling"=> [
                    "addressMailing"=> [
                        "country"=> "AC",
                        "postalCode"=> "2060",
                        "state"=> "NSW",
                        "city"=> "North Sydney",
                        "address2"=> "",
                        "address1"=> "100 Smith St"
                    ],
                    "phone"=> "+614.11111222",
                    "nameFirst"=> "Andrew",
                    "nameLast"=> "Test",
                    "organization"=> "ABC",
                    "email"=> "andrewb@abc.com"
                ],
                "contactAdmin"=> [
                    "addressMailing"=> [
                        "address1"=> "100 Smith St",
                        "address2"=> "",
                        "city"=> "North Sydney",
                        "country"=> "AC",
                        "postalCode"=> "2060",
                        "state"=> "NSW"
                    ],
                    "email"=> "andrewb@abc.com",
                    "jobTitle"=> "",
                    "nameFirst"=> "Andrew",
                    "nameLast"=> "Test",
                    "nameMiddle"=> "",
                    "organization"=> "ABC",
                    "phone"=> "+614.11111222"
                ],
                "contactRegistrant"=> [
                    "addressMailing"=> [
                        "address1"=> "100 Smith St",
                        "address2"=> "",
                        "city"=> "North Sydney",
                        "country"=> "AC",
                        "postalCode"=> "2060",
                        "state"=> "NSW"
                    ],
                    "email"=> "andrewb@abc.com",
                    "fax"=> "",
                    "jobTitle"=> "",
                    "nameFirst"=> "Andrew",
                    "nameLast"=> "Test",
                    "organization"=> "ABC",
                    "phone"=> "+614.11111222"
                ],
                "contactTech"=> [
                    "addressMailing"=> [
                        "address1"=> "100 Smith St",
                        "address2"=> "",
                        "city"=> "North Sydney",
                        "country"=> "AC",
                        "postalCode"=> "2060",
                        "state"=> "NSW"
                    ],
                    "email"=> "andrewb@abc.com",
                    "jobTitle"=> "",
                    "nameFirst"=> "Andrew",
                    "nameLast"=> "Test",
                    "nameMiddle"=> "",
                    "organization"=> "ABC",
                    "phone"=> "+614.11111222"
                ]
            ];
    
            $response = $client->post('/v1/domains/purchase', $options);

     

     But if i send this request in docs page, this work well

    I dont understand, where i'm wrong. please, help me.