Service Provider API EditAccount

Synopsis
public array EditAccount( array $edit )
Description

Modifies customer data.

SOAP
This function can be called using SOAP.
XML
This function can be called using GET / POST requests.
Parameters
Type Parameter Mandatory Description
integer $partnerid yes Partner ID.
string $signkey yes Sign key.
string $username yes User name. (max. 25 characters)
string $password yes Password. (max. 16 characters)
string $email yes Email address.
string $company no Company name.
string $street yes Street address.
string $zipcode yes ZIP code.
string $city yes City name.
string $state no ISO 3166-2 two-letter state code. See US States.
string $country yes ISO 3166-1 alpha-2 two-letter country code. See Countries.
string $language yes ISO 639-1 two-letter language code. See Domain Languages.
string $vat no VAT (Value Added Tax) number.
string $phone no Phone number.
  • Must not start with a country prefix.
  • Must not start with 0.
  • Must contain only numbers.
  • Must match the selected country.
boolean $confirmation yes Whether the customer accepts Sedo's terms of service.
  • true - Terms of service accepted.
  • false - Terms of service not accepted.
Returns
Type Description
array

The return value contains the following elements:

Type Parameter Description
string status Status code. See Status Notifications.
string message Status message. See Status Notifications.
Version
1.0
<?php
try {
    // Create a new client by providing the endpoint to the constructor.
    $client = new SoapClient(
        null,
        [
            'location'     => 'https://api.sedo.com/api/v1/',
            'soap_version' => SOAP_1_1,
            'encoding'     => 'UTF-8',
            'uri'          => 'urn:SedoInterface',
            'style'        => SOAP_RPC,
            'use'          => SOAP_ENCODED,
        ]
    );

    // Set the values for the array
    $params = [
        'partnerid'    => 1234,
        'signkey'      => 'abcdefghijklmnopqrstuvwxyz0123456789',
        'username'     => 'johndoe',
        'password'     => 'secret',
        'email'        => 'john.doe@example,com',
        'company'      => 'ACME',
        'street'       => 'Main Road 47',
        'zipcode'      => '54321',
        'city'         => 'Racoon City',
        'state'        => 'UC',
        'country'      => 'US',
        'language'     => 'en',
        'vat'          => '',
        'phone'        => '5552368',
        'confirmation' => true,
    ];

    // Call the SOAP method
    $result = $client->EditAccount($params);

    // Display the result
    // Status Code
    echo "Status: ".$result['status']."<br>";
    // Message
    echo "Message: ".$result['message']."<br>";
} catch (SoapFault $e) {
    echo 'Error: '.$e->getMessage();
}
<?php
/* URL to Sedo's API */
$baseUrl = 'https://api.sedo.com/api/v1/EditAccount?';

/* API function parameters */
$params = [
    'partnerid'     => 1234,
    'signkey'       => 'abcdefghijklmnopqrstuvwxyz0123456789',
    'username'      => 'johndoe',
    'password'      => 'secret',
    'output_method' => 'xml',
    'email'         => 'john.doe@example,com',
    'company'       => 'ACME',
    'street'        => 'Main Road 47',
    'zipcode'       => '54321',
    'city'          => 'Racoon City',
    'state'         => 'UC',
    'country'       => 'US',
    'language'      => 'en',
    'vat'           => '',
    'phone'         => '5552368',
    'confirmation'  => true,
];

/* build request URL */
$request = $baseUrl . http_build_query($params);

/* fire API request */
$fp = @fopen($request, 'r');

/* read response line by line */
while (!@feof($fp)) {
    echo fread($fp, 4096);
}

/* close the connection */
fclose($fp);

For a successful request, you will receive an XML document as response in this format:

<?xml version="1.0" encoding="UTF-8"?>
<SEDOEDITACCOUNT ver="1.0">
    <status type="xsd:string">Axxx</status>
    <message type="xsd:string">xxxx</message>
</SEDOEDITACCOUNT>

For an unsuccessful request, you will receive an XML document as response in this format:

<?xml version="1.0" encoding="UTF-8"?>
<SEDOFAULT ver="1.0">
    <faultcode type="xsd:string">Exxx</faultcode>
    <faultstring type="xsd:string">xxxxxx</faultstring>
</SEDOFAULT>
// Create package sedoapi:
// java org.apache.axis.wsdl.WSDL2Java -av -p sedoapi https://api.sedo.com/api/v1/?wsdl

import sedoapi.*;
import org.apache.axis.AxisFault;

public class SedoEditAccount
{
    public static void main(String[] args) throws Exception
    {
        sedoapi.SedoInterfaceServiceLocator locator = new sedoapi.SedoInterfaceServiceLocator();
        sedoapi.SedoInterfacePortType port = locator.getSedoInterfacePort();

        try {
            EditAccountRequest request = new EditAccountRequest();

            request.setPartnerid(1234);
            request.setSignkey("abcdefghijklmnopqrstuvwxyz0123456789");
            request.setUsername("johndoe");
            request.setPassword("secret");
            request.setEmail("john.doe@example.com");
            request.setCompany("ACME");
            request.setStreet("Main Road 47");
            request.setZipcode("54321");
            request.setCity("Racoon City");
            request.setState("UC");
            request.setCountry("USA");
            request.setLanguage("en");
            request.setVat("");
            request.setPhone("5552368");
            request.setConfirmation(true);

            EditAccountResponse response = port.editAccount(request);

            System.out.println("Status: " + response.getStatus());
            System.out.println("Message: " + response.getMessage());
        } catch (AxisFault fault) {
            System.err.println("Faultcode : " + fault.getFaultCode());
            System.err.println("Faultstring : " + fault.getFaultString());
        }
    }
}