AttachmentsLink Receipt or Invoice

Link Receipt or Invoice

Creates an attachment record linked to a transaction and returns a presigned S3 URL for direct file upload.

2-step flow:

  1. Call this endpoint with file metadata and the transaction ID — returns the attachment id and the uploadUrl.
  2. PUT the file binary to uploadUrl directly to S3 (not through the API).

The returned id can be used in Download attachment once the upload completes.

Idempotency: this endpoint does not support the Idempotency-Key header. Each call creates a new attachment record — a transaction can have multiple linked attachments.

curl -X POST "https://api-sandbox.contasimples.com/attachments/v1" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "transactionId": "111304",
  "file": {
    "name": "invoice.pdf",
    "contentType": "PDF"
  },
  "description": "Invoice for the purchase"
}'
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "PROCESSING",
  "referenceId": "111304",
  "file": {
    "name": "invoice.pdf",
    "contentType": "PDF"
  },
  "description": "Invoice for purchase",
  "createdAt": "2026-06-25T22:54:52.000Z",
  "uploadUrl": "https://s3.amazonaws.com/bucket/key?X-Amz-Signature=..."
}
POST
/attachments/v1
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Bearer token from OAuth 2.0 client credentials. Format: Bearer TOKEN

Bearer token from OAuth 2.0 client credentials. Format: Bearer TOKEN
Content-Typestring
Required

The media type of the request body

Options: application/json
transactionIdstring
Required

ID of the transaction to link the document to. Corresponds to the id field returned by Banking statement (numeric — send its value as a string) or by Credit card statement (ULID).

descriptionstring

Document description (optional).

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Bearer token from OAuth 2.0 client credentials. Format: Bearer TOKEN

Body

application/json
transactionIdstring
Required

ID of the transaction to link the document to. Corresponds to the id field returned by Banking statement (numeric — send its value as a string) or by Credit card statement (ULID).

Example:
111304
fileobject
Required
descriptionstring

Document description (optional).

Example:
Invoice for the purchase

Responses