{
  "name": "JLJ Treasury — SEPA Creditor ID + pain.008 Direct Debit Batch Generator (JLJ Lab)",
  "flow": [
    {
      "id": 1,
      "module": "gateway:CustomWebHook",
      "version": 1,
      "metadata": { "designer": { "x": 0, "y": 0 } },
      "parameters": {}
    },
    {
      "id": 2,
      "module": "http:ActionSendData",
      "version": 3,
      "metadata": { "designer": { "x": 300, "y": 0 } },
      "mapper": {
        "url": "https://treasury-api.specgrid-api.workers.dev/api/v1/sepa/creditor-id",
        "method": "post",
        "headers": [
          { "name": "Authorization", "value": "Bearer JLJ-REPLACE-WITH-YOUR-POLAR-KEY" },
          { "name": "Content-Type", "value": "application/json" }
        ],
        "bodyType": "raw",
        "contentType": "application/json",
        "data": "{\"mode\":\"generate\",\"countryCode\":\"ES\",\"nationalId\":\"{{1.creditorTaxId}}\",\"businessCode\":\"000\"}"
      }
    },
    {
      "id": 3,
      "module": "http:ActionSendData",
      "version": 3,
      "metadata": { "designer": { "x": 600, "y": 0 } },
      "mapper": {
        "url": "https://treasury-api.specgrid-api.workers.dev/api/v1/sepa/pain008",
        "method": "post",
        "headers": [
          { "name": "Authorization", "value": "Bearer JLJ-REPLACE-WITH-YOUR-POLAR-KEY" },
          { "name": "Content-Type", "value": "application/json" }
        ],
        "bodyType": "raw",
        "contentType": "application/json",
        "data": "{\"schemaVersion\":\"pain.008.001.02\",\"scheme\":\"CORE\",\"sequenceType\":\"RCUR\",\"messageId\":\"{{1.messageId}}\",\"collectionDate\":\"{{1.collectionDate}}\",\"creditorName\":\"{{1.creditorName}}\",\"creditorIban\":\"{{1.creditorIban}}\",\"creditorId\":\"{{2.data.normalized}}\",\"debits\":{{1.debits}}}"
      }
    }
  ],
  "metadata": { "version": 1, "scenario": { "roundtrips": 1 } }
}
