p202 conversion create

Create a conversion

Writessupports --staged
All commands

01Run it

Straight from the command's own help.

p202 conversion create --click-id 123 --payout 49 --transaction-id ORD-1 --customer-ref CUST-77 --item '{"sku":"PRO-1","quantity":1,"unit_price":49}'
p202 conversion create --click-id 123 --status reversed --transaction-id ORD-1

02What you get

Pick the shape you need. People get a table. Add --json, --csv or --ndjson for scripts, or -q for ids only. An AI agent gets compact JSON without asking. All output formats

03Build your command

Pick values and the command line writes itself, quoted and ready to paste.

p202 conversion create

Set flags below; the command updates as you type.

04Flags

15 flags, plus the global flags every command takes.

FlagWhat it does
--click-idstringrequiredClick ID (required)
--click-id-publicstringLegacy alias for --click-id
--conv-timestringWhen it converted, unix seconds (default now)
--conversion-payoutstringLegacy alias for --payout
--customer-crmstringCRM fields as a JSON object, applied only when this call creates the customer, e.g. '{"email":"[email protected]","first_name":"Ada"}'
--customer-idstringThe customer's internal id (p202 ltv customers)
--customer-refstringYour system's id for the customer; the server finds it, or creates a customer for it
--customer-ref-typestringWhat kind of reference --customer-ref is (default custom): email_md5, email_sha256, esp_id, merchant_id, subid, custom
email_md5email_sha256esp_idmerchant_idsubidcustom
--idempotency-keystringRetry-safe create: the server records the response under this key and replays it on a retry with the same key and payload instead of creating a duplicate
--itemstringArrayA line item as a JSON object (repeatable), e.g. '{"sku":"PRO-1","name":"Pro plan","quantity":1,"unit_price":49}'
--items-filestringLine items as a JSON array in a file (- for stdin), instead of --item
--payoutstringPayout amount
--reversal-idstringThe network's id for the reversal (with --status reversed)
--statusstringRecord a reversal of the click's conversion with this --transaction-id: reversed
reversed
--transaction-idstringTransaction ID for deduplication

05How it works

Records a conversion on a click. --status reversed records a reversal of the click's earlier conversion with the same --transaction-id instead (--reversal-id is the network's id for it). --customer-id or --customer-ref (+ --customer-ref-type, --customer-crm) links it to an LTV customer; --item / --items-file add product line items to that customer's revenue event, so they need a customer: one named here, one already linked to the click, or the account's customer c-param. The server refuses items that find none, and records nothing.

p202 conversion create --click-id 123 --payout 49 --transaction-id ORD-1 --customer-ref CUST-77 \
    --item '{"sku":"PRO-1","quantity":1,"unit_price":49}'
p202 conversion create --click-id 123 --status reversed --transaction-id ORD-1

06For agents

Running this from an agent

  • Read the same facts as JSON: p202 commands conversion create --json.
  • With AI_AGENT, CLAUDECODE or another agent variable set, output is compact JSON and errors arrive on stderr as a JSON envelope with a hint.
  • Exit codes: 0 ok, 1 bad input, 2 auth, 3 network, 4 server error, 5 partial failure.
  • This command writes. Add --staged to record it as a proposal a person applies with p202 change apply.
p202 commands conversion create --json
{
  "path": "p202 conversion create",
  "use": "create",
  "short": "Create a conversion",
  "long": "Records a conversion on a click. --status reversed records a reversal of the click's earlier\nconversion with the same --transaction-id instead (--reversal-id is the network's id for it).\n--customer-id or --customer-ref (+ --customer-ref-type, --customer-crm) links it to an LTV\ncustomer; --item / --items-file add product line items to that customer's revenue event, so\nthey need a customer: one named here, one already linked to the click, or the account's\ncustomer c-param. The server refuses items that find none, and records nothing.\n\n  p202 conversion create --click-id 123 --payout 49 --transaction-id ORD-1 --customer-ref CUST-77 \\\n      --item '{\"sku\":\"PRO-1\",\"quantity\":1,\"unit_price\":49}'\n  p202 conversion create --click-id 123 --status reversed --transaction-id ORD-1",
  "runnable": true,
  "flags": [
    {
      "name": "click-id",
      "type": "string",
      "default": "",
      "usage": "Click ID (required)",
      "required": true
    },
    {
      "name": "click-id-public",
      "type": "string",
      "default": "",
      "usage": "Legacy alias for --click-id",
      "required": false
    },
    {
      "name": "conv-time",
      "type": "string",
      "default": "",
      "usage": "When it converted, unix seconds (default now)",
      "required": false
    },
    {
      "name": "conversion-payout",
      "type": "string",
      "default": "",
      "usage": "Legacy alias for --payout",
      "required": false
    },
    {
      "name": "customer-crm",
      "type": "string",
      "default": "",
      "usage": "CRM fields as a JSON object, applied only when this call creates the customer, e.g. '{\"email\":\"[email protected]\",\"first_name\":\"Ada\"}'",
      "required": false
    },
    {
      "name": "customer-id",
      "type": "string",
      "default": "",
      "usage": "The customer's internal id (`p202 ltv customers`)",
      "required": false
    },
    {
      "name": "customer-ref",
      "type": "string",
      "default": "",
      "usage": "Your system's id for the customer; the server finds it, or creates a customer for it",
      "required": false
    },
    {
      "name": "customer-ref-type",
      "type": "string",
      "default": "",
      "usage": "What kind of reference --customer-ref is (default custom): email_md5, email_sha256, esp_id, merchant_id, subid, custom",
      "allowed_values": [
        "email_md5",
        "email_sha256",
        "esp_id",
        "merchant_id",
        "subid",
        "custom"
      ],
      "required": false
    },
    {
      "name": "idempotency-key",
      "type": "string",
      "default": "",
      "usage": "Retry-safe create: the server records the response under this key and replays it on a retry with the same key and payload instead of creating a duplicate",
      "required": false
    },
    {
      "name": "item",
      "type": "stringArray",
      "default": "[]",
      "usage": "A line item as a JSON object (repeatable), e.g. '{\"sku\":\"PRO-1\",\"name\":\"Pro plan\",\"quantity\":1,\"unit_price\":49}'",
      "required": false
    },
    {
      "name": "items-file",
      "type": "string",
      "default": "",
      "usage": "Line items as a JSON array in a file (- for stdin), instead of --item",
      "required": false
    },
    {
      "name": "payout",
      "type": "string",
      "default": "",
      "usage": "Payout amount",
      "required": false
    },
    {
      "name": "reversal-id",
      "type": "string",
      "default": "",
      "usage": "The network's id for the reversal (with --status reversed)",
      "required": false
    },
    {
      "name": "status",
      "type": "string",
      "default": "",
      "usage": "Record a reversal of the click's conversion with this --transaction-id: reversed",
      "allowed_values": [
        "reversed"
      ],
      "required": false
    },
    {
      "name": "transaction-id",
      "type": "string",
      "default": "",
      "usage": "Transaction ID for deduplication",
      "required": false
    }
  ]
}