GuidesAPI ReferenceChangelog
Log In

# Introduction

Our Document Downloads feature provides an easy way for you to download an end-user's original paystub. The document will be provided as an additional field in the `/paystubs` endpoint and there is no additional cost if you're already leveraging the JSON data making the implementation very straightforward.

# Implementation

## Step 1: Subscribe to the webhook event for paystubs documents

Subscribe to the `paystubs.documents.added` webhook using the request below

This webhook will be published when the document is ready to be downloaded. You will get a `paystub.documents.added` webhook for each unique paystub.

**NOTE**: if you are subscribed to the `paystubs.added` event as well, that webhook will be published before the `paystubs.documents.added` event due to the additional processing needed for the document. If you call the `/paystubs` endpoint before receiving the `paystubs.documents.added` webhook, then the `document` object will be returned `null` but the JSON data will still be available.

Note: The `end_user_id` is your internal reference to the end user. See [User Model](🔗) for more information.

## Step 2: Retrieve the document

The document `download_url` can be retrieved using the same `/paystubs` endpoint that you use for the JSON data. The majority of documents will be returned in a PDF formant.

For security purposes, the `download_url` is only active for 15 minutes. As such, we recommend that you download the document as soon as you retrieve the `download_url`. If the `download_url` has expired, calling the `/paystubs` endpoint again will generate a new, active `download_url`.



See the full Paystubs API reference [here](🔗).