xero.receipts.create-receipt-attachment-by-file-name ​
Creates an attachment on a specific expense claim receipts by file name
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-xero |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
base_url | string | Yes | — | Xero API root, e.g. https://<host>/api |
api_token | string | No | — | Bearer token; omit to use the workflow's token env var |
xero_tenant_id | string | Yes | — | Xero identifier for Tenant |
idempotency_key | string | No | — | This allows you to safely retry requests without the risk of duplicate processing. 128 character max. |
receiptid | string | Yes | — | Unique identifier for a Receipt |
filename | string | Yes | — | Name of the attachment |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
base_url | string | Yes | — | Xero API root, e.g. https://<host>/api |
api_token | string | No | — | Bearer token; omit to use the workflow's token env var |
xero_tenant_id | string | Yes | — | Xero identifier for Tenant |
idempotency_key | string | No | — | This allows you to safely retry requests without the risk of duplicate processing. 128 character max. |
receiptid | string | Yes | — | Unique identifier for a Receipt |
filename | string | Yes | — | Name of the attachment |
status_code | integer | No | — | HTTP status code of the completed call |
response | json | No | — | Parsed JSON response body |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_at | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
failed_at_state | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | Waiting to call PUT /Receipts/{ReceiptID}/Attachments/ |
completed | No | Yes | Yes | — | HTTP call succeeded |
failed | No | Yes | No | — | HTTP call failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | Perform PUT /Receipts/{ReceiptID}/Attachments/ |
* (any state) | fail | failed | Record the failure reason |
Outcomes ​
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
completed | SUCCESS | The provider accepted the request | status_code, response |
failed | FAILURE | The provider rejected the request or was unreachable | failure_reason, failure_type, status_code |
Business Errors ​
| Code | Message Template |
|---|---|
HTTP_AUTHENTICATION_FAILED | The provider rejected the credential (HTTP {status_code}) |
HTTP_AUTHORIZATION_FAILED | The credential is not permitted to perform this operation (HTTP {status_code}) |
HTTP_NOT_FOUND | The provider has no resource at {path} (HTTP 404) |
HTTP_RATE_LIMITED | The provider rate-limited this request (HTTP 429) |
HTTP_REQUEST_FAILED | The provider returned HTTP {status_code} for {method} |
HTTP_RESPONSE_SHAPE_UNEXPECTED | The provider response for {method} {path} could not be parsed as JSON |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "xero.receipts.create-receipt-attachment-by-file-name",
"initial_data": {
"base_url": "value",
"xero_tenant_id": "value",
"receiptid": "value",
"filename": "value"
}
}