# Migration v16

Contains 1 breaking change of the SDK interface.

## Changes

- [change to createSubscription ](#change-to-createSubscription)

### change to createSubscription

In order to integrate with ravelin, we need to pass a new parameter to all createSubscription requests.
This changes the calls to createSubscription.

```diff
-	const subscription = await createSubscription(user, paymentOptions, deliveryAddress);
+	const subscription = await createSubscription(user, paymentOptions, ravelinDeviceId, deliveryAddress);
```

`deliveryAddress` remains an optional parameter but `ravelinDeviceId` is required.  

Ravelin device id is generated by ravelin client javascript code and saved as a browser cookie.  
If not available (when calling programatically), any non-null random string should work against test environment.  
```
const ravelinDeviceId: 'xxxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxxx'
const subscription = await createSubscription(user, paymentOptions, ravelinDeviceId, deliveryAddress);
```

### Where does `ravelinDeviceId` come from?

Ravelin is a fraud detection tool, they provide a library that needs to be added to the client to generate some cookies (this is where ravelin device id comes from, we simply read from the generated cookies).
Official documentation: https://developer.ravelin.com/libraries-and-sdks/overview/#device-id

Ravelin support team can be found on slack on this channel: https://financialtimes.slack.com/archives/CLLBELNR5 (#support-ft)

Usage example can be found in next subscribe:
- adding the script to the client: https://github.com/Financial-Times/next-subscribe/pull/1406 and https://github.com/Financial-Times/next-subscribe/pull/1636
- get the device id from cookies and pass it to the sdk: https://github.com/Financial-Times/next-subscribe/pull/1386
