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:
1. Ask where to upload
The answer is
201:
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:
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.
The documentUrl
Send the documentUrl exactly as step 1 returned it. It is accepted only if:
- it is the
s3://form, unchanged: nohttps://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
documentUrlissued for another payment, or in sandbox for a live payment, is refused.
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.