See also the 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 EvidenceDocument.

Examples

Ruby
Copy
Copied
result = gateway.document_upload.create(
    {
        "kind": Braintree::DocumentUpload::Kind::EvidenceDocument,
        "file": File.new("path/to/file", "r"),
    }
)

if result.success?
  # document successfully uploaded
  result.document_upload # a Braintree::DocumentUpload object
else
  p result.errors
end
This code snippet now uses gateway instance methods instead of class-level methods. Learn more.

Still have questions?

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