Introduction
Customer SKU Purchase Web Hook Notification Action allows you receive notifications when an SKU is purchased by a customer through the in app purchase API.
Configuration
- To enable this option, first configure a Web Hook with the correct values for your service.
- Then go to the application to assign the web hook action by navigating to ECOMMERCE and then SKUS.
- Select the app associated with the SKU.
- Click on the Edit icon for the SKU.
- Click on the WebHook tab
- Select the web hook to use when events occur for this SKU.
- If you are finished, click on the Save button to save your changes and Cancel to discard changes.
NOTE: To clear the action, select the Clear this web hook on save option and then click Save. This will remove the web hook from this SKU.
Notification Examples
When an SKU is purchased or cancelled, and the web hook is configured, the following payload will be sent:
If using JSON
{ :payload=>{ :action=>"purchased", :customer=>{ "id"=>"5730877cdb8fe936c50000e2", "email"=>"chris@app47.com", "name"=> "Chris S",
"devices" => [ {
"unique_identifier" => "avadf22fa",
"model" => "SX6",
"manufacture" => "Samsung" } ]
}, :purchase=>{ "order_id"=>"Test-1466528612", "name"=>"Unlimited coins", "purchase_time"=>1466528612, "status"=>"Purchased", "purchase_token"=>"57697364db8fe908350007a4"}, :type=>"customer_purchase", :epoch_timestamp=>1466528612 }, :md5=>"131aasdf12309jafsd0f9dasdfas"}
If using XML
<notification> <payload> <action>purchased</action> <customer> <id>5730877cdb8fe936c50000e2</id> <email>chris@app47.com</email> <name>Chris S</name>
<devices>
<device>
<unqiue_identifier>avadf22fa</unique_identifier>
<model>SX6</model>
<manufacture>Samsung</manufacture>
</device>
</devices> </customer> <purchase> <order_id>Test-1466528612</order_id> <name>Unlimited Coins</name> <purchase_time>1466528612</purchase_time> <status>Purchased</status> <purchase_token>57697364db8fe908350007a4</purchase_token> </purchase> <type>customer_purchase</type> <epoch_timestamp>1466528612</epoch_timestamp> </payload> <md5>131aasdf12309jafsd0f9dasdfas</md5> </notification>
Using the JSON example, the field definitions are described below:
-
payload - The notification payload
-
action - The action associated with the notification, at this time it is either purchased or canceled
-
customer - customer information
-
id - internal id of the customer
-
email - email address of the customer
-
name - name of the customer
- devices - list of devices associated with the customer
- unique_identifier - Unique identifier for the device, the ID received from the Android OS.
- model - Model name returned by Android OS
- manufacture - Manufacture name returned by Android OS
-
-
purchase - purchase information
-
order_id - internal id for the purchase
-
name - name of the product purchased
-
purchase_time - the number of seconds since epoch when the item was purchased
-
status - Current status of the purchase, same as “action”
-
purchase_token - Unique token for the purchase
-
-
type - type of notification
-
epoch_timestamp - the number of seconds since epoch the notification was sent
-
-
md5 - md5 hash of the payload
Comments
0 comments
Please sign in to leave a comment.