File
Overview
Upload and manage files for dispute evidence and other documentation needs. The API supports common file formats and provides secure upload URLs.
Supported operations:
File Object
Property
|
Description
|
id Type: string |
Unique identifier for referencing the file |
type Type: filetype [Enum] |
File format (jpg, pdf, etc.)
|
purpose Type: filePurpose [Enum] |
Intended use (e.g., disputeEvidence) |
size Type: int |
File size in bytes
|
uploadTimestamp Type: dateTime |
Upload time in ISO 8601 format
|
url Type: String |
Download URL for the file
|
urlExpirationTimestamp Type: dateTime |
URL expiration time
|
Enum
filePurpose
Value
|
Description
|
disputeEvidence
|
The file provided will be used as a dispute evidence
|
Upload files
The API provides a two-step process to upload files securely.
Step 1: Get Upload URL
First, request a secure upload URL:
Request
Request body
{
"type" : "jpg",
"purpose" : "disputeEvidence"
}
Request parameters
Name
|
Location
|
Description
|
x-amz-pay-idempotency-key (required) Type: String |
Header
|
Unique key to prevent duplicate uploads. For detailed guidance on creating and using idempotency keys, see Idempotency.
|
type Type: String |
Body
|
File format (jpg, png, pdf)
|
purpose Type: String |
Body
|
Upload reason (disputeEvidence)
|
Supported file types
fileType |
Description |
Content-Type |
csv |
CSV files |
text/csv |
pdf |
PDF documents |
application/pdf |
xls/xlsx |
Excel spreadsheets |
application/vnd.ms-excel (xls) application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (xlsx) |
doc/docx |
Word documents |
application/msword (doc) application/vnd.openxmlformats-officedocument.wordprocessingml.document (docx) |
ods |
OpenDocument spreadsheets |
application/vnd.oasis.opendocument.spreadsheet |
jpg/png |
Image files |
image/jpeg (jpg) image/png (png) |
Response
The API returns:
{
"id": "file_sdcjscbjckndjhckj", // APay File ID generated from request
"type" : "jpg",
"purpose": "disputeEvidence",
"uploadTimestamp": 20190714T155300Z,
"url": "https://pay-api.amazon.com/v1/files/file_sdcjscbjckndjhckj/contents",
"urlExpirationTimeStamp: 20190714T155300Z
}
Step 2: Upload your file
Send your file to the returned URL:
curl "YOUR_PRESIGNED_URL" \
-X PUT \
-H "Content-Type: application/pdf" \
-T "/path/to/file"
File Requirements:
- Maximum size: 2MB
- Files must be relevant dispute evidence
After uploading, use the returned fileId when submitting dispute evidence.