Record a purchase outcome for a product (product_id or product_url). Requires an API key (Authorization: Bearer header). Proofs: shopify_order (shop domain, order number, confirmation number) is checked against the shop's order record; email_receipt (the merchant's original DKIM-signed confirmation email, order number, product name) is checked by its signature; both count when they match. payment_receipt is stored as quarantined.
View input schema
{
"type": "object",
"properties": {
"outcome": {
"enum": [
"kept_silent",
"kept_positive",
"complained",
"returned"
],
"title": "Outcome",
"type": "string"
},
"proof": {
"discriminator": {
"mapping": {
"email_receipt": "#/$defs/EmailReceiptProof",
"payment_receipt": "#/$defs/PaymentReceiptProof",
"shopify_order": "#/$defs/ShopifyOrderProof"
},
"propertyName": "type"
},
"oneOf": [
{
"$ref": "#/$defs/PaymentReceiptProof"
},
{
"$ref": "#/$defs/ShopifyOrderProof"
},
{
"$ref": "#/$defs/EmailReceiptProof"
}
],
"title": "Proof"
},
"product_id": {
"anyOf": [
{
"format": "uuid",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Product Id"
},
"product_url": {
"anyOf": [
{
"maxLength": 500,
"pattern": "^https://",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Product Url"
},
"reasons": {
"default": [],
"items": {
"enum": [
"size",
"quality",
"not_as_described",
"late_delivery",
"damaged",
"other"
],
"type": "string"
},
"maxItems": 6,
"title": "Reasons",
"type": "array"
}
},
"required": [
"outcome",
"proof"
],
"$defs": {
"EmailReceiptProof": {
"properties": {
"type": {
"const": "email_receipt",
"title": "Type",
"type": "string"
},
"raw_email_base64": {
"description": "The merchant's original order confirmation email (.eml, RFC 5322), base64-encoded. Its DKIM signature is verified; the email is processed in memory and never stored.",
"maxLength": 2800000,
"title": "Raw Email Base64",
"type": "string"
},
"order_number": {
"description": "Order number as it appears in the email.",
"maxLength": 60,
"minLength": 1,
"title": "Order Number",
"type": "string"
},
"product_name": {
"description": "Product name exactly as it appears in the email.",
"maxLength": 200,
"minLength": 3,
"title": "Product Name",
"type": "string"
}
},
"required": [
"type",
"raw_email_base64",
"order_number",
"product_name"
],
"title": "EmailReceiptProof",
"type": "object"
},
"PaymentReceiptProof": {
"properties": {
"type": {
"const": "payment_receipt",
"title": "Type",
"type": "string"
},
"reference": {
"description": "Receipt or transaction reference. Hashed on arrival, never stored.",
"maxLength": 200,
"minLength": 4,
"title": "Reference",
"type": "string"
},
"purchased_on": {
"format": "date",
"title": "Purchased On",
"type": "string"
}
},
"required": [
"type",
"reference",
"purchased_on"
],
"title": "PaymentReceiptProof",
"type": "object"
},
"ShopifyOrderProof": {
"properties": {
"type": {
"const": "shopify_order",
"title": "Type",
"type": "string"
},
"shop_domain": {
"description": "The store's domain, e.g. brand.com or brand.myshopify.com.",
"pattern": "^[A-Za-z0-9][A-Za-z0-9.-]{1,253}$",
"title": "Shop Domain",
"type": "string"
},
"order_number": {
"description": "Order number as shown to the buyer, e.g. #1001. Never stored.",
"pattern": "^#?[A-Za-z0-9-]{1,40}$",
"title": "Order Number",
"type": "string"
},
"confirmation_number": {
"description": "Order confirmation number from the order confirmation, e.g. XPLZ3K9HG. Never stored.",
"pattern": "^[A-Za-z0-9]{6,20}$",
"title": "Confirmation Number",
"type": "string"
}
},
"required": [
"type",
"shop_domain",
"order_number",
"confirmation_number"
],
"title": "ShopifyOrderProof",
"type": "object"
}
},
"title": "submit_outcomeArguments"
}