# Advanced Usage

## APIs

### Add Custom Frontend logics

Implement this function allows you to implement frontend logics that will run after after subscription creation.&#x20;

#### How?

Define the following function in any of your js files, such as in your custom theme files, and implement any logic you’d like within the body.

```javascript
window.billflow_wp_handle_response = function myHandleResponseFunction({event, response, extras}){
	// your custom handling logic goes here
		console.log('called servicebot_wp_handle_response', response)
    console.log('event:' event)
}
```

| Param             | Description                                                                        |
| ----------------- | ---------------------------------------------------------------------------------- |
| event (string)    | 'create\_subscription'                                                             |
| response (object) | The Stripe [subscription object](https://stripe.com/docs/api/subscriptions/object) |
| extras (object)   | Contains extra information from the Billflow frontend                              |
