Skip to content
Navigation

Sherpo merchant API

Rich text fields take HTML in a closed format; anything else is refused as invalid, naming the field's path and the reason, so fix it and retry. Allowed: p, h1 (Title), h2 (Heading), h3 (Subheading), br; marks strong, em, u, s, sup, sub, code (b as strong, i as em, del as s, strike as s); a with href (http, https, mailto, tel, ftp, ftps, callto, sms, cid, xmpp, irc, ircs or a relative path), target="_blank"; span with style color or background-color (#rgb or #rrggbb); style text-align (left, center, right, justify) on p and h1 to h3; ul; ol (start); li (data-checked="true" or "false" for a task list); table, thead, tbody, tr, th, td (colspan, rowspan); pre with one code (class="language-<id>", the id one of bash, c, cpp, csharp, css, go, xml, java, javascript, json, kotlin, markdown, php, python, ruby, rust, sql, swift, typescript, yaml); blockquote; hr; details (open) with its summary first; figure with at most one figcaption, first or last; a link's rel (noopener, noreferrer, nofollow) is read and never stored. Images, videos, audio, slideshows, formulas, diagrams, downloads and other blocks are <block type="…" props="{…JSON…}"></block> elements (no raw img or video); which types a field takes is in its description. getBodySchema answers each block's props, their values and which are required, for every kind of body; a block with an unknown type, an unknown prop or a value outside its set is refused, naming the block and what the prop takes. Refused: any other tag, attribute or style (div, section, img, iframe, script, comments…), a link or a block inside a link, a figure inside a figure. At most 1 MiB of UTF-8 (and each field's own limit), markup nested at most 32 deep, tables covering at most 10000 cells in all (each its rows times its widest row, spans counted). Reads return the stored canonical form, wrapped in <rich-text version="1">; send it back as it is to keep a text. To write Markdown instead, set text_format to "markdown": each text, up to 64 KiB, is converted into the format, raw HTML in it kept, a $$ fence or a paragraph that is one $$ … $$ line a formula block (a fence nothing closes stays text), and a mermaid fence a diagram block (one of a type the store's page doesn't draw, or that the diagram rules refuse, stays code; one that still can't be drawn, or past 10 new diagrams in a save, is refused), and validated the same way; a Markdown image is refused, since an image is a block. Example:

Welcome

Start with the intro, then read the notes.

  • Watch the intro

  • Take the quiz

Why it works

Short lessons stick.

The guide: https://api.sherpo.io/merchant/docs/text.

store

product

price

entry

custompage

file

transaction

Next: endpoints 133-281 of 292

Type to search…

↑↓ navigate↵ selectEsc close