Project

General

Profile

API - Account

Get account information

URL: /account/
Method: GET

$api_id = 1;
$api_key = 'testpass';
$hostname = 'https://example.com'; // no trailing slash

# fetch data
$url = '/account/';
$post_data = array();
$user_token = 'xxx'; // is required here. Get it from Your DB after Token generation
$extra_headers = array(
    'X-API-ID: ' . $api_id,
    'X-API-Hash: ' . md5($api_key . $url. http_build_query($post_data)),
    'X-User-Token: ' . $user_token
);

header('Content-Type: application/json; charset=utf-8');
echo sendRequest($hostname . $url, $post_data, $extra_headers);

Succes message:

{
    has_error: false,
    messages: {
        section: "account-home" 
    },
    results: {
        customerinfo: {},
        main_address: {},
        lists: []
    }
}

Update account information

URL: /account/
Method: POST

...
$url = '/account/';
$post_data = array(
    'personal_details' => 1,
    'firstname' => 'John',
    'lastname' => 'Doe',
    'telephone1' => '0123456789',
    'address' => '123 Street, 10th floor',
    'main_address_id' => 118071,
    'country' => 181,
    'state' => 9,
    'city' => 13820,
    'gender' => 'm',
    'birthday' => '01',
    'birthmonth' => '01',
    'birthyear' => '1900',
    'promo_sms' => 1,
    'orders_email_notify' => 1,
    'orders_sms_notify' => 1,
);
...

Succes message:

{
    has_error: false,
    messages: [ ],
    results: {
        request_status: "ok",
        request_message: "" 
    }
}

Go to top