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-102What you get
--json, --csv or --ndjson for scripts, or -q for ids only. An AI agent gets compact JSON without asking. All output formats03Build your command
Pick values and the command line writes itself, quoted and ready to paste.
p202 conversion createSet flags below; the command updates as you type.
04Flags
15 flags, plus the global flags every command takes.
| Flag | What it does |
|---|---|
| --click-idstringrequired | Click ID (required) |
| --click-id-publicstring | Legacy alias for --click-id |
| --conv-timestring | When it converted, unix seconds (default now) |
| --conversion-payoutstring | Legacy alias for --payout |
| --customer-crmstring | CRM fields as a JSON object, applied only when this call creates the customer, e.g. '{"email":"[email protected]","first_name":"Ada"}' |
| --customer-idstring | The customer's internal id (p202 ltv customers) |
| --customer-refstring | Your system's id for the customer; the server finds it, or creates a customer for it |
| --customer-ref-typestring | What kind of reference --customer-ref is (default custom): email_md5, email_sha256, esp_id, merchant_id, subid, customemail_md5email_sha256esp_idmerchant_idsubidcustom |
| --idempotency-keystring | 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 |
| --itemstringArray | A line item as a JSON object (repeatable), e.g. '{"sku":"PRO-1","name":"Pro plan","quantity":1,"unit_price":49}' |
| --items-filestring | Line items as a JSON array in a file (- for stdin), instead of --item |
| --payoutstring | Payout amount |
| --reversal-idstring | The network's id for the reversal (with --status reversed) |
| --statusstring | Record a reversal of the click's conversion with this --transaction-id: reversedreversed |
| --transaction-idstring | Transaction 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-106For agents
Running this from an agent
- Read the same facts as JSON:
p202 commands conversion create --json. - With
AI_AGENT,CLAUDECODEor another agent variable set, output is compact JSON and errors arrive on stderr as a JSON envelope with ahint. - Exit codes: 0 ok, 1 bad input, 2 auth, 3 network, 4 server error, 5 partial failure.
- This command writes. Add
--stagedto record it as a proposal a person applies withp202 change apply.
{
"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
}
]
}