When an intermediary payment is TM_PASSED and you have paid the recipient, you confirm the payout. A confirmation carries text, a document, or both. A document goes in three calls. The two API calls use your server login with ?programId=; the upload itself goes to the returned URL with only the headers it gives:
A text-only confirmation skips the first two. The release to your receiving account starts when the confirmation is accepted, whether or not you attached a document.

1. Ask where to upload

The answer is 201:
Upload URLs are only issued while the payment is TM_PASSED (state AWAITING_CONFIRMATION); otherwise the answer is 409 INTERMEDIARY_STATE_CONFLICT with data.currentState. A type or size your program does not accept is refused here, before anything is uploaded: 422 DOCUMENT_TYPE_NOT_ALLOWED or 422 DOCUMENT_TOO_LARGE. Every call returns a new URL and a new documentUrl. Ask for a new one rather than reusing an old one.

2. Upload the file

PUT the file’s bytes to uploadUrl, as the raw request body, with every header in headers, exactly as returned:
A 200 with an empty body means the file is stored. The file name in Content-Disposition is the one you sent, cleaned: only the last path segment, its extension dropped, every run of characters other than A-Z a-z 0-9 . _ - replaced by -, cut to 80 characters (or document if nothing is left), and the extension set by the content type. The upload URL is valid for 15 minutes (expiresAt). After that, or if a header differs, the storage service answers 403 with an XML error such as SignatureDoesNotMatch or Request has expired. Ask for a new upload URL and upload again. An upload is kept for 7 days; confirm before then.

Types and sizes

Unless your program has agreed different limits: The maximum size is 10 MB (10485760 bytes). One document per confirmation.

3. Confirm

Send text, documentUrl, or both. Neither is 400 CONFIRMATION_EMPTY. The answer is 202 with state: "CONFIRMED", and the release follows.
text, payoutReference and paidOutAt are shown to the customer. Keep other customers’ data and your internal notes out of them. The document is not shown to the customer: their view only says that one exists.

The documentUrl

Send the documentUrl exactly as step 1 returned it. It is accepted only if:
  • it is the s3:// form, unchanged: no https:// link, no query string or fragment, no added or encoded slashes (%2F), no backslashes, and at most 1024 characters;
  • it points into this payment’s upload folder, for your program and the environment of your token. A documentUrl issued for another payment, or in sandbox for a live payment, is refused.
Any of these is 400 DOCUMENT_URL_INVALID. After those checks the file itself is checked: A refused confirmation changes nothing and is not stored against its Idempotency-Key. Fix it and send it again under the same key, or under a new one if that answers 409 IDEMPOTENCY_KEY_REUSED.

Idempotency

Idempotency-Key (a UUID) is required. “Same” means the same text, payoutReference, paidOutAt and document.

What happens to the document

The file is copied, at the version you uploaded, to write-once storage, and that copy is the evidence on the payment. Documents are scanned for malware, and Orenda staff can open one only once it has been found clean. Release does not wait for the scan.