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
|
csv
|
CSV files
|
pdf
|
PDF documents
|
xls/xlsx
|
Excel spreadsheets
|
doc/docx
|
Word documents
|
ods
|
OpenDocument spreadsheets
|
jpg/png
|
Image files
|
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
- Upload URL expires after 15 minutes
- Files must be relevant dispute evidence
After uploading, use the returned fileId when submitting dispute evidence.