Customisers
duplicate_customiser
writeDuplicate customiser
Start a new customiser from an existing one, for example to try changes without touching the live one.
Overview
Copies one customiser of the connected Store into the same Store, with every option, size, font, price list, form, label, colour scheme and language. The copy is named name, or "Copy of" and the source name when name is omitted. It is live only when the source is live and the plan has room for one more live customiser; otherwise it is inactive. The source does not change and no product is created. It requires the customisers:write scope and an idempotency_key, and supports dry_run.
Permission
Requires thecustomisers:writepermission. A connection without it answersinsufficient_scopenaming the permission to approve.
Annotations
Prerequisites
- A customiser id from list_customisers.
- A merchant has connected this store and approved the customisers:write scope.
Side effects
- Creates one customiser, a copy of the source, which can be live on the storefront.
- Spends one unit of the store option-write budget.
- Claims the idempotency_key for at least 24 hours.
Arguments
The id of the customiser to copy, from list_customisers.
The name of the copy. Omit it for "Copy of" and the source name.
A client-generated key unique to this logical write, such as a UUID. Required: repeating the call with the same key and the same arguments replays the original result instead of writing twice, and the same key with different arguments is an idempotency_key_conflict.
When true, the source and the name is checked and nothing is written: the result is the same verdict the apply would have reached, and a problem the apply would have raised comes back as the same tool error. Defaults to false. A dry run claims no key.
Result
The new customiser, with the fields get_customiser publishes, and its merchant admin link. A dry run returns the verdict, including will_be_active, and copies nothing.
The new customiser, with the fields get_customiser publishes. Absent on a dry run.
True when this call replayed a previously recorded response for the same idempotency_key instead of applying the write again.
Present and true only when dry_run was requested.
Present only on a dry run, and always true: a failing dry run returns a tool error instead.
Present only on a dry run: the duplicate verdict, including will_be_active.
The merchant admin page for the copy. Absent on a dry run.
Error cases
The connection was approved without customisers:write.
The source uses the withdrawn fixed-height pricing model and cannot be copied.
The store option-write budget is spent. Wait retry_after seconds.
No customiser with that id belongs to this store, or it is deleted. Use list_customisers.
The name is longer than 255 characters. The pointer names it.
Copy a customiser under a new name
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "duplicate_customiser",
"arguments": {
"customiser_id": 42,
"name": "Neon sign builder (wholesale)",
"idempotency_key": "e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b"
}
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"structuredContent": {
"request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t",
"store": {
"id": 12,
"name": "Demo Signs"
},
"source_customiser_id": 42,
"customiser": {
"id": 43,
"name": "Neon sign builder (wholesale)",
"active": false,
"pricing_model": "frame_fit",
"sign_category": "neon"
},
"idempotent_replay": false,
"links": {
"admin_url": "https://web.signcustomiser.com/customisers/43"
}
}
}
}A customiser id from another store (error)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "duplicate_customiser",
"arguments": {
"customiser_id": 999,
"dry_run": true
}
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"isError": true,
"structuredContent": {
"error": {
"code": "resource_not_found",
"title": "Resource not found",
"detail": "The requested resource does not exist or does not belong to the authenticated store.",
"recovery": "The identifier does not exist in this store. Use the matching list tool to rediscover a valid id."
}
}
}
}