{"openapi":"3.1.0","info":{"title":"Sherpo customer API","version":"1"},"servers":[{"url":"https://customer-api.sherpo.it"}],"paths":{"/v1/stores/{store}/profile":{"get":{"operationId":"getProfile","summary":"Reads the customer's profile.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}}],"responses":{"200":{"description":"Reads the customer's profile.","content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","x-extensible-enum":["email","phone"]},"value":{"type":"string"},"verified_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","value","verified_at"]}},"id":{"type":"string"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["contacts","id","display_name","locale","country","created_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"patch":{"operationId":"updateProfile","summary":"Updates the customer's name and preferences.","tags":["profile"],"security":[{"bearer":["profile:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updates the customer's name and preferences.","content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","x-extensible-enum":["email","phone"]},"value":{"type":"string"},"verified_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","value","verified_at"]}},"id":{"type":"string"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["contacts","id","display_name","locale","country","created_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"display_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"locale":{"anyOf":[{"type":"string","minLength":1,"maxLength":35},{"type":"null"}]}},"additionalProperties":false}}}}}},"/v1/stores/{store}/contacts":{"get":{"operationId":"listContacts","summary":"Lists the customer's email addresses and phones.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}}],"responses":{"200":{"description":"Lists the customer's email addresses and phones.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","x-extensible-enum":["email","phone"]},"value":{"type":"string"},"verified_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","value","verified_at"]}}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/contacts/add":{"post":{"operationId":"addContact","summary":"Adds an email address to the customer and mails it a code to prove it.","tags":["contact"],"security":[{"bearer":["contact:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}}],"responses":{"200":{"description":"Adds an email address to the customer and mails it a code to prove it.","content":{"application/json":{"schema":{"type":"object","properties":{"expires_at":{"type":"string"}},"required":["expires_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","const":"email"},"value":{"type":"string","minLength":1,"maxLength":254,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}},"required":["kind","value"],"additionalProperties":false}}}}}},"/v1/stores/{store}/contacts/verify":{"post":{"operationId":"verifyContact","summary":"Proves an email address with the code mailed to it.","tags":["contact"],"security":[{"bearer":["contact:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}}],"responses":{"200":{"description":"Proves an email address with the code mailed to it.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","x-extensible-enum":["email","phone"]},"value":{"type":"string"},"verified_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","value","verified_at"]}}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":254,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},"code":{"type":"string","minLength":1,"maxLength":64}},"required":["value","code"],"additionalProperties":false}}}}}},"/v1/stores/{store}/contacts/remove":{"post":{"operationId":"removeContact","summary":"Removes one of the customer's email addresses, never the last proven one.","tags":["contact"],"security":[{"bearer":["contact:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}}],"responses":{"200":{"description":"Removes one of the customer's email addresses, never the last proven one.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","x-extensible-enum":["email","phone"]},"value":{"type":"string"},"verified_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","value","verified_at"]}}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","const":"email"},"value":{"type":"string","minLength":1,"maxLength":254,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}},"required":["kind","value"],"additionalProperties":false}}}}}},"/v1/stores/{store}/billing_profile":{"get":{"operationId":"getBillingProfile","summary":"Reads the customer's saved payment methods with each processor on the store's account.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}}],"responses":{"200":{"description":"Reads the customer's saved payment methods with each processor on the store's account.","content":{"application/json":{"schema":{"type":"object","properties":{"processors":{"type":"array","items":{"type":"object","properties":{"processor":{"type":"string","x-extensible-enum":["stripe"]},"customer_ref":{"type":"string"},"instruments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"display":{"type":"object","properties":{"brand":{"anyOf":[{"type":"string"},{"type":"null"}]},"last4":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiration":{"anyOf":[{"type":"object","properties":{"month":{"type":"number"},"year":{"type":"number"}},"required":["month","year"]},{"type":"null"}]}},"required":["brand","last4","expiration"]},"is_default":{"type":"boolean"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","type","display","is_default","created_at"]}}},"required":["processor","customer_ref","instruments"]}}},"required":["processors"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}":{"get":{"operationId":"getStore","summary":"Reads the store: its name, branding and settings.","tags":["store"],"security":[{"bearer":[]},{"publishableKey":[]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"preview","in":"query","schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Reads the store: its name, branding and settings.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"locale":{"type":"string"},"hostname":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"tint":{"anyOf":[{"type":"string"},{"type":"null"}]},"tint_dark":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"storefront":{"type":"object","properties":{"external_site":{"anyOf":[{"type":"string"},{"type":"null"}]},"socials":{"type":"array","items":{"type":"string"}},"theme":{"type":"string","x-extensible-enum":["both","light","dark"]},"no_index":{"type":"boolean"},"powered_by":{"type":"boolean"},"animated_background":{"type":"boolean"},"header_hidden":{"type":"boolean"},"footer_hidden":{"type":"boolean"}},"required":["external_site","socials","theme","no_index","powered_by","animated_background","header_hidden","footer_hidden"]}},"required":["storefront"]},"body":{"anyOf":[{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]},{"type":"null"}]},"files":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","x-extensible-enum":["video","audio","image","pdf","file"]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"description":"Seconds.","anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]},"url":{"description":"A public file's lasting URL; null for a private one, or one whose bytes haven't landed.","anyOf":[{"type":"string"},{"type":"null"}]},"attachment_id":{"description":"The binding a private file opens through; null when the reader can't open it.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","mime","name","bytes","width","height","duration","pages","status","url","attachment_id"]}},"stylesheet":{"anyOf":[{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]},{"type":"null"}]},"integrations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"script":{"type":"array","items":{"type":"object","properties":{"src":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"defer":{"type":"boolean"},"async":{"type":"boolean"},"inner_html":{"anyOf":[{"type":"string"},{"type":"null"}]},"attributes":{"description":"Any other string attribute on the tag.","type":"object","properties":{},"additionalProperties":{"type":"string"}}},"required":["src","id","defer","async","inner_html","attributes"]}}},"required":["id","name","kind","script"]}},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"discountable":{"type":"boolean"},"subscribable":{"type":"boolean"},"reviewable":{"type":"boolean"},"repeatable":{"description":"Bought again and again: a coffee, a donation, an invoice, a seat, a slot.","type":"boolean"},"aside_size":{"type":"string","x-extensible-enum":["small","none","large"]}},"required":["id","label","discountable","subscribable","reviewable","repeatable","aside_size"]}},"currencies":{"type":"object","properties":{},"additionalProperties":{"type":"number"}},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","locale","hostname","description","tint","tint_dark","settings","body","files","stylesheet","integrations","categories","currencies","updated_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/products":{"get":{"operationId":"listProducts","summary":"Pages the store's products with what the customer holds of each.","tags":["read"],"security":[{"bearer":["read"]},{"publishableKey":[]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["catalog","published","title"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}},{"name":"search","in":"query","schema":{"type":"string","minLength":1}},{"name":"coupon","in":"query","schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Pages the store's products with what the customer holds of each.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"discountable":{"type":"boolean"},"subscribable":{"type":"boolean"},"reviewable":{"type":"boolean"},"repeatable":{"description":"Bought again and again: a coffee, a donation, an invoice, a seat, a slot.","type":"boolean"},"aside_size":{"type":"string","x-extensible-enum":["small","none","large"]}},"required":["id","label","discountable","subscribable","reviewable","repeatable","aside_size"]},{"type":"null"}]},"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"offers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"object","properties":{"id":{"type":"string"},"rank":{"type":"number"},"name":{"type":"string"}},"required":["id","rank","name"]},"currency":{"type":"string"},"exponent":{"description":"Null when central does not know the currency.","anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"The list amount, or the frozen plan amount on a renewal.","type":"number"},"discounted":{"description":"After the discount that applies.","type":"number"},"charge":{"description":"What the caller pays now; nothing on an upgrade granted free.","type":"number"},"highlighted":{"type":"boolean"},"title":{"description":"Shown in place of the tier's name when set.","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"refund_policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"autorenew":{"type":"boolean"},"renewal_discount":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["refund_policy","autorenew","renewal_discount"]},"discount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","code"]},{"type":"null"}]},"kind":{"type":"string","const":"one_time"},"period":{"type":"null"},"mode":{"type":"string","x-extensible-enum":["purchase","renewal"]},"upgrade":{"type":"null"}},"required":["id","tier","currency","exponent","amount","discounted","charge","highlighted","title","description","settings","discount","kind","period","mode","upgrade"]},{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"object","properties":{"id":{"type":"string"},"rank":{"type":"number"},"name":{"type":"string"}},"required":["id","rank","name"]},"currency":{"type":"string"},"exponent":{"description":"Null when central does not know the currency.","anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"The list amount, or the frozen plan amount on a renewal.","type":"number"},"discounted":{"description":"After the discount that applies.","type":"number"},"charge":{"description":"What the caller pays now; nothing on an upgrade granted free.","type":"number"},"highlighted":{"type":"boolean"},"title":{"description":"Shown in place of the tier's name when set.","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"refund_policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"autorenew":{"type":"boolean"},"renewal_discount":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["refund_policy","autorenew","renewal_discount"]},"discount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","code"]},{"type":"null"}]},"kind":{"type":"string","const":"one_time"},"period":{"type":"null"},"mode":{"type":"string","const":"upgrade"},"upgrade":{"type":"object","properties":{"from_rank":{"type":"number"},"credit":{"type":"number"},"effective_credit":{"type":"number"},"free":{"type":"boolean"}},"required":["from_rank","credit","effective_credit","free"]}},"required":["id","tier","currency","exponent","amount","discounted","charge","highlighted","title","description","settings","discount","kind","period","mode","upgrade"]},{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"object","properties":{"id":{"type":"string"},"rank":{"type":"number"},"name":{"type":"string"}},"required":["id","rank","name"]},"currency":{"type":"string"},"exponent":{"description":"Null when central does not know the currency.","anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"The list amount, or the frozen plan amount on a renewal.","type":"number"},"discounted":{"description":"After the discount that applies.","type":"number"},"charge":{"description":"What the caller pays now; nothing on an upgrade granted free.","type":"number"},"highlighted":{"type":"boolean"},"title":{"description":"Shown in place of the tier's name when set.","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"refund_policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"autorenew":{"type":"boolean"},"renewal_discount":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["refund_policy","autorenew","renewal_discount"]},"discount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","code"]},{"type":"null"}]},"kind":{"type":"string","const":"recurring"},"period":{"type":"object","properties":{"unit":{"type":"string","x-extensible-enum":["day","week","month","year"]},"multiplier":{"type":"number"}},"required":["unit","multiplier"]},"mode":{"type":"string","x-extensible-enum":["purchase","renewal"]},"upgrade":{"type":"null"}},"required":["id","tier","currency","exponent","amount","discounted","charge","highlighted","title","description","settings","discount","kind","period","mode","upgrade"]},{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"object","properties":{"id":{"type":"string"},"rank":{"type":"number"},"name":{"type":"string"}},"required":["id","rank","name"]},"currency":{"type":"string"},"exponent":{"description":"Null when central does not know the currency.","anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"The list amount, or the frozen plan amount on a renewal.","type":"number"},"discounted":{"description":"After the discount that applies.","type":"number"},"charge":{"description":"What the caller pays now; nothing on an upgrade granted free.","type":"number"},"highlighted":{"type":"boolean"},"title":{"description":"Shown in place of the tier's name when set.","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"refund_policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"autorenew":{"type":"boolean"},"renewal_discount":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["refund_policy","autorenew","renewal_discount"]},"discount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","code"]},{"type":"null"}]},"kind":{"type":"string","const":"recurring"},"period":{"type":"object","properties":{"unit":{"type":"string","x-extensible-enum":["day","week","month","year"]},"multiplier":{"type":"number"}},"required":["unit","multiplier"]},"mode":{"type":"string","const":"upgrade"},"upgrade":{"type":"object","properties":{"from_rank":{"type":"number"},"credit":{"type":"number"},"effective_credit":{"type":"number"},"free":{"type":"boolean"}},"required":["from_rank","credit","effective_credit","free"]}},"required":["id","tier","currency","exponent","amount","discounted","charge","highlighted","title","description","settings","discount","kind","period","mode","upgrade"]}]}},"owned":{"anyOf":[{"type":"object","properties":{"tier_rank":{"type":"number"},"source":{"type":"string","x-extensible-enum":["subscription","grant"]},"tier_expires_at":{"description":"When the held rank ends.","anyOf":[{"type":"string"},{"type":"null"}]},"expires_at":{"description":"When every grant has ended.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["tier_rank","source","tier_expires_at","expires_at"]},{"type":"null"}]},"poster":{"anyOf":[{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]},{"type":"null"}]},"stats":{"type":"object","properties":{"sales":{"anyOf":[{"type":"number"},{"type":"null"}]},"raised":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"type":"number"}},"required":["currency","exponent","amount"]}},{"type":"null"}]}},"required":["sales","raised"]},"rating":{"type":"object","properties":{"count":{"type":"number"},"average":{"anyOf":[{"type":"number"},{"type":"null"}]},"histogram":{"type":"object","properties":{"1":{"type":"number"},"2":{"type":"number"},"3":{"type":"number"},"4":{"type":"number"},"5":{"type":"number"}},"required":["1","2","3","4","5"]},"summary":{"description":"The generated summary of what reviews say; null while the seller hides it or none is written.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["count","average","histogram","summary"]},"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"listing":{"type":"string","x-extensible-enum":["primary","secondary"]},"priority":{"type":"number"},"published_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"discontinued_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"unlisted_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"refund_policy":{"anyOf":[{"type":"string","x-extensible-enum":["none","24h","72h","7d","14d","30d"]},{"type":"null"}]},"progress_tracking":{"type":"string","x-extensible-enum":["manual","on_open","on_complete","disabled"]},"reviews_enabled":{"type":"boolean"},"purchase_note":{"anyOf":[{"type":"string"},{"type":"null"}]},"calendar":{"anyOf":[{"type":"object","properties":{"calcom":{"type":"object","properties":{"username":{"type":"string"},"event_slug":{"type":"string"}}},"host":{"type":"object","properties":{"title":{"type":"string"},"subtitle":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"icon":{"type":"string"}}}}},{"type":"null"}]},"coffee":{"anyOf":[{"type":"object","properties":{"emoji":{"type":"string"},"descriptor":{"type":"string","minLength":3,"maxLength":15,"pattern":"^\\S(.*\\S)?$"}}},{"type":"null"}]},"fundraising":{"anyOf":[{"type":"object","properties":{"goal":{"type":"integer","minimum":1},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["goal","currency"]},{"type":"null"}]},"storefront":{"type":"object","properties":{"sales_counter":{"type":"boolean"},"background_poster":{"type":"boolean"},"require_dark":{"type":"boolean"}},"required":["sales_counter","background_poster","require_dark"]}},"required":["refund_policy","progress_tracking","reviews_enabled","purchase_note","calendar","coffee","fundraising","storefront"]}},"required":["category","access","offers","owned","poster","stats","rating","id","slug","title","description","listing","priority","published_at","discontinued_at","unlisted_at","created_at","updated_at","settings"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/products/{product}":{"get":{"operationId":"getProduct","summary":"Reads one product with its offers and access.","tags":["read"],"security":[{"bearer":["read"]},{"publishableKey":[]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"product","in":"path","required":true,"description":"An id, or `slug:<slug>`.","schema":{"type":"string","minLength":1}},{"name":"coupon","in":"query","schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"preview","in":"query","schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Reads one product with its offers and access.","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","x-extensible-enum":["video","audio","image","pdf","file"]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"description":"Seconds.","anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]},"url":{"description":"A public file's lasting URL; null for a private one, or one whose bytes haven't landed.","anyOf":[{"type":"string"},{"type":"null"}]},"attachment_id":{"description":"The binding a private file opens through; null when the reader can't open it.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","mime","name","bytes","width","height","duration","pages","status","url","attachment_id"]}},"entries":{"type":"array","items":{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"files":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","x-extensible-enum":["video","audio","image","pdf","file"]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"description":"Seconds.","anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]},"url":{"description":"A public file's lasting URL; null for a private one, or one whose bytes haven't landed.","anyOf":[{"type":"string"},{"type":"null"}]},"attachment_id":{"description":"The binding a private file opens through; null when the reader can't open it.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","mime","name","bytes","width","height","duration","pages","status","url","attachment_id"]}},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"section":{"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"number"},"published_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"ai_generated":{"type":"boolean"}},"required":["ai_generated"]}},"required":["access","files","completed_at","id","product_id","slug","title","subtitle","section","preview","position","published_at","created_at","updated_at","settings"]}},"body":{"anyOf":[{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]}},"tiers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"rank":{"type":"number"},"name":{"type":"string"}},"required":["id","rank","name"]}},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"what_you_get":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"discountable":{"type":"boolean"},"subscribable":{"type":"boolean"},"reviewable":{"type":"boolean"},"repeatable":{"description":"Bought again and again: a coffee, a donation, an invoice, a seat, a slot.","type":"boolean"},"aside_size":{"type":"string","x-extensible-enum":["small","none","large"]}},"required":["id","label","discountable","subscribable","reviewable","repeatable","aside_size"]},{"type":"null"}]},"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"offers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"object","properties":{"id":{"type":"string"},"rank":{"type":"number"},"name":{"type":"string"}},"required":["id","rank","name"]},"currency":{"type":"string"},"exponent":{"description":"Null when central does not know the currency.","anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"The list amount, or the frozen plan amount on a renewal.","type":"number"},"discounted":{"description":"After the discount that applies.","type":"number"},"charge":{"description":"What the caller pays now; nothing on an upgrade granted free.","type":"number"},"highlighted":{"type":"boolean"},"title":{"description":"Shown in place of the tier's name when set.","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"refund_policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"autorenew":{"type":"boolean"},"renewal_discount":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["refund_policy","autorenew","renewal_discount"]},"discount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","code"]},{"type":"null"}]},"kind":{"type":"string","const":"one_time"},"period":{"type":"null"},"mode":{"type":"string","x-extensible-enum":["purchase","renewal"]},"upgrade":{"type":"null"}},"required":["id","tier","currency","exponent","amount","discounted","charge","highlighted","title","description","settings","discount","kind","period","mode","upgrade"]},{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"object","properties":{"id":{"type":"string"},"rank":{"type":"number"},"name":{"type":"string"}},"required":["id","rank","name"]},"currency":{"type":"string"},"exponent":{"description":"Null when central does not know the currency.","anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"The list amount, or the frozen plan amount on a renewal.","type":"number"},"discounted":{"description":"After the discount that applies.","type":"number"},"charge":{"description":"What the caller pays now; nothing on an upgrade granted free.","type":"number"},"highlighted":{"type":"boolean"},"title":{"description":"Shown in place of the tier's name when set.","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"refund_policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"autorenew":{"type":"boolean"},"renewal_discount":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["refund_policy","autorenew","renewal_discount"]},"discount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","code"]},{"type":"null"}]},"kind":{"type":"string","const":"one_time"},"period":{"type":"null"},"mode":{"type":"string","const":"upgrade"},"upgrade":{"type":"object","properties":{"from_rank":{"type":"number"},"credit":{"type":"number"},"effective_credit":{"type":"number"},"free":{"type":"boolean"}},"required":["from_rank","credit","effective_credit","free"]}},"required":["id","tier","currency","exponent","amount","discounted","charge","highlighted","title","description","settings","discount","kind","period","mode","upgrade"]},{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"object","properties":{"id":{"type":"string"},"rank":{"type":"number"},"name":{"type":"string"}},"required":["id","rank","name"]},"currency":{"type":"string"},"exponent":{"description":"Null when central does not know the currency.","anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"The list amount, or the frozen plan amount on a renewal.","type":"number"},"discounted":{"description":"After the discount that applies.","type":"number"},"charge":{"description":"What the caller pays now; nothing on an upgrade granted free.","type":"number"},"highlighted":{"type":"boolean"},"title":{"description":"Shown in place of the tier's name when set.","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"refund_policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"autorenew":{"type":"boolean"},"renewal_discount":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["refund_policy","autorenew","renewal_discount"]},"discount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","code"]},{"type":"null"}]},"kind":{"type":"string","const":"recurring"},"period":{"type":"object","properties":{"unit":{"type":"string","x-extensible-enum":["day","week","month","year"]},"multiplier":{"type":"number"}},"required":["unit","multiplier"]},"mode":{"type":"string","x-extensible-enum":["purchase","renewal"]},"upgrade":{"type":"null"}},"required":["id","tier","currency","exponent","amount","discounted","charge","highlighted","title","description","settings","discount","kind","period","mode","upgrade"]},{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"object","properties":{"id":{"type":"string"},"rank":{"type":"number"},"name":{"type":"string"}},"required":["id","rank","name"]},"currency":{"type":"string"},"exponent":{"description":"Null when central does not know the currency.","anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"The list amount, or the frozen plan amount on a renewal.","type":"number"},"discounted":{"description":"After the discount that applies.","type":"number"},"charge":{"description":"What the caller pays now; nothing on an upgrade granted free.","type":"number"},"highlighted":{"type":"boolean"},"title":{"description":"Shown in place of the tier's name when set.","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"refund_policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"autorenew":{"type":"boolean"},"renewal_discount":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["refund_policy","autorenew","renewal_discount"]},"discount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","code"]},{"type":"null"}]},"kind":{"type":"string","const":"recurring"},"period":{"type":"object","properties":{"unit":{"type":"string","x-extensible-enum":["day","week","month","year"]},"multiplier":{"type":"number"}},"required":["unit","multiplier"]},"mode":{"type":"string","const":"upgrade"},"upgrade":{"type":"object","properties":{"from_rank":{"type":"number"},"credit":{"type":"number"},"effective_credit":{"type":"number"},"free":{"type":"boolean"}},"required":["from_rank","credit","effective_credit","free"]}},"required":["id","tier","currency","exponent","amount","discounted","charge","highlighted","title","description","settings","discount","kind","period","mode","upgrade"]}]}},"owned":{"anyOf":[{"type":"object","properties":{"tier_rank":{"type":"number"},"source":{"type":"string","x-extensible-enum":["subscription","grant"]},"tier_expires_at":{"description":"When the held rank ends.","anyOf":[{"type":"string"},{"type":"null"}]},"expires_at":{"description":"When every grant has ended.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["tier_rank","source","tier_expires_at","expires_at"]},{"type":"null"}]},"poster":{"anyOf":[{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]},{"type":"null"}]},"stats":{"type":"object","properties":{"sales":{"anyOf":[{"type":"number"},{"type":"null"}]},"raised":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"type":"number"}},"required":["currency","exponent","amount"]}},{"type":"null"}]}},"required":["sales","raised"]},"rating":{"type":"object","properties":{"count":{"type":"number"},"average":{"anyOf":[{"type":"number"},{"type":"null"}]},"histogram":{"type":"object","properties":{"1":{"type":"number"},"2":{"type":"number"},"3":{"type":"number"},"4":{"type":"number"},"5":{"type":"number"}},"required":["1","2","3","4","5"]},"summary":{"description":"The generated summary of what reviews say; null while the seller hides it or none is written.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["count","average","histogram","summary"]},"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"listing":{"type":"string","x-extensible-enum":["primary","secondary"]},"priority":{"type":"number"},"published_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"discontinued_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"unlisted_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"refund_policy":{"anyOf":[{"type":"string","x-extensible-enum":["none","24h","72h","7d","14d","30d"]},{"type":"null"}]},"progress_tracking":{"type":"string","x-extensible-enum":["manual","on_open","on_complete","disabled"]},"reviews_enabled":{"type":"boolean"},"purchase_note":{"anyOf":[{"type":"string"},{"type":"null"}]},"calendar":{"anyOf":[{"type":"object","properties":{"calcom":{"type":"object","properties":{"username":{"type":"string"},"event_slug":{"type":"string"}}},"host":{"type":"object","properties":{"title":{"type":"string"},"subtitle":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"icon":{"type":"string"}}}}},{"type":"null"}]},"coffee":{"anyOf":[{"type":"object","properties":{"emoji":{"type":"string"},"descriptor":{"type":"string","minLength":3,"maxLength":15,"pattern":"^\\S(.*\\S)?$"}}},{"type":"null"}]},"fundraising":{"anyOf":[{"type":"object","properties":{"goal":{"type":"integer","minimum":1},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["goal","currency"]},{"type":"null"}]},"storefront":{"type":"object","properties":{"sales_counter":{"type":"boolean"},"background_poster":{"type":"boolean"},"require_dark":{"type":"boolean"}},"required":["sales_counter","background_poster","require_dark"]}},"required":["refund_policy","progress_tracking","reviews_enabled","purchase_note","calendar","coffee","fundraising","storefront"]}},"required":["files","entries","body","attachments","tiers","text","what_you_get","category","access","offers","owned","poster","stats","rating","id","slug","title","description","listing","priority","published_at","discontinued_at","unlisted_at","created_at","updated_at","settings"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/products/{product}/entries":{"get":{"operationId":"listEntries","summary":"Pages a product's entries with their access.","tags":["read"],"security":[{"bearer":["read"]},{"publishableKey":[]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"product","in":"path","required":true,"description":"An id, or `slug:<slug>`.","schema":{"type":"string","minLength":1}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["position","published"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}},{"name":"search","in":"query","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Pages a product's entries with their access.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"poster":{"anyOf":[{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]},{"type":"null"}]},"files":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","x-extensible-enum":["video","audio","image","pdf","file"]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"description":"Seconds.","anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]},"url":{"description":"A public file's lasting URL; null for a private one, or one whose bytes haven't landed.","anyOf":[{"type":"string"},{"type":"null"}]},"attachment_id":{"description":"The binding a private file opens through; null when the reader can't open it.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","mime","name","bytes","width","height","duration","pages","status","url","attachment_id"]}},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"section":{"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"number"},"published_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"ai_generated":{"type":"boolean"}},"required":["ai_generated"]}},"required":["access","poster","files","completed_at","id","product_id","slug","title","subtitle","section","preview","position","published_at","created_at","updated_at","settings"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/entries/{entry}":{"get":{"operationId":"getEntry","summary":"Reads one entry with its access.","tags":["read"],"security":[{"bearer":["read"]},{"publishableKey":[]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"entry","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Reads one entry with its access.","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","x-extensible-enum":["video","audio","image","pdf","file"]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"description":"Seconds.","anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]},"url":{"description":"A public file's lasting URL; null for a private one, or one whose bytes haven't landed.","anyOf":[{"type":"string"},{"type":"null"}]},"attachment_id":{"description":"The binding a private file opens through; null when the reader can't open it.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","mime","name","bytes","width","height","duration","pages","status","url","attachment_id"]}},"quiz":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"},"settings":{"type":"object","properties":{"attempts_allowed":{"anyOf":[{"type":"number"},{"type":"null"}]},"pass_mark":{"anyOf":[{"type":"number"},{"type":"null"}]},"show_answers":{"type":"boolean"}},"required":["attempts_allowed","pass_mark","show_answers"]},"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]}},"required":["id","version","settings","access"]},{"type":"null"}]},"body":{"anyOf":[{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]}},"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"product":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"progress_tracking":{"type":"string","x-extensible-enum":["manual","on_open","on_complete","disabled"]}},"required":["id","slug","title","progress_tracking"]},"id":{"type":"string"},"product_id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"section":{"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"number"},"published_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"ai_generated":{"type":"boolean"}},"required":["ai_generated"]}},"required":["files","quiz","body","attachments","access","completed_at","product","id","product_id","slug","title","subtitle","section","preview","position","published_at","created_at","updated_at","settings"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/pages":{"get":{"operationId":"listPages","summary":"Pages the store's custom pages.","tags":["read"],"security":[{"bearer":["read"]},{"publishableKey":[]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["menu","title"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}},{"name":"search","in":"query","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Pages the store's custom pages.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"menu_position":{"anyOf":[{"type":"number"},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"storefront":{"type":"object","properties":{"no_index":{"type":"boolean"}},"required":["no_index"]}},"required":["storefront"]}},"required":["access","id","slug","title","description","menu_position","published_at","created_at","updated_at","settings"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/pages/{page}":{"get":{"operationId":"getPage","summary":"Reads one custom page.","tags":["read"],"security":[{"bearer":["read"]},{"publishableKey":[]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"page","in":"path","required":true,"description":"An id, or `slug:<slug>`.","schema":{"type":"string","minLength":1}},{"name":"preview","in":"query","schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Reads one custom page.","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","x-extensible-enum":["video","audio","image","pdf","file"]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"description":"Seconds.","anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]},"url":{"description":"A public file's lasting URL; null for a private one, or one whose bytes haven't landed.","anyOf":[{"type":"string"},{"type":"null"}]},"attachment_id":{"description":"The binding a private file opens through; null when the reader can't open it.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","mime","name","bytes","width","height","duration","pages","status","url","attachment_id"]}},"body":{"anyOf":[{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]}},"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"menu_position":{"anyOf":[{"type":"number"},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"storefront":{"type":"object","properties":{"no_index":{"type":"boolean"}},"required":["no_index"]}},"required":["storefront"]}},"required":["files","body","attachments","access","id","slug","title","description","menu_position","published_at","created_at","updated_at","settings"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/body":{"get":{"operationId":"readBody","summary":"Reads a product's, entry's or page's body, where the customer may.","tags":["read"],"security":[{"bearer":["read"]},{"publishableKey":[]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"target","in":"query","required":true,"style":"deepObject","explode":true,"schema":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"store"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["product","entry","page"]},"id":{"type":"string","minLength":1,"maxLength":512}},"required":["kind","id"],"additionalProperties":false}]}},{"name":"preview","in":"query","schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Reads a product's, entry's or page's body, where the customer may.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"content":{"type":"null"},"files":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","x-extensible-enum":["video","audio","image","pdf","file"]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"description":"Seconds.","anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]},"url":{"description":"A public file's lasting URL; null for a private one, or one whose bytes haven't landed.","anyOf":[{"type":"string"},{"type":"null"}]},"attachment_id":{"description":"The binding a private file opens through; null when the reader can't open it.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","mime","name","bytes","width","height","duration","pages","status","url","attachment_id"]}},"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["content","files","access","id","role","delivery","preview_only","position","asset"]},{"type":"object","properties":{"content":{"type":"string"},"files":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","x-extensible-enum":["video","audio","image","pdf","file"]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"description":"Seconds.","anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]},"url":{"description":"A public file's lasting URL; null for a private one, or one whose bytes haven't landed.","anyOf":[{"type":"string"},{"type":"null"}]},"attachment_id":{"description":"The binding a private file opens through; null when the reader can't open it.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","mime","name","bytes","width","height","duration","pages","status","url","attachment_id"]}},"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["content","files","access","id","role","delivery","preview_only","position","asset"]},{"type":"null"}]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/prompts":{"get":{"operationId":"listPrompts","summary":"Lists the MCP prompts of one product, or of every product the customer holds, with what each asks and whether the customer may run it.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"product","in":"query","description":"An id, or `slug:<slug>`.","schema":{"type":"string","minLength":1,"description":"An id, or `slug:<slug>`."}},{"name":"runnable","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Lists the MCP prompts of one product, or of every product the customer holds, with what each asks and whether the customer may run it.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"arguments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":{"type":"boolean"}},"required":["name","description","required"]}},"product":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]},"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]}},"required":["id","name","title","description","arguments","product","access"]}},"truncated":{"type":"boolean"}},"required":["items","truncated"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/prompts/{prompt}":{"get":{"operationId":"getPrompt","summary":"Reads one prompt by its id or name, its text filled in with the arguments given where the customer may run it.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"prompt","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"arguments","in":"query","style":"deepObject","explode":true,"schema":{"type":"object","properties":{},"additionalProperties":{"type":"string"}}}],"responses":{"200":{"description":"Reads one prompt by its id or name, its text filled in with the arguments given where the customer may run it.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"text":{"type":"null"},"id":{"type":"string"},"name":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"arguments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":{"type":"boolean"}},"required":["name","description","required"]}},"product":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]},"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]}},"required":["text","id","name","title","description","arguments","product","access"]},{"type":"object","properties":{"text":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"arguments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":{"type":"boolean"}},"required":["name","description","required"]}},"product":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]},"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]}},"required":["text","id","name","title","description","arguments","product","access"]}]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/attachments/url":{"post":{"operationId":"getAttachmentUrl","summary":"Mints a short-lived URL to an attachment's file, where the customer may reach it.","tags":["read"],"security":[{"bearer":["read"]},{"publishableKey":[]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}}],"responses":{"200":{"description":"Mints a short-lived URL to an attachment's file, where the customer may reach it.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["url","expires_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"attachment":{"type":"string","minLength":1,"maxLength":512},"renew":{"type":"boolean"},"intent":{"description":"For a lesson's slides: shown in the player, or downloaded where the caller may; none serves them as bound.","type":"string","enum":["download","view"]}},"required":["attachment"],"additionalProperties":false}}}}}},"/v1/stores/{store}/entries/{entry}/complete":{"post":{"operationId":"completeEntry","summary":"Marks an entry complete for the customer.","tags":["progress"],"security":[{"bearer":["progress:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"entry","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Marks an entry complete for the customer.","content":{"application/json":{"schema":{"type":"object","properties":{"entry_id":{"type":"string"},"product_id":{"type":"string"},"completed_at":{"type":"string"},"certificates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"certificate_id":{"type":"string"},"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"attempt":{"anyOf":[{"type":"number"},{"type":"null"}]},"issued_at":{"type":"string"}},"required":["id","certificate_id","score","attempt","issued_at"]}}},"required":["entry_id","product_id","completed_at","certificates"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/v1/stores/{store}/completions":{"get":{"operationId":"listCompletions","summary":"Pages the customer's completed entries.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["completed"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages the customer's completed entries.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"entry_id":{"type":"string"},"product_id":{"type":"string"},"completed_at":{"type":"string"}},"required":["entry_id","product_id","completed_at"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"facets":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{},"additionalProperties":{"type":"number"}}}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/checkouts":{"post":{"operationId":"createCheckout","summary":"Opens a cart in one currency.","tags":["checkout"],"security":[{"bearer":["checkout:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}}],"responses":{"201":{"description":"Opens a cart in one currency.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","x-extensible-enum":["paid","expired","open","frozen","abandoned"]},"items":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"price_id":{"type":"string"},"quantity":{"type":"number"},"amount":{"type":"number"},"discount":{"type":"number"},"discount_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"mode":{"type":"string","x-extensible-enum":["purchase","upgrade","renewal"]}},"required":["product","id","product_id","price_id","quantity","amount","discount","discount_id","total","mode"]}},"totals":{"type":"object","properties":{"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"}},"required":["amount","discount","total"]},"id":{"type":"string"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]},"refund_waiver":{"anyOf":[{"type":"object","properties":{"policy":{"description":"The strictest policy among the lines, the one consented to.","type":"string"},"accepted_at":{"type":"string"}},"required":["policy","accepted_at"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","items","totals","id","currency","exponent","coupon","refund_waiver","expires_at","created_at","updated_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3,"pattern":"^[A-Za-z]{3}$"}},"required":["currency"],"additionalProperties":false}}}}},"get":{"operationId":"listCheckouts","summary":"Pages the customer's checkouts.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["created"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages the customer's checkouts.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","x-extensible-enum":["paid","expired","open","frozen","abandoned"]},"items":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"price_id":{"type":"string"},"quantity":{"type":"number"},"amount":{"type":"number"},"discount":{"type":"number"},"discount_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"mode":{"type":"string","x-extensible-enum":["purchase","upgrade","renewal"]}},"required":["product","id","product_id","price_id","quantity","amount","discount","discount_id","total","mode"]}},"totals":{"type":"object","properties":{"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"}},"required":["amount","discount","total"]},"id":{"type":"string"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]},"refund_waiver":{"anyOf":[{"type":"object","properties":{"policy":{"description":"The strictest policy among the lines, the one consented to.","type":"string"},"accepted_at":{"type":"string"}},"required":["policy","accepted_at"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","items","totals","id","currency","exponent","coupon","refund_waiver","expires_at","created_at","updated_at"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/checkouts/{checkout}":{"get":{"operationId":"getCheckout","summary":"Reads one of the customer's checkouts.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"checkout","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Reads one of the customer's checkouts.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","x-extensible-enum":["paid","expired","open","frozen","abandoned"]},"items":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"price_id":{"type":"string"},"quantity":{"type":"number"},"amount":{"type":"number"},"discount":{"type":"number"},"discount_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"mode":{"type":"string","x-extensible-enum":["purchase","upgrade","renewal"]}},"required":["product","id","product_id","price_id","quantity","amount","discount","discount_id","total","mode"]}},"totals":{"type":"object","properties":{"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"}},"required":["amount","discount","total"]},"id":{"type":"string"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]},"refund_waiver":{"anyOf":[{"type":"object","properties":{"policy":{"description":"The strictest policy among the lines, the one consented to.","type":"string"},"accepted_at":{"type":"string"}},"required":["policy","accepted_at"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","items","totals","id","currency","exponent","coupon","refund_waiver","expires_at","created_at","updated_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/checkouts/{checkout}/items":{"put":{"operationId":"setCheckoutItem","summary":"Puts a price in a cart at the offer the customer gets now; zero removes the line.","tags":["checkout"],"security":[{"bearer":["checkout:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"checkout","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Puts a price in a cart at the offer the customer gets now; zero removes the line.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","x-extensible-enum":["paid","expired","open","frozen","abandoned"]},"items":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"price_id":{"type":"string"},"quantity":{"type":"number"},"amount":{"type":"number"},"discount":{"type":"number"},"discount_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"mode":{"type":"string","x-extensible-enum":["purchase","upgrade","renewal"]}},"required":["product","id","product_id","price_id","quantity","amount","discount","discount_id","total","mode"]}},"totals":{"type":"object","properties":{"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"}},"required":["amount","discount","total"]},"id":{"type":"string"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]},"refund_waiver":{"anyOf":[{"type":"object","properties":{"policy":{"description":"The strictest policy among the lines, the one consented to.","type":"string"},"accepted_at":{"type":"string"}},"required":["policy","accepted_at"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","items","totals","id","currency","exponent","coupon","refund_waiver","expires_at","created_at","updated_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"price":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":512}},"required":["id"],"additionalProperties":false},"quantity":{"description":"Zero removes the line.","type":"integer","minimum":0,"maximum":99}},"required":["price"],"additionalProperties":false}}}}}},"/v1/stores/{store}/checkouts/{checkout}/coupon":{"put":{"operationId":"applyCoupon","summary":"Names a coupon on a cart, or takes it off with null.","tags":["checkout"],"security":[{"bearer":["checkout:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"checkout","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Names a coupon on a cart, or takes it off with null.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","x-extensible-enum":["paid","expired","open","frozen","abandoned"]},"items":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"price_id":{"type":"string"},"quantity":{"type":"number"},"amount":{"type":"number"},"discount":{"type":"number"},"discount_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"mode":{"type":"string","x-extensible-enum":["purchase","upgrade","renewal"]}},"required":["product","id","product_id","price_id","quantity","amount","discount","discount_id","total","mode"]}},"totals":{"type":"object","properties":{"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"}},"required":["amount","discount","total"]},"id":{"type":"string"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]},"refund_waiver":{"anyOf":[{"type":"object","properties":{"policy":{"description":"The strictest policy among the lines, the one consented to.","type":"string"},"accepted_at":{"type":"string"}},"required":["policy","accepted_at"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","items","totals","id","currency","exponent","coupon","refund_waiver","expires_at","created_at","updated_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]}},"required":["code"],"additionalProperties":false}}}}}},"/v1/stores/{store}/checkouts/{checkout}/freeze":{"post":{"operationId":"freezeCheckout","summary":"Presents a cart for payment: its lines must still price as frozen, then it stops changing.","tags":["checkout"],"security":[{"bearer":["checkout:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"checkout","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Presents a cart for payment: its lines must still price as frozen, then it stops changing.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","x-extensible-enum":["paid","expired","open","frozen","abandoned"]},"items":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"price_id":{"type":"string"},"quantity":{"type":"number"},"amount":{"type":"number"},"discount":{"type":"number"},"discount_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"mode":{"type":"string","x-extensible-enum":["purchase","upgrade","renewal"]}},"required":["product","id","product_id","price_id","quantity","amount","discount","discount_id","total","mode"]}},"totals":{"type":"object","properties":{"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"}},"required":["amount","discount","total"]},"id":{"type":"string"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]},"refund_waiver":{"anyOf":[{"type":"object","properties":{"policy":{"description":"The strictest policy among the lines, the one consented to.","type":"string"},"accepted_at":{"type":"string"}},"required":["policy","accepted_at"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","items","totals","id","currency","exponent","coupon","refund_waiver","expires_at","created_at","updated_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"refund_waiver":{"description":"The buyer's consent to a refund policy shorter than the statutory window.","type":"boolean"}},"additionalProperties":false}}}}}},"/v1/stores/{store}/checkouts/{checkout}/abandon":{"post":{"operationId":"abandonCheckout","summary":"Gives a cart up; a frozen one hands its coupons back.","tags":["checkout"],"security":[{"bearer":["checkout:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"checkout","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Gives a cart up; a frozen one hands its coupons back.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","x-extensible-enum":["paid","expired","open","frozen","abandoned"]},"items":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"price_id":{"type":"string"},"quantity":{"type":"number"},"amount":{"type":"number"},"discount":{"type":"number"},"discount_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"mode":{"type":"string","x-extensible-enum":["purchase","upgrade","renewal"]}},"required":["product","id","product_id","price_id","quantity","amount","discount","discount_id","total","mode"]}},"totals":{"type":"object","properties":{"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"}},"required":["amount","discount","total"]},"id":{"type":"string"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]},"refund_waiver":{"anyOf":[{"type":"object","properties":{"policy":{"description":"The strictest policy among the lines, the one consented to.","type":"string"},"accepted_at":{"type":"string"}},"required":["policy","accepted_at"]},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","items","totals","id","currency","exponent","coupon","refund_waiver","expires_at","created_at","updated_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/v1/stores/{store}/checkouts/{checkout}/pay":{"post":{"operationId":"payCheckout","summary":"Starts paying a frozen cart, answering what the buyer's page confirms with the processor, or the order when nothing is due.","tags":["checkout"],"security":[{"bearer":["checkout:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"checkout","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Starts paying a frozen cart, answering what the buyer's page confirms with the processor, or the order when nothing is due.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","const":"paid"},"order":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"}},"required":["id","number"]}},"required":["status","order"]},{"type":"object","properties":{"status":{"type":"string","x-extensible-enum":["requires_payment","processing"]},"payment":{"type":"object","properties":{"processor":{"type":"string","x-extensible-enum":["stripe"]},"client_secret":{"type":"string"},"publishable_key":{"type":"string"},"account":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["processor","client_secret","publishable_key","account","amount","currency","exponent"]}},"required":["status","payment"]},{"type":"object","properties":{"status":{"type":"string","x-extensible-enum":["cancelled","refunded","refund_pending","refund_failed"]}},"required":["status"]}]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/v1/stores/{store}/checkouts/{checkout}/confirm":{"post":{"operationId":"confirmCheckout","summary":"Reads a cart's payment back after the buyer's page confirmed it, answering the order once it is paid.","tags":["checkout"],"security":[{"bearer":["checkout:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"checkout","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Reads a cart's payment back after the buyer's page confirmed it, answering the order once it is paid.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","const":"paid"},"order":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"}},"required":["id","number"]}},"required":["status","order"]},{"type":"object","properties":{"status":{"type":"string","x-extensible-enum":["requires_payment","processing"]},"payment":{"type":"object","properties":{"processor":{"type":"string","x-extensible-enum":["stripe"]},"client_secret":{"type":"string"},"publishable_key":{"type":"string"},"account":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["processor","client_secret","publishable_key","account","amount","currency","exponent"]}},"required":["status","payment"]},{"type":"object","properties":{"status":{"type":"string","x-extensible-enum":["cancelled","refunded","refund_pending","refund_failed"]}},"required":["status"]}]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/v1/stores/{store}/orders":{"get":{"operationId":"listOrders","summary":"Pages the customer's orders.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["occurred"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages the customer's orders.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"item_count":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"order_id":{"type":"string"},"product_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"tier_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"price_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"number"},"quantity":{"type":"number"},"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"},"descriptor":{"type":"object","properties":{"product":{"anyOf":[{"type":"string"},{"type":"null"}]},"price":{"anyOf":[{"type":"string"},{"type":"null"}]},"tier":{"anyOf":[{"type":"string"},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["product","price","tier","coupon"]}},"required":["product","id","order_id","product_id","tier_id","price_id","position","quantity","amount","discount","total","descriptor"]}},"refund_count":{"type":"number"},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order_id":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","order_id","amount","currency","reason","occurred_at"]}},"id":{"type":"string"},"number":{"type":"number"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"},"source":{"type":"string","x-extensible-enum":["checkout","api","import","manual"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"statements":{"type":"object","properties":{"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"refund_waiver":{"anyOf":[{"type":"object","properties":{"policy":{"description":"The strictest policy among the lines, the one consented to.","type":"string"},"accepted_at":{"type":"string"}},"required":["policy","accepted_at"]},{"type":"null"}]}},"required":["coupon","method","refund_waiver"]},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["item_count","items","refund_count","refunds","id","number","currency","exponent","amount","discount","total","source","note","statements","occurred_at"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/orders/{order}":{"get":{"operationId":"getOrder","summary":"Reads one of the customer's orders.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"order","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Reads one of the customer's orders.","content":{"application/json":{"schema":{"type":"object","properties":{"item_count":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"order_id":{"type":"string"},"product_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"tier_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"price_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"number"},"quantity":{"type":"number"},"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"},"descriptor":{"type":"object","properties":{"product":{"anyOf":[{"type":"string"},{"type":"null"}]},"price":{"anyOf":[{"type":"string"},{"type":"null"}]},"tier":{"anyOf":[{"type":"string"},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["product","price","tier","coupon"]}},"required":["product","id","order_id","product_id","tier_id","price_id","position","quantity","amount","discount","total","descriptor"]}},"refund_count":{"type":"number"},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order_id":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","order_id","amount","currency","reason","occurred_at"]}},"id":{"type":"string"},"number":{"type":"number"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"},"source":{"type":"string","x-extensible-enum":["checkout","api","import","manual"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"statements":{"type":"object","properties":{"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"refund_waiver":{"anyOf":[{"type":"object","properties":{"policy":{"description":"The strictest policy among the lines, the one consented to.","type":"string"},"accepted_at":{"type":"string"}},"required":["policy","accepted_at"]},{"type":"null"}]}},"required":["coupon","method","refund_waiver"]},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["item_count","items","refund_count","refunds","id","number","currency","exponent","amount","discount","total","source","note","statements","occurred_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/orders/{order}/items":{"get":{"operationId":"listOrderItems","summary":"Pages an order's lines.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"order","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["line"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages an order's lines.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"order_id":{"type":"string"},"product_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"tier_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"price_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"number"},"quantity":{"type":"number"},"amount":{"type":"number"},"discount":{"type":"number"},"total":{"type":"number"},"descriptor":{"type":"object","properties":{"product":{"anyOf":[{"type":"string"},{"type":"null"}]},"price":{"anyOf":[{"type":"string"},{"type":"null"}]},"tier":{"anyOf":[{"type":"string"},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["product","price","tier","coupon"]}},"required":["product","id","order_id","product_id","tier_id","price_id","position","quantity","amount","discount","total","descriptor"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["items","cursor","currency","exponent"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/orders/{order}/refunds":{"get":{"operationId":"listOrderRefunds","summary":"Pages an order's refunds.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"order","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["occurred"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages an order's refunds.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order_id":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","order_id","amount","currency","reason","occurred_at"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["items","cursor","currency","exponent"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/subscriptions":{"get":{"operationId":"listSubscriptions","summary":"Pages the customer's subscriptions.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["created"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages the customer's subscriptions.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"plan":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"price_id":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"period":{"type":"object","properties":{"unit":{"type":"string","x-extensible-enum":["day","week","month","year"]},"multiplier":{"type":"number"}},"required":["unit","multiplier"]},"autorenew":{"type":"boolean"}},"required":["id","price_id","amount","currency","exponent","period","autorenew"]},{"type":"null"}]},"current_period":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"starts_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"ends_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","failed","paid","refunded"]}},"required":["id","starts_at","ends_at","status"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"status":{"type":"string","x-extensible-enum":["unpaid","active","past_due","paused","cancelled","ended"]},"cancel_at_period_end":{"type":"boolean"},"cancel_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"billing_managed":{"type":"boolean"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["product","plan","current_period","id","product_id","status","cancel_at_period_end","cancel_reason","billing_managed","created_at","ended_at"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/subscriptions/{subscription}":{"get":{"operationId":"getSubscription","summary":"Reads one of the customer's subscriptions.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"subscription","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Reads one of the customer's subscriptions.","content":{"application/json":{"schema":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"plan":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"price_id":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"period":{"type":"object","properties":{"unit":{"type":"string","x-extensible-enum":["day","week","month","year"]},"multiplier":{"type":"number"}},"required":["unit","multiplier"]},"autorenew":{"type":"boolean"}},"required":["id","price_id","amount","currency","exponent","period","autorenew"]},{"type":"null"}]},"current_period":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"starts_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"ends_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","failed","paid","refunded"]}},"required":["id","starts_at","ends_at","status"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"status":{"type":"string","x-extensible-enum":["unpaid","active","past_due","paused","cancelled","ended"]},"cancel_at_period_end":{"type":"boolean"},"cancel_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"billing_managed":{"type":"boolean"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["product","plan","current_period","id","product_id","status","cancel_at_period_end","cancel_reason","billing_managed","created_at","ended_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/subscriptions/{subscription}/cancel":{"post":{"operationId":"cancelSubscription","summary":"Cancels a subscription at the end of its period.","tags":["subscription"],"security":[{"bearer":["subscription:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"subscription","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Cancels a subscription at the end of its period.","content":{"application/json":{"schema":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"plan":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"price_id":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"period":{"type":"object","properties":{"unit":{"type":"string","x-extensible-enum":["day","week","month","year"]},"multiplier":{"type":"number"}},"required":["unit","multiplier"]},"autorenew":{"type":"boolean"}},"required":["id","price_id","amount","currency","exponent","period","autorenew"]},{"type":"null"}]},"current_period":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"starts_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"ends_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","failed","paid","refunded"]}},"required":["id","starts_at","ends_at","status"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"status":{"type":"string","x-extensible-enum":["unpaid","active","past_due","paused","cancelled","ended"]},"cancel_at_period_end":{"type":"boolean"},"cancel_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"billing_managed":{"type":"boolean"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["product","plan","current_period","id","product_id","status","cancel_at_period_end","cancel_reason","billing_managed","created_at","ended_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"additionalProperties":false}}}}}},"/v1/stores/{store}/subscriptions/{subscription}/resume":{"post":{"operationId":"resumeSubscription","summary":"Withdraws a subscription's scheduled cancellation.","tags":["subscription"],"security":[{"bearer":["subscription:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"subscription","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Withdraws a subscription's scheduled cancellation.","content":{"application/json":{"schema":{"type":"object","properties":{"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"plan":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"price_id":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"period":{"type":"object","properties":{"unit":{"type":"string","x-extensible-enum":["day","week","month","year"]},"multiplier":{"type":"number"}},"required":["unit","multiplier"]},"autorenew":{"type":"boolean"}},"required":["id","price_id","amount","currency","exponent","period","autorenew"]},{"type":"null"}]},"current_period":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"starts_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"ends_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","failed","paid","refunded"]}},"required":["id","starts_at","ends_at","status"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"status":{"type":"string","x-extensible-enum":["unpaid","active","past_due","paused","cancelled","ended"]},"cancel_at_period_end":{"type":"boolean"},"cancel_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"billing_managed":{"type":"boolean"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["product","plan","current_period","id","product_id","status","cancel_at_period_end","cancel_reason","billing_managed","created_at","ended_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/v1/stores/{store}/grants":{"get":{"operationId":"listGrants","summary":"Pages the customer's grants of access.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["valid_from"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages the customer's grants of access.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"tier":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"rank":{"type":"number"},"name":{"type":"string"}},"required":["id","rank","name"]},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"tier_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"source_kind":{"type":"string","x-extensible-enum":["checkout","api","import","manual","subscription","payment","automation"]},"valid_from":{"anyOf":[{"type":"string"},{"type":"null"}]},"ends_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"end_reason":{"anyOf":[{"type":"string","x-extensible-enum":["import","manual","lapse","refund"]},{"type":"null"}]}},"required":["tier","id","product_id","tier_id","source_kind","valid_from","ends_at","end_reason"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/entitlements":{"get":{"operationId":"listEntitlements","summary":"Pages what the customer may reach.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["product"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages what the customer may reach.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string"},"tier_rank":{"type":"number"},"tier_expires_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"held":{"type":"boolean"}},"required":["product_id","tier_rank","tier_expires_at","expires_at","held"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"facets":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{},"additionalProperties":{"type":"number"}}}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/products/{product}/reviews":{"get":{"operationId":"listReviews","summary":"Pages a product's reviews.","tags":["read"],"security":[{"bearer":["read"]},{"publishableKey":[]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"product","in":"path","required":true,"description":"An id, or `slug:<slug>`.","schema":{"type":"string","minLength":1}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["created","rating"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages a product's reviews.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"mine":{"type":"boolean"},"hidden_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"rating":{"type":"number"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"reply":{"anyOf":[{"type":"string"},{"type":"null"}]},"replied_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["mine","hidden_at","id","product_id","rating","username","notes","reply","replied_at","created_at","updated_at"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"facets":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{},"additionalProperties":{"type":"number"}}}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/products/{product}/review":{"put":{"operationId":"writeReview","summary":"Writes or updates the customer's review of a product.","tags":["review"],"security":[{"bearer":["review:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"product","in":"path","required":true,"description":"An id, or `slug:<slug>`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Writes or updates the customer's review of a product.","content":{"application/json":{"schema":{"type":"object","properties":{"mine":{"type":"boolean"},"hidden_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"product_id":{"type":"string"},"rating":{"type":"number"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"reply":{"anyOf":[{"type":"string"},{"type":"null"}]},"replied_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["mine","hidden_at","id","product_id","rating","username","notes","reply","replied_at","created_at","updated_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rating":{"type":"integer","minimum":1,"maximum":5},"notes":{"anyOf":[{"type":"string","minLength":1,"maxLength":4000},{"type":"null"}]},"username":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]}},"required":["rating"],"additionalProperties":false}}}}},"delete":{"operationId":"deleteReview","summary":"Deletes the customer's review.","tags":["review"],"security":[{"bearer":["review:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"product","in":"path","required":true,"description":"An id, or `slug:<slug>`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Deletes the customer's review.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/quizzes/{quiz}/attempts":{"post":{"operationId":"startAttempt","summary":"Starts an attempt at a quiz.","tags":["quiz"],"security":[{"bearer":["quiz:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"quiz","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Starts an attempt at a quiz.","content":{"application/json":{"schema":{"type":"object","properties":{"attempt":{"type":"object","properties":{"id":{"type":"string"},"quiz_id":{"type":"string"},"entry_id":{"type":"string"},"attempt":{"type":"number"},"status":{"type":"string","x-extensible-enum":["failed","started","submitted","passed","forfeited"]},"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"correct":{"anyOf":[{"type":"number"},{"type":"null"}]},"started_at":{"type":"string"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","quiz_id","entry_id","attempt","status","score","correct","started_at","finished_at"]},"questions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"question":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"anyOf":[{"type":"string"},{"type":"null"}]},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}},"required":["id","text"]}},{"type":"null"}]},"min":{"anyOf":[{"type":"number"},{"type":"null"}]},"max":{"anyOf":[{"type":"number"},{"type":"null"}]},"weight":{"anyOf":[{"type":"number"},{"type":"null"}]},"hint":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","id","question","content","options","min","max","weight","hint"]}},"attachments":{"type":"array","items":{"type":"object","properties":{"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"id":{"type":"string"},"role":{"type":"string","x-extensible-enum":["body","staged","staged_file","prose","teaser","embed","deliverable","poster","logo","prompt","stylesheet"]},"delivery":{"type":"string","x-extensible-enum":["inline","download","stream"]},"preview_only":{"type":"boolean"},"position":{"type":"number"},"asset":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"ext":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"storage":{"type":"string","x-extensible-enum":["r2","s3","inline"]},"enforcement":{"type":"string","x-extensible-enum":["public","external","signed"]},"locator":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["width","height","duration","pages"]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]}},"required":["id","name","title","ext","description","mime","bytes","storage","enforcement","locator","metadata","status"]}},"required":["access","id","role","delivery","preview_only","position","asset"]}},"files":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","x-extensible-enum":["video","audio","image","pdf","file"]},"mime":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"width":{"anyOf":[{"type":"number"},{"type":"null"}]},"height":{"anyOf":[{"type":"number"},{"type":"null"}]},"duration":{"description":"Seconds.","anyOf":[{"type":"number"},{"type":"null"}]},"pages":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","x-extensible-enum":["pending","ready","failed","unavailable"]},"url":{"description":"A public file's lasting URL; null for a private one, or one whose bytes haven't landed.","anyOf":[{"type":"string"},{"type":"null"}]},"attachment_id":{"description":"The binding a private file opens through; null when the reader can't open it.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","mime","name","bytes","width","height","duration","pages","status","url","attachment_id"]}}},"required":["attempt","questions","attachments","files"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/v1/stores/{store}/attempts/{attempt}/submit":{"post":{"operationId":"submitAttempt","summary":"Submits answers to an attempt and grades it.","tags":["quiz"],"security":[{"bearer":["quiz:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"attempt","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Submits answers to an attempt and grades it.","content":{"application/json":{"schema":{"type":"object","properties":{"attempt":{"type":"object","properties":{"id":{"type":"string"},"quiz_id":{"type":"string"},"entry_id":{"type":"string"},"attempt":{"type":"number"},"status":{"type":"string","x-extensible-enum":["failed","started","submitted","passed","forfeited"]},"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"correct":{"anyOf":[{"type":"number"},{"type":"null"}]},"started_at":{"type":"string"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","quiz_id","entry_id","attempt","status","score","correct","started_at","finished_at"]},"score":{"type":"number"},"correct":{"type":"number"},"total":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"question_id":{"type":"string"},"answer":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"type":"null"}]},"correct":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"key":{"anyOf":[{"type":"object","properties":{"correct_option_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"correct_answer":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"correct_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"accepted_answers":{"type":"array","items":{"type":"string"}},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["correct_option_id","correct_answer","correct_value","accepted_answers","explanation"]},{"type":"null"}]}},"required":["question_id","answer","correct","key"]}},"certificate":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"certificate_id":{"type":"string"},"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"attempt":{"anyOf":[{"type":"number"},{"type":"null"}]},"issued_at":{"type":"string"}},"required":["id","certificate_id","score","attempt","issued_at"]},{"type":"null"}]}},"required":["attempt","score","correct","total","results","certificate"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answers":{"description":"Each text answer at most 4000 characters.","type":"object","properties":{},"additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string","maxLength":4000},{"type":"number"},{"type":"null"}]},"maxProperties":500}},"required":["answers"],"additionalProperties":false}}}}}},"/v1/stores/{store}/quizzes/{quiz}/forfeit":{"post":{"operationId":"forfeitQuiz","summary":"Gives up the open attempt at a quiz.","tags":["quiz"],"security":[{"bearer":["quiz:write"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"quiz","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Gives up the open attempt at a quiz.","content":{"application/json":{"schema":{"type":"object","properties":{"attempt":{"type":"object","properties":{"id":{"type":"string"},"quiz_id":{"type":"string"},"entry_id":{"type":"string"},"attempt":{"type":"number"},"status":{"type":"string","x-extensible-enum":["failed","started","submitted","passed","forfeited"]},"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"correct":{"anyOf":[{"type":"number"},{"type":"null"}]},"started_at":{"type":"string"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","quiz_id","entry_id","attempt","status","score","correct","started_at","finished_at"]},"certificate":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"certificate_id":{"type":"string"},"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"attempt":{"anyOf":[{"type":"number"},{"type":"null"}]},"issued_at":{"type":"string"}},"required":["id","certificate_id","score","attempt","issued_at"]},{"type":"null"}]}},"required":["attempt","certificate"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/v1/stores/{store}/attempts":{"get":{"operationId":"listAttempts","summary":"Pages the customer's quiz attempts.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["started"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages the customer's quiz attempts.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"quiz_id":{"type":"string"},"entry_id":{"type":"string"},"attempt":{"type":"number"},"status":{"type":"string","x-extensible-enum":["failed","started","submitted","passed","forfeited"]},"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"correct":{"anyOf":[{"type":"number"},{"type":"null"}]},"started_at":{"type":"string"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","quiz_id","entry_id","attempt","status","score","correct","started_at","finished_at"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"facets":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{},"additionalProperties":{"type":"number"}}}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/certificates":{"get":{"operationId":"listCertificates","summary":"Pages the certificates issued to the customer.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["issued"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages the certificates issued to the customer.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"certificate":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string"},"quiz_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"headline_copy":{"type":"string"},"title_copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"awarded_copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason_copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"score_copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"out_of_score_copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"requires_passing":{"type":"boolean"},"shows":{"type":"array","items":{"type":"string","x-extensible-enum":["date","score","qr_code"]}},"template":{"type":"string","x-extensible-enum":["classic","framed"]},"accent":{"anyOf":[{"type":"string","x-extensible-enum":["emerald","blue","teal","indigo","purple","pink","red","orange","yellow","gray"]},{"type":"null"}]}},"required":["requires_passing","shows","template","accent"]}},"required":["id","product_id","quiz_id","headline_copy","title_copy","awarded_copy","reason_copy","score_copy","out_of_score_copy","settings"]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"certificate_id":{"type":"string"},"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"attempt":{"anyOf":[{"type":"number"},{"type":"null"}]},"issued_at":{"type":"string"}},"required":["certificate","product","id","certificate_id","score","attempt","issued_at"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/certificates/{certificate}":{"get":{"operationId":"getCertificate","summary":"Reads one certificate issued to the customer.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"certificate","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Reads one certificate issued to the customer.","content":{"application/json":{"schema":{"type":"object","properties":{"certificate":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string"},"quiz_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"headline_copy":{"type":"string"},"title_copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"awarded_copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason_copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"score_copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"out_of_score_copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"settings":{"type":"object","properties":{"requires_passing":{"type":"boolean"},"shows":{"type":"array","items":{"type":"string","x-extensible-enum":["date","score","qr_code"]}},"template":{"type":"string","x-extensible-enum":["classic","framed"]},"accent":{"anyOf":[{"type":"string","x-extensible-enum":["emerald","blue","teal","indigo","purple","pink","red","orange","yellow","gray"]},{"type":"null"}]}},"required":["requires_passing","shows","template","accent"]}},"required":["id","product_id","quiz_id","headline_copy","title_copy","awarded_copy","reason_copy","score_copy","out_of_score_copy","settings"]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]},"id":{"type":"string"},"certificate_id":{"type":"string"},"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"attempt":{"anyOf":[{"type":"number"},{"type":"null"}]},"issued_at":{"type":"string"}},"required":["certificate","product","id","certificate_id","score","attempt","issued_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/certificates/{certificate}/verify":{"get":{"operationId":"verifyCertificate","summary":"Checks that a certificate was issued and is not revoked.","tags":["store"],"security":[{"bearer":[]},{"publishableKey":[]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"certificate","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Checks that a certificate was issued and is not revoked.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"issued_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"holder":{"anyOf":[{"type":"string"},{"type":"null"}]},"headline_copy":{"type":"string"},"title_copy":{"anyOf":[{"type":"string"},{"type":"null"}]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","slug","title","category","deleted"]},{"type":"null"}]}},"required":["id","issued_at","score","holder","headline_copy","title_copy","product"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/products/{product}/portfolio":{"get":{"operationId":"getPortfolio","summary":"Reads a portfolio product's book, as far as the customer may.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"product","in":"path","required":true,"description":"An id, or `slug:<slug>`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Reads a portfolio product's book, as far as the customer may.","content":{"application/json":{"schema":{"type":"object","properties":{"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"product":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]},"access":{"type":"string","x-extensible-enum":["locked","unlocked","bypassed"]},"chart_cutoff":{"anyOf":[{"type":"string"},{"type":"null"}]},"holdings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"symbol":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"symbol_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"shares":{"anyOf":[{"type":"number"},{"type":"null"}]},"avg_cost":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","symbol","name","symbol_type","currency","shares","avg_cost","note","updated_at"]}},"id":{"type":"string"},"product_id":{"type":"string"},"currency":{"type":"string"},"settings":{"type":"object","properties":{"show_absolute_values":{"type":"boolean"},"locked_chart_delay":{"type":"string","x-extensible-enum":["week","month","none","current_quarter"]}},"required":["show_absolute_values","locked_chart_delay"]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["exponent","product","access","chart_cutoff","holdings","id","product_id","currency","settings","created_at"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/products/{product}/portfolio_events":{"get":{"operationId":"listPortfolioEvents","summary":"Pages a portfolio's events.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"product","in":"path","required":true,"description":"An id, or `slug:<slug>`.","schema":{"type":"string","minLength":1}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["occurred"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages a portfolio's events.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"shares":{"anyOf":[{"type":"number"},{"type":"null"}]},"price":{"anyOf":[{"type":"number"},{"type":"null"}]},"amount":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"effective_date":{"anyOf":[{"type":"string"},{"type":"null"}]},"symbol_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"price_currency":{"type":"string"},"price_exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"allocation":{"anyOf":[{"type":"number"},{"type":"null"}]},"allocation_change":{"anyOf":[{"type":"number"},{"type":"null"}]},"ratio":{"anyOf":[{"type":"object","properties":{"num":{"type":"number"},"den":{"type":"number"}},"required":["num","den"]},{"type":"null"}]},"files":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"attachment_id":{"type":"string"}},"required":["id","name","attachment_id"]}},{"type":"null"}]},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","symbol","type","shares","price","amount","note","effective_date","symbol_type","currency","exponent","price_currency","price_exponent","allocation","allocation_change","ratio","files","occurred_at"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/products/{product}/portfolio_snapshots":{"get":{"operationId":"listPortfolioSnapshots","summary":"Pages a portfolio's daily snapshots.","tags":["read"],"security":[{"bearer":["read"]}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"product","in":"path","required":true,"description":"An id, or `slug:<slug>`.","schema":{"type":"string","minLength":1}},{"name":"filter","in":"query","style":"deepObject","explode":true,"description":"`filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.","schema":{"type":"object"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["date"]}},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":400}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"count","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Pages a portfolio's daily snapshots.","headers":{"Link":{"description":"The next page, `<...>; rel=\"next\"`, while `cursor` is not null.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"currency":{"type":"string"},"exponent":{"anyOf":[{"type":"number"},{"type":"null"}]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"cash":{"anyOf":[{"type":"number"},{"type":"null"}]},"positions":{"anyOf":[{"type":"number"},{"type":"null"}]},"twr":{"anyOf":[{"type":"number"},{"type":"null"}]},"benchmark":{"anyOf":[{"type":"number"},{"type":"null"}]},"state":{"type":"string","x-extensible-enum":["provisional","settled"]}},"required":["date","currency","exponent","value","cash","positions","twr","benchmark","state"]}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"facets":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{},"additionalProperties":{"type":"number"}}}},"required":["items","cursor"]}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","headers":{"WWW-Authenticate":{"description":"On a 401, `Bearer error=\"invalid_token\"`, or `Bearer` alone when no token was sent or the publishable key was refused; on a 403 for a missing scope, `Bearer error=\"insufficient_scope\"`.","schema":{"type":"string"}},"Retry-After":{"description":"On a 429, the seconds until a retry may pass, when known.","schema":{"type":"integer","minimum":0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/stores/{store}/files/{capability}":{"get":{"operationId":"getFile","summary":"Answers the bytes of a private file a capability names, to the bearer or the publishable key that asked for it.","description":"A video or audio file a customer's token asked for is answered by its URL alone, with no credential, so a bare `<video src>` plays it; any other file needs its credential.","tags":["read"],"security":[{"bearer":[]},{"publishableKey":[]},{}],"parameters":[{"name":"store","in":"path","required":true,"description":"A hostname of the store.","schema":{"type":"string"}},{"name":"capability","in":"path","required":true,"description":"The rest of the URL `POST /attachments/url` answered, its file name included.","schema":{"type":"string","minLength":1}},{"name":"publishable_key","in":"query","required":false,"description":"The publishable key the URL was asked for with, already on the URL `POST /attachments/url` answered, so a bare `src` can name it: it stands in for the `Publishable-Key` header, and may be sent beside it only with the same key. A customer's token is never taken in the URL.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"Range","in":"header","required":false,"description":"One byte range of a file shown in place, `bytes={first}-{last}`, `bytes={first}-` or `bytes=-{suffix}`; a download is answered whole.","schema":{"type":"string"}},{"name":"If-Range","in":"header","required":false,"description":"The file's `ETag` from an earlier answer: the range is answered only while the file is unchanged, else the whole file.","schema":{"type":"string"}}],"responses":{"200":{"description":"The file's bytes, with its type and disposition.","headers":{"Accept-Ranges":{"description":"On a file shown in place: it takes a `Range`.","schema":{"type":"string","const":"bytes"}},"ETag":{"description":"On a file shown in place: the file as served, for `If-Range`.","schema":{"type":"string"}}},"content":{"*/*":{"schema":{"type":"string","format":"binary"}}}},"206":{"description":"The range asked for.","headers":{"Content-Range":{"description":"The range served and the size of the file.","schema":{"type":"string"}},"Accept-Ranges":{"schema":{"type":"string","const":"bytes"}},"ETag":{"description":"The file as served, for `If-Range`.","schema":{"type":"string"}}},"content":{"*/*":{"schema":{"type":"string","format":"binary"}}}},"416":{"description":"The range lies outside the file, or is other than one bytes range.","headers":{"Content-Range":{"description":"The size of the file, `bytes */{size}`, when it is known.","schema":{"type":"string"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"A problem; see https://customer-api.sherpo.io/docs/errors.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"schemas":{"Problem":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"code":{"type":"string"},"context":{"type":"object"},"reached_core":{"type":"boolean"},"core_answer":{"type":"string"}},"required":["type","title","status","detail"]}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"A customer's access token from the store's authorization server, https://customer-auth.sherpo.it/s/{store}."},"publishableKey":{"type":"apiKey","in":"header","name":"Publishable-Key","description":"The store's publishable key, for reading its catalog and pages, and opening the files they list, before anyone signs in; see /docs/auth."}}}}