# Print Fulfilment Service

If you only require specific print fulfilment related functionality, you can import the `PrintFulfilment` module separately to the main SDK.

For example:

```javascript
const { PrintFulfilment } = require('n-membership-sdk');
const printFulfilmentSdk = new PrintFulfilment(config);
```

## Table of Contents

* [Config](#config)
	* [How to obtain a key](#how-to-obtain-a-key)
* [Methods](#methods)
	* [getOptions](#getOptions)

## Config

* See common configuration options in the [README file](./README.doc)
* `printFulfilmentApiKey`

```javascript
const config = new ProductionConfiguration({
	printFulfilmentApiKey: 'secret'
});
```

### How to obtain a key

Do one of the following:

1. Check in Doppler for your app to see if the API key you need already exists.
2. Contact #membership-support slack channel for a key for the service i.e. newspaper-fulfilment-options-svc.

## Methods

### getOptions

```javascript
const fulfilmentOptions = printFulfilmentSdk.getOptions(countryCode, postcode, productCode);
```

| Parameters   | Required | Type   | Example | Description   |
| ------------ | -------- | -------| --------| ------------- |
| countryCode  | yes      | String | GBR     | Three letter ISO 3166-1 country code |
| postcode     | yes      | String | SE19HL  | User's delivery postcode |
| productCode  | yes      | String | N6D     | The type of product the user is purchasing - N6D (6 days a week), N5D (5 days a week) or NWE (weekends)  |
| addressType  | no       | String | default | There are two options: `default` when its a regular Mo-Fr and Sat delivery address, and `weekend` when the user wants to have different Mo-Fr and Sat delivery addresses.  |

**Response**: Array of [Fulfilment Options](../../src/models/fulfilment-option.ts)
