Skip to Content

ConsentInput

Input for recording a customer consent. Each item is appended to the consent history.

Input Definition

input ConsentInput { type: String! accepted: Boolean! text: String metafields: [MetafieldInput] createdAt: String }

Fields

FieldTypeRequiredDescription
typeStringYesConsent type identifier (e.g. privacy_policy, marketing, cookie_policy, or a custom slug).
acceptedBooleanYesWhether the consent was accepted. Cookie policy submissions are stored as accepted.
textStringNoOptional agreed wording. Known types use server-generated wording when omitted.
metafields[MetafieldInput]NoMetafields stored on this consent. cookie_policy requires cookie_policy.mode and cookie_policy.categories.
createdAtStringNoOptional original agreement time (ISO 8601). Used so cookie banner time is preserved.

Example

mutation { recordConsent(input: { type: "privacy_policy" accepted: true text: "I agree to the privacy policy" createdAt: "2024-01-15T10:30:00Z" }) { consent { type accepted createdAt } } }