API reference › Finance › Documents

Get send-notification PDF attachment options

GET /v1/finance/send-notification-attachment-options

Scope
finance:read

Returns attachment presets and related finance documents for the Send Notification (send-message) flow. Requires query params type and document_id (same shape as finance download/send-email). Admin/scheduler: terminal primary documents (cancelled/void) return 422. Portal client/provider: eligible closed docs return 200 with none-only presets. Use before sending the message so the client can render the attachment picker.

Parameters

Query parameters

NameTypeDescription
type requiredstring

Finance document type

One of: invoice, pro_forma, payable, payment_statement. Example pro_forma.

document_id requiredstring

Finance document ID for the given type

Example PF-001.

Every call also sends Authorization and X-Tenant-ID; see Getting started.

Example request

Shell
curl "https://api.fetchfido.ai/v1/finance/send-notification-attachment-options?type=pro_forma&document_id=PF-001" \
  -H "Authorization: Bearer $FIDO_API_KEY" \
  -H "X-Tenant-ID: $FIDO_TENANT_ID"

Try it

Responses

200 Attachment options retrieved successfully

Attachment options retrieved successfully

JSON
{
  "success": true,
  "message": "Attachment options retrieved successfully.",
  "data": {
    "documentType": "pro_forma",
    "documentId": "PF-001",
    "defaultSelection": "primary_only",
    "supportsRelatedSubset": true,
    "presets": [
      {
        "key": "both",
        "label": "Pro forma and all invoice PDFs",
        "attachableDocuments": [
          {
            "document_type": "invoice",
            "document_id": "INV-001"
          }
        ]
      }
    ],
    "relatedDocuments": [
      {
        "document_id": "INV-001",
        "document_type": "invoice",
        "label": "INV-001",
        "total": 1200
      }
    ]
  }
}
Response fields (18)
FieldTypeDescription
successboolean

Example true.

messagestring

Example Attachment options retrieved successfully..

dataobject
data.documentTypestring

One of: invoice, pro_forma, payable, payment_statement. Example pro_forma.

data.documentIdstring

Example PF-001.

data.defaultSelectionstring

Invoice and payable default to primary_only; pro forma and payment statement default to none.

One of: none, primary_only, related_all, related_subset, both. Example primary_only.

data.supportsRelatedSubsetboolean

True when rollup doc has related children and subset selection applies

Example true.

data.presetsarray of object
data.presets[].keystring

One of: none, primary_only, related_all, both. Example both.

data.presets[].labelstring

Example Pro forma and all invoice PDFs.

data.presets[].attachableDocumentsarray of object
data.presets[].attachableDocuments[].document_typestring

Example invoice.

data.presets[].attachableDocuments[].document_idstring

Example INV-001.

data.relatedDocumentsarray of object
data.relatedDocuments[].document_idstring

Example INV-001.

data.relatedDocuments[].document_typestring

Example invoice.

data.relatedDocuments[].labelstring

Example INV-001.

data.relatedDocuments[].totalnumber (float) or null

Example 1200.

401 Not signed in

Missing, invalid or expired API key.

JSON
{
  "success": false,
  "message": "Invalid API key. Org and user tier keys must send an X-Tenant-ID header naming the organization the key was issued for.",
  "errors": null,
  "code": "API_KEY_MISSING"
}
Response fields (4)
FieldTypeDescription
successboolean

Example false.

messagestring

Example Invalid API key. Org and user tier keys must send an X-Tenant-ID header naming the organization the key was issued for..

errorsany or null

Null on this status.

codestring

Machine-readable reason, for branching on in client code.

One of: API_KEY_MISSING, API_KEY_INVALID, API_KEY_EXPIRED. Example API_KEY_MISSING.

403 Not allowed

Scope, tenant, IP allow-list or RBAC check failed.

JSON
{
  "success": false,
  "message": "You don't have permission to access this endpoint. This API key is missing the 'finance:read' scope.",
  "errors": null,
  "code": ""
}
Response fields (4)
FieldTypeDescription
successboolean

Example false.

messagestring

Example You don't have permission to access this endpoint. This API key is missing the 'finance:read' scope..

errorsany or null

Null on this status.

codestring

Always empty on this status.

Example .

422 Validation failed

Validation error, document not found, or terminal primary document (cancelled/void)

JSON
{
  "success": false,
  "message": "Cannot attach PDF — pro forma PF-001 is in a terminal status.",
  "errors": "Failed to load attachment options"
}
Response fields (3)
FieldTypeDescription
successboolean

Example false.

messagestring

Example Cannot attach PDF — pro forma PF-001 is in a terminal status..

errorsstring

Example Failed to load attachment options.

429 Too many requests

Rate limit exceeded. See Retry-After.

JSON
{
  "success": false,
  "message": "You've exceeded this API key's rate limit of 120 requests per minute. Try again in 37 seconds.",
  "errors": null,
  "code": "RATE_LIMITED"
}
Response fields (4)
FieldTypeDescription
successboolean

Example false.

messagestring

Example You've exceeded this API key's rate limit of 120 requests per minute. Try again in 37 seconds..

errorsany or null

Null on this status.

codestring

Machine-readable reason, for branching on in client code.

One of: RATE_LIMITED. Example RATE_LIMITED.