Set Injections
/api/storefront/injectionReplaces the HTML the calling plugin adds to the store's storefront pages: head right before each page's , body right before its , each at most 16384 bytes, placed as given, unescaped. Every storefront page gets it except the checkout, order and subscription renewal pay pages and the pages plugins serve. Each origin list, at most 16 https origins, is added to one directive of those pages' Content Security Policy: scriptOrigins to script-src, connectOrigins (which also takes wss origins) to connect-src, and the optional styleOrigins, fontOrigins, imgOrigins and frameOrigins to style-src, font-src, img-src and frame-src. Pages show the change once core has announced it, which this call does. Idempotent. Uninstalling the plugin, or withdrawing storefront:inject, removes the injection from the pages. Requires the store to have granted the plugin storefront:inject.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
items <= 16items <= 16items <= 16items <= 16items <= 16items <= 16Response Body
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/api/storefront/injection" \ -H "Content-Type: application/json" \ -d '{ "head": "string", "body": "string", "scriptOrigins": [ "string" ], "connectOrigins": [ "string" ] }'Clear Injections DELETE
Removes the HTML the calling plugin adds to the store's storefront pages, and the origins it had admitted. Idempotent. Requires the store to have granted the plugin storefront:inject.
Viewed GET
The order whose viewer the storefront proved the calling plugin acts for. The order comes from the invocation token, never from the request, so a plugin cannot read any other.
