Package recombee_api_client :: Package api_requests :: Module add_purchase :: Class AddPurchase
[hide private]
[frames] | no frames]

Class AddPurchase

source code

     object --+    
              |    
request.Request --+
                  |
                 AddPurchase

Adds a purchase of a given item made by a given user.

Instance Methods [hide private]
 
__init__(self, user_id, item_id, timestamp=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'), cascade_create=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'), amount=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'), price=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'), profit=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'), recomm_id=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'))
Required parameters:
source code
 
get_body_parameters(self)
Values of body parameters as a dictionary (name of parameter: value of the parameter).
source code
 
get_query_parameters(self)
Values of query parameters as a dictionary (name of parameter: value of the parameter).
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from request.Request: quote_path_param

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, user_id, item_id, timestamp=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'), cascade_create=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'), amount=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'), price=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'), profit=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'), recomm_id=UUID('2e7d626f-d1f6-446d-83cf-acee643cbcbf'))
(Constructor)

source code 

Required parameters:

Parameters:
  • user_id - User who purchased the item
  • item_id - Purchased item

    Optional parameters:

  • timestamp - UTC timestamp of the purchase as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
  • cascade_create - Sets whether the given user/item should be created if not present in the database.
  • amount - Amount (number) of purchased items. The default is 1. For example if `user-x` purchases two `item-y` during a single order (session...), the `amount` should equal to 2.
  • price - Price paid by the user for the item. If `amount` is greater than 1, sum of prices of all the items should be given.
  • profit - Your profit from the purchased item. The profit is natural in e-commerce domain (for example if `user-x` purchases `item-y` for $100 and the gross margin is 30 %, then the profit is $30), but is applicable also in other domains (for example at a news company it may be income from displayed advertisement on article page). If `amount` is greater than 1, sum of profit of all the items should be given.
  • recomm_id - If this purchase is based on a recommendation request, `recommId` is the id of the clicked recommendation.
Overrides: object.__init__