Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When creating or editing products on phpFox Store, developer can configure webhook URL in order for phpFox Store to transfer data after having purchases or installation.

Here is the sample call request when having a new purchase:

Code Block
{
  "client_id": "abc123",         // license key
  "endpoint": "http://site.com", // license url
  "client": {
    "email": "client@mail.com",  // user email
    "full_name": "John Doe",
    "first_name": "John",
    "last_name": "Doe"
  },
  "invoice": {
    "id": "123456",          // order id
    "paid": "20",            // actual pay
    "time_stamp": "1528081828",
    "paypal": {
      "id": "tx123",         // transaction id
      "name": "John Doe",
      "paid_to": "expert_paypal@mail.com",  // receiver PayPal email
      "paid_from": "paid_paypal@mail.com"   // sender PayPal email
    }
  },
  "product": {
    "id": "123",                  // product id
    "name": "My App"             // product name
    "type": "Application",       // product type Application, Theme, Language Pack, Package
    "paid": "20"                // product price
  }
}


If you sell a product in our store you can define webhooks, which get executed when a product of yours get gets installed or uninstalled. To define these webhooks log into our store. Manage one of your products and click on Webhooks.

...

Code Block
Array 
( 
    [client_id] => 895a20081f9b4bd525a45dae693f07fa 
    [endpoint] => http://www.localhost.com/ 
    [client] => Array 
        ( 
            [email] => client@email.com
            [first_name] => Raymond 
            [last_name] => Benc 
        ) 

    [product] => Array 
        ( 
            [id] => 1226 
            [paid] => 18 
        ) 

    [auth] => Array 
        ( 
            [id] => 454ddc73ae7e1fef2efc7fa7056d75f5 
            [key] => 89f91f85ace75d1e5a314433e8e09b68 
        ) 

) 
KeyTypeDescription
client_idstringThis is the unique client ID.
endpointstringURL to the clients site.
clientarrayClients details, which include their email, first & last name.
productarrayIncludes what product the client installed and how much they paid (If free, it will be 0).
autharrayThis is the public and private key for your app, which you can identify as a valid webhook coming from our servers.