# Creating Transfers in PHP using Guzzle

**URL:** https://discuss.dwolla.com/t/creating-transfers-in-php-using-guzzle/5012
**Category:** API Support
**Created:** [November 19, 2018, 5:29pm UTC](https://discuss.dwolla.com/t/creating-transfers-in-php-using-guzzle/5012 "2018-11-19T17:29:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)
#### Post date: [November 19, 2018, 5:29pm UTC](https://discuss.dwolla.com/t/creating-transfers-in-php-using-guzzle/5012/1 "2018-11-19T17:29:55Z")

</div>

Continuing the discussion from [Activating customers via API](https://discuss.dwolla.com/t/activating-customers-via-api/4945/23):

Following is @spencer’s code sample to create a transfer using Guzzle in PHP.

```
<?php
require 'vendor/autoload.php';
$access_token = '';

$path = realpath('/Path/to/file/someFile.jpeg');
$customerId = 'e528f2be-56f5-4d86-8a79-b854488fd689';

$client = new GuzzleHttp\Client(['base_uri' => 'https://api-sandbox.dwolla.com']);
  $response = $client->post('/customers/' . $customerId . '/documents', [
         'headers' => [
             'Accept' => 'application/vnd.dwolla.v1.hal+json',
             'Authorization' => 'Bearer ' . $access_token,
         ],
         'multipart' => [
             [
                 'name' => 'documentType',
                 'contents' => 'passport'
             ],
             [
                 'Content-type' => 'multipart/form-data',
                 'name' => 'file',
                 'contents' => fopen($path, 'r')
             ]
         ]
     ]);

$response = $response->getHeader('location');
echo $response[0];
?>
```
