Upload document contents
/documents/{document_id}/uploadUploads the binary contents for a document. The document must be created first with POST /documents.
The body must be exactly the content_length bytes declared when the document was created. The Content-Type header of this request replaces the content_type given at creation. The request body can be up to 50 MB, but dispute evidence submissions only accept documents within the processor's limits (10 MB and 50 pages by default).
After the upload the document is scanned (pending) and then becomes active or rejected.
Headers
AuthorizationstringRequiredidempotency-keystringA unique key, such as a UUID, that makes a POST or DELETE request safe to retry. Pay.com keeps each key for 24 hours, separately for each workspace.
- A retry with the same key, endpoint and body gets the first request's stored status and body, without running the request again.
- If the first request is still being processed, a retry gets 409
idempotency_error(request_in_progress). - The same key on another endpoint, or with another body, gets 400
idempotency_error(invalid_parameters). - GET, PUT and PATCH requests ignore the key.
The response repeats the key in its Idempotency-Key header.
Content-TypestringRequiredThe MIME type of the file being uploaded. Any type is accepted and replaces the document's content_type.
Content-LengthintegerRequiredThe size of the file in bytes. Must equal the document's content_length.
Path parameters
document_idstringRequiredUnique identifier for the document.
Parameters
Returns
Document uploaded successfully.
Errors
400401invalid_key, invalid_token, legacy_keys_ended, legacy_keys_off or permission_denied).403resource_not_allowed, key_disabled, network_not_allowed, pci_required or merchant_required), or this resource isn't enabled for your account (permission_denied). code says why.404409idempotency-key is still being processed (request_in_progress). Wait, then retry with the same key.413500503Retry-After, or after a few seconds when there's none.