Upload a document and associate it with an existing transfer.
A transfer must be created but not finalized.
Mutation
mutation TransferDocumentUpload($file: Upload!, $transferId: UUID!) {
transferDocumentUpload(
file: $file
transfer_id: $transferId
) {
success
}
}Variables
| Variable | Type | Required | Description |
|---|---|---|---|
file | Upload | Yes | The document to upload. |
transferId | UUID | Yes | The ID of the transfer to associate the document with. |
cURL
File uploads use multipart/form-data and the GraphQL multipart request format.
curl --request POST \
--url https://your-graphql-endpoint.com/graphql \
--header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
--header "apollo-require-preflight: true" \
--form 'operations={
"query": "mutation TransferDocumentUpload($file: Upload!, $transferId: UUID!) { transferDocumentUpload(file: $file, transfer_id: $transferId) { success } }",
"variables": {
"file": null,
"transferId": "YOUR_TRANSFER_ID"
}
}' \
--form 'map={
"0": ["variables.file"]
}' \
--form "0=@/path/to/document.pdf"Response
{
"data": {
"transferDocumentUpload": {
"success": true
}
}
}Response Fields
| Field | Type | Description |
|---|---|---|
success | Boolean | Indicates whether the document was successfully uploaded. |