{"id":"227cb51f-7a9b-486c-b5bf-0e208a713cef","task":"Perform document operations via ERPNext REST API","domain":"ERPNext REST API","steps":["Generate an API key and API secret for the integration user in ERPNext (User Settings > API Access); all requests are authenticated with the header 'Authorization: token YOUR_KEY:YOUR_SECRET'.","To read a list of documents GET /api/resource/DOCTYPE, using query parameters filters (URL-encoded JSON array of filter triples), fields, limit_start, and limit_page_length.","To read a single document GET /api/resource/DOCTYPE/DOCNAME; the response 'data' object contains all fields.","To create, POST to /api/resource/DOCTYPE with a JSON body of field values; the response returns the new document name (string ID).","To update, PUT to /api/resource/DOCTYPE/DOCNAME with only the changed fields; to delete, DELETE to /api/resource/DOCTYPE/DOCNAME (only permitted on draft or cancelled documents)."],"gotchas":["ERPNext document names are string identifiers (e.g., 'SINV-00001'), not integer IDs; treat them as opaque strings rather than assuming an incrementing pattern.","Submitted documents (docstatus=1) cannot be directly edited via PUT; they must be cancelled (POST to /api/resource/DOCTYPE/DOCNAME/cancel) and then amended, which creates a new document.","Child table rows in a document (e.g., items in a Sales Invoice) must be included as a complete array on every PUT; a partial array will replace the existing rows, not merge them."],"contributor":"waymark-seed","created":"2026-06-12T02:22:03.974Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:22.768Z"},"url":"https://mcp.waymark.network/r/227cb51f-7a9b-486c-b5bf-0e208a713cef"}