{
  "name": "Lancer: form → client + payment request with pay link",
  "flow": [
    {
      "id": 1,
      "module": "gateway:CustomWebHook",
      "version": 1,
      "parameters": { "hook": null, "maxResults": 1 },
      "mapper": {},
      "metadata": {
        "designer": { "x": 0, "y": 0 },
        "interface": [
          { "name": "name", "type": "text" },
          { "name": "email", "type": "text" },
          { "name": "phone", "type": "text" },
          { "name": "title", "type": "text" },
          { "name": "amountShekels", "type": "number" }
        ]
      }
    },
    {
      "id": 2,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": { "handleErrors": true, "useNewZLibDeCompress": true },
      "mapper": {
        "url": "https://api.lancer-erp.com/api/v1/clients",
        "method": "post",
        "headers": [
          { "name": "Authorization", "value": "Bearer lk_YOUR_KEY" },
          { "name": "Content-Type", "value": "application/json" }
        ],
        "bodyType": "raw",
        "contentType": "application/json",
        "data": "{\"name\": \"{{1.name}}\", \"email\": \"{{1.email}}\", \"phone\": \"{{1.phone}}\", \"source\": \"api\", \"tags\": [\"Make\"]}",
        "parseResponse": true,
        "timeout": "30"
      },
      "metadata": { "designer": { "x": 300, "y": 0 } }
    },
    {
      "id": 3,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": { "handleErrors": true, "useNewZLibDeCompress": true },
      "mapper": {
        "url": "https://api.lancer-erp.com/api/v1/payment-requests",
        "method": "post",
        "headers": [
          { "name": "Authorization", "value": "Bearer lk_YOUR_KEY" },
          { "name": "Content-Type", "value": "application/json" }
        ],
        "bodyType": "raw",
        "contentType": "application/json",
        "data": "{\"clientId\": \"{{2.data.id}}\", \"title\": \"{{1.title}}\", \"amountAgorot\": {{round(1.amountShekels * 100)}}, \"createLink\": true}",
        "parseResponse": true,
        "timeout": "30"
      },
      "metadata": { "designer": { "x": 600, "y": 0 } }
    },
    {
      "id": 4,
      "module": "gateway:WebhookRespond",
      "version": 1,
      "parameters": {},
      "mapper": {
        "status": "200",
        "body": "{\"paymentRequestId\": \"{{3.data.id}}\", \"payUrl\": \"{{3.data.payUrl}}\"}",
        "headers": [{ "key": "Content-Type", "value": "application/json" }]
      },
      "metadata": { "designer": { "x": 900, "y": 0 } }
    }
  ],
  "metadata": {
    "instant": true,
    "version": 1,
    "scenario": { "roundtrips": 1, "maxErrors": 3, "autoCommit": true, "autoCommitTriggerLast": true, "sequential": false, "confidential": true, "dataloss": false, "dlq": false },
    "designer": { "orphans": [] }
  }
}
