API v1 Reference

Subscription Webhooks

Subscriptions are the means by which NeonCRM systems are connected to third-party applications. Neon One manages these subscriptions.

When a NeonCRM customer subscribes to a third-party application, Neon One sends a webhook notification containing information about the NeonCRM customer to the third-party app. This notification includes API credentials that can be used by the third-party application to create its own connection directly to the NeonCRM system using the standard NeonCRM API.

Webhooks are fired when there are changes to the status of any subscription to a third-party application. A third-party application should listen for these webhooks and take appropriate action when they are received.

Subscriptions can have one of three statuses:

Active
The subscription is active. A user should expect the connection between NeonCRM and your application to be operational.
Suspended
The subscription has been deactivated temporarily. There is the possibility that the subscription may be reactivated at a later time. When a subscription is suspended, you may suspend functionality of your application but you should not remove any user data or custom objects.
Cancelled
A cancelled subscription can be considered to be terminated permanently. At this point you can safely uninstall any proprietary user data or custom objects from a subscriber’s NeonCRM system.

Webhooks

Neon One sends three types of webhook notifications:

  • Subscription Created
  • Subscription Updated
  • Subscription Cancelled

You can choose to receive them all at the same URL endpoint or you can send each type to a different URL endpoint.

Subscription Created

This webhook is triggered the first time a new subscription to your app has been added. You will not receive this notification if a suspended subscription is reactivated (you will receive the subscriptionUpdated webhook in that situation).

This is your only opportunity to capture a subscriber’s organization ID and API key.

Example


{  
   "action":"subscriptionCreated",
   "subscription":{  
      "id":66,
      "started_at":1498003200,
      "ended_at":null,
      "status":"Active",
      "instance":{  
         "org_id":"test",
         "api_key":"47c467f60f81645678020869b4126cf3a2489"
      }
   },
   "custom_parameters":{  
      "my_secret_key":"12345abcdef"
   },
   "timestamp":1498076847
}

Subscription Updated

This webhook is triggered when a subscription is suspended or reactivated.

Example


{  
   "action":"subscriptionUpdated",
   "subscription":{  
      "id":66,
      "started_at":1498003200,
      "ended_at":null,
      "status":"Suspended",
      "instance":{  
         "org_id":"test"
      }
   },
  "custom_parameters":{  
      "my_secret_key":"12345abcdef"
   },
   "timestamp":1498077018
}

Subscription Cancelled

This webhook is triggered when an existing subscription is cancelled.

Example


{  
   "action":"subscriptionCancelled",
   "subscription":{  
      "id":66,
      "started_at":1498003200,
      "ended_at":1498003200,
      "status":"Cancelled",
      "instance":{  
         "org_id":"test"
      }
   },
   "custom_parameters":{  
      "my_secret_key":"12345abcdef"
   },
   "timestamp":1498077167
}