Sync Records
/api/search/records/syncReplaces all the calling plugin's searchable records of the store, a page of at most 500 at a time: send every page with the same generation, and done: true with the last. Records written since the first page of the generation, by it or by SaveRecords, stay; the rest are removed once it is done. A page can be retried, and a resync abandoned midway removes nothing; a new generation starts over, and a page of an earlier one sent after it only writes its records. Use it to fill search with records written before the plugin wrote them as they changed, or to repair it.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Names one resync: every page of it carries the same, and a new resync a new one.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$items <= 500Marks the last page: the plugin's records this resync did not write are removed.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/search/records/sync" \ -H "Content-Type: application/json" \ -d '{ "generation": "string", "records": [ { "id": "string", "title": "string", "target": { "type": "page" } } ], "done": true }'Save Records PUT
Makes records of the calling plugin searchable in the store's dashboard search, or updates them, at most 500 a call. Write a record when it is created or changes; the dashboard shows what was written last, so a call can be retried whole. Titles and subtitles are shown as plain text: whitespace runs collapse to one space, control and direction-override characters are dropped, and text past 120 (title) or 160 (subtitle) characters is cut with "…". A record targeting a product or order the store does not have is refused with SearchTargetNotInStore, writing nothing.
Current GET
The customer the storefront visitor whose request the calling plugin handles is signed in as: their id, their email and whether they verified it. Null for a guest, an expired session, a customer the store no longer has, and every invocation the storefront did not mint for a visitor's request to the plugin's public routes, such as a webhook's. The customer comes from the invocation token, never from the request. Requires the store to have granted the plugin customers:read.
