skip to Main Content

I’m using the eBay API and am trying to receive the following notifications:

  • ItemSold
  • FixedPriceTransaction
  • EndOfAuction

However, the only notification I receive is ‘FixedPriceTransaction’.

The code I’m using to ‘set’ what notifications I receive, looks like this:

    $opts = array(
        'ApplicationDeliveryPreferences' => array(
            'ApplicationEnable'  => 'Enable',
            'ApplicationURL'     => 'http://my.domain/ebay_notifications.php',
        ),
        'UserDeliveryPreferenceArray' => array(
            'NotificationEnable' => array(
                'EventType'   => 'ItemSold',
                'EventEnable' => 'Enable'
            ),
            'NotificationEnable' => array(
                'EventType'   => 'EndOfAuction',
                'EventEnable' => 'Enable'
            ),
            'NotificationEnable' => array(
                'EventType'   => 'FixedPriceTransaction',
                'EventEnable' => 'Enable'
            )      
        )
    );

Any idea what I’m doing wrong?

2

Answers


  1. Chosen as BEST ANSWER

    Schoolboy error on my account.

    The 'UserDeliveryPreferanceArray' array contains multiple arrays.

    All of them have the same key title: 'NotificationEnable'

    This means only the last one is used - the one containing the 'FixedPriceNotification' event.

    To remedy this, make each 'notification event' part of an indexed array:

    'NotificationEnable' => array(
    
                    1   =>  array(
                        'EventType'   => 'ItemSold',
                        'EventEnable' => 'Enable' 
                    ),
    
                    2   =>  array(
                        'EventType'   => 'EndOfAuction',
                        'EventEnable' => 'Enable' 
                    ),
    
                    3   =>  array(
                        'EventType'   => 'FixedPriceTransaction',
                        'EventEnable' => 'Enable' 
                    )
                )
    

    Happy days.


  2. Ok, maybe i am wrong but the working code should be:

    $opts = array(
        'ApplicationDeliveryPreferences' => array(
            'ApplicationEnable'  => 'Enable',
            'ApplicationURL'     => 'http://my.domain/ebay_notifications.php',
        ),
        
            'NotificationEnable' => array(
    
                1   =>  array(
                    'EventType'   => 'ItemSold',
                    'EventEnable' => 'Enable' 
                ),
    
                2   =>  array(
                    'EventType'   => 'AskSellerQuestion',
                    'EventEnable' => 'Enable' 
                ),
    
                3   =>  array(
                    'EventType'   => 'FixedPriceTransaction',
                    'EventEnable' => 'Enable' 
                )
                
        )
    );
    

    And not as I thought:

    $opts = array(
        'ApplicationDeliveryPreferences' => array(
            'ApplicationEnable'  => 'Enable',
            'ApplicationURL'     => 'http://my.domain/ebay_notifications.php',
        ),
        'UserDeliveryPreferenceArray' => array(
            'NotificationEnable' => array(
    
                1   =>  array(
                    'EventType'   => 'ItemSold',
                    'EventEnable' => 'Enable' 
                ),
    
                2   =>  array(
                    'EventType'   => 'EndOfAuction',
                    'EventEnable' => 'Enable' 
                ),
    
                3   =>  array(
                    'EventType'   => 'FixedPriceTransaction',
                    'EventEnable' => 'Enable' 
                )
            )
    );
    

    The first one seems to work well so far. The last one generates 37 errors.
    Thank you anyways for your huge suggestion.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search