Add or edit a note with attachments
A note on a contract also raises a webhook so an integration can react to the comment.
Where you can do this
Section titled “Where you can do this”- Merchant View: Comments (Save)
Before you start
Section titled “Before you start”- On create, the caller names the record the note belongs to (
reference). - On edit, the note exists. Attachments already on the note stay; adding new ones is this function, removing one is Delete a note or an attachment.
Inputs
Section titled “Inputs”The body is { "note": {... } }.
| Rule | What you see |
|---|---|
The fields go inside a note object: {"note": {... }}. The record itself is identified by the id in the URL, not in the body |
VALIDATION_ERROR: “API body error: missing note object” |
| A new note must name the record it belongs to | VALIDATION_ERROR: “Reference required” |
A note’s reference cannot be moved: a reference sent on an edit is ignored |
none; the note stays on its original record |
| Merchant View offers Save only when there is text or at least one file | Save control not shown |
| Every attachment needs a file name | VALIDATION_ERROR: “Field fileName is required.” |
| Every attachment needs content | code “error”: “No content” |
An attachment’s media type is always read from its own data:<type>;base64 prefix. A mime_type sent with the attachment is not forwarded to Shuttle, so content that is not such a URI is stored with no type at all and cannot be given one |
none; the attachment reports the type in the prefix, or none |
A note’s linked_object cannot be set. It is returned on every note and accepted on a save, but Shuttle’s note has no such field and the value is recomputed from reference on read; Merchant View sends it back on every edit and it is dropped |
none; linked_object still follows reference |
| Merchant View refuses a comment whose new files exceed about 0.7 MB raw (1 MB once encoded), and shows the message while Save is disabled | inline “Sorry! Your comment including all attachments cannot exceed 1mb”, Save disabled |
| Attachments are added one at a time under a lock on the note; an upload waits up to ten seconds for the lock and holds it for at most fifteen | code INVALID (BOLT-7059) for the upload that timed out; the text and any earlier attachments are already saved |
| Merchant View offers Edit on a comment only to the user who wrote it | author menu not shown |
On the contract screen Merchant View also requires the contract permission (payment_contract) to edit a comment; adding one needs no permission |
control hidden |
Merchant View shows the comments section only when the comments option is on for the merchant view |
section not shown |
What happens
Section titled “What happens”- The note is created (id
no_...) or updated and returned in full:text,reference,edited,public,created,updated, the creating and updating users, andattachments[]each with anid,name,mime_type,sizeand a downloadurl. An edited note reportseditedtrue; the creator is never overwritten. - Files are stored and kept with the note. When
publicis true, the first attachment is reachable without signing in at the note’spublic_url. - A note on a contract raises the
CONTRACT.NOTEwebhook, on create and again on every edit. The event names the contract, not the note. Notes on any other record raise no webhook. - The contract’s audit history gains a
CONTRACT.NOTEentry for each save. (The admin guide states that comments are not part of the audit history; that is true of the note’s content, but a contract note does leave this entry.) - The note appears in the record’s comments immediately; Merchant View reloads the section as soon as the save returns. No email or SMS is sent.
Who can do this
Section titled “Who can do this”- Roles: Admin and Support.
- Admin app: option
commentsshows the section; Edit on a comment is offered only to its author, and on the contract screen only withpayment_contract; on terminal batch screens only while the batch is open.
Related
Section titled “Related”Was this page helpful?
What went wrong?
Thanks for telling us.