See also the Braintree_DocumentUpload response object.

availability

The ability to upload documents via the API is currently in a limited release, and the API is subject to change.

Parameters
'file' required, file

The binary data of the file to upload. Only png, jpg, jpeg, or pdf files are supported.

'kind' required, multiple

The type of uploaded document. Value should always be EVIDENCE_DOCUMENT.

Examples

PHP
Copy
Copied
$result = Braintree\DocumentUpload::create([
  'kind' => Braintree\DocumentUpload::EVIDENCE_DOCUMENT,
  'file' => fopen('local_file.pdf', 'rb')
]);

if($result->success) {
  # document successfully uploaded
  $document = $result->documentUpload;
} else {
  echo $result->errors;
}

Still have questions?

If you can’t find an answer, contact our Support team.