header

Magento 1.x Software Support Notice

For Magento Commerce 1, Magento is providing software support through June 2020. Depending on your Magento Commerce 1 version, software support may include both quality fixes and security patches. Please review our Magento Software Lifecycle Policy to see how your version of Magento Commerce 1 is supported.

For Magento Open Source 1.5 to 1.9, Magento is providing software security patches through June 2020 to ensure those sites remain secure and compliant. Visit our information page for more details about our software maintenance policy and other considerations for your business.

Account List

Edit this page on GitHub

Module: GiftCard API

Resource: giftcard_account

Method:

Allows you to retrieve the list of available gift card accounts.

Arguments:

Type Name Description
string sessionId Session ID
array filters Array of filters (optional)

Return:

Type Name Description
array result Array of giftcardAccountEntity

The giftcardAccountEntity content is as follows:

Type Name Description
int giftcard_id
Gift card ID
string code
Gift card code
int store_id
Gift card store ID
string date_created
Creation date in the YYYY-MM-DD format
string expire_date
Expiration date in the YYYY-MM-DD format
int is_active
Defines whether the gift card is active
string status
Gift card status
double balance
Gift card balance

Faults:

Fault Code Fault Message
101 Invalid filters specified. Details in error message.

Examples

Request Example SOAP V1
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

$giftcardList = $proxy->call(
    $sessionId,
    "giftcard_account.list"
);
Request Example SOAP V2 (List of All Gift Card Accounts)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy->giftcardAccountList($sessionId);
var_dump($result);
Request Example SOAP V2 (Complex Filter)
$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

// If some stuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');
$complexFilter = array(
    'complex_filter' => array(
        array(
            'key' => 'state',
            'value' => array('key' => 'in', 'value' => '2,1')
        )
    )
);
$result = $client->giftcardAccountList($session, $complexFilter);

var_dump ($result);
Request Example SOAP V2 (WS-I Compliance Mode)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey')); 
 
$result = $proxy->giftcardAccountList((object)array('sessionId' => $sessionId->result, 'filters' => null));   

var_dump($result->result);
Response Example SOAP V1
array
  0 =>
    array
      'giftcard_id' => string '1' (length=1)
      'code' => string 'code' (length=12)
      'store_id' => string '2' (length=1)
      'date_created' => string '2012-04-06' (length=10)
      'expire_date' => string '2012-04-22' (length=10)
      'is_active' => string '0' (length=1)
      'status' => string 'Available' (length=9)
      'balance' => string '300.0000' (length=8)
  1 =>
    array
      'giftcard_id' => string '2' (length=1)
      'code' => string 'code' (length=12)
      'store_id' => string '2' (length=1)
      'date_created' => string '2012-04-09' (length=10)
      'expire_date' => string '2012-04-25' (length=10)
      'is_active' => string '1' (length=1)
      'status' => string 'Available' (length=9)
      'balance' => string '500.0000' (length=8)