Introduction
Customer App Purchase Web Hook Notification Action allows you receive notifications when an app is purchased by a customer.
Configuration
Enabling the Notification Action
- 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 clicking on the Edit link in the App Store→My Apps view.
- Click on the WebHook tab
- Select the web hook to use when events occur for this application.
- Click on the Save.
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 app.
Notification Examples
When an app 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"
}, :purchase=>{ "order_id"=>"Test-1466528612", "name"=>"Life Saver", "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>
</customer> <purchase> <order_id>Test-1466528612</order_id> <name>Life Saver</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.