Custom function to create an invoice from a list of subforms

Custom function to create an invoice from a list of subforms

I want to create an invoice based on the list of subforms created in a custom module. Please tell me the custom function to be assembled.
The custom module JSON is below.
  1. {
  2.   "Owner": {
  3.     "name": "EX NAME",
  4.     "id": "3872746000000200013"
  5.   },
  6.   "$currency_symbol": "¥",
  7.   "field19": null,
  8.   "field17": "5年リース",
  9.   "field18": "見積発行より2週間",
  10.   "Last_Activity_Time": "2019-03-23T22:04:14+09:00",
  11.   "Name": "1001",
  12.   "field22": null,
  13.   "field23": null,
  14.   "field20": null,
  15.   "field21": "ご相談の上",
  16.   "field26": "貴社指定場所",
  17.   "$process_flow": false,
  18.   "field27": "別途契約",
  19.   "field24": null,
  20.   "Currency": "JPY",
  21.   "field25": null,
  22.   "id": "1234546000000239389",
  23.   "$approved": true,
  24.   "$approval": {
  25.     "delegate": false,
  26.     "approve": false,
  27.     "reject": false,
  28.     "resubmit": false
  29.   },
  30.   "Modified_Time": "2019-03-23T22:04:14+09:00",
  31.   "Created_Time": "2019-03-21T07:56:55+09:00",
  32.   "$editable": true,
  33.   "field28": null,
  34.   "field29": null,
  35.   "field11": "2019-03-21",
  36.   "field12": "リース",
  37.   "field1": {
  38.     "name": "株式会社サンプルカンパニー PC一式",
  39.     "id": "3872746000000227195"
  40.   },
  41.   "field10": 48800,
  42.   "field": {
  43.     "name": "株式会社サンプルカンパニー",
  44.     "id": "3872746000000216241"
  45.   },
  46.   "field15": "納品月末締め翌月末お振込み",
  47.   "field16": null,
  48.   "field13": "下記の通り",
  49.   "field14": null,
  50.   "field7": 62.69,
  51.   "field6": 1680000,
  52.   "field9": 1.82,
  53.   "Tag": [],
  54.   "field8": "60",
  55.   "field3": [
  56.     {
  57.       "$approval": {
  58.         "delegate": false,
  59.         "approve": false,
  60.         "reject": false,
  61.         "resubmit": false
  62.       },
  63.       "$currency_symbol": "¥",
  64.       "Parent_Id": {
  65.         "name": "1001",
  66.         "id": "1234546000000239389"
  67.       },
  68.       "$editable": true,
  69.       "field1": 200000,
  70.       "field": {
  71.         "name": "PC # Example Laptop PC",
  72.         "id": "3872746000000227048"
  73.       },
  74.       "$process_flow": false,
  75.       "field7": 1000000,
  76.       "field6": 500000,
  77.       "id": "3872746000000239391",
  78.       "field3": 100000,
  79.       "field2": 5,
  80.       "$approved": true,
  81.       "field5": 500000,
  82.       "field4": 50
  83.     },
  84.     {
  85.       "$approval": {
  86.         "delegate": false,
  87.         "approve": false,
  88.         "reject": false,
  89.         "resubmit": false
  90.       },
  91.       "$currency_symbol": "¥",
  92.       "Parent_Id": {
  93.         "name": "1001",
  94.         "id": "1234546000000239389"
  95.       },
  96.       "$editable": true,
  97.       "field1": 300000,
  98.       "field": {
  99.         "name": "PC # Example Laptop PC",
  100.         "id": "3872746000000227048"
  101.       },
  102.       "$process_flow": false,
  103.       "field7": 1500000,
  104.       "field6": 1000000,
  105.       "id": "3872746000000239393",
  106.       "field3": 100000,
  107.       "field2": 5,
  108.       "$approved": true,
  109.       "field5": 500000,
  110.       "field4": 66.67
  111.     },
  112.     {
  113.       "$approval": {
  114.         "delegate": false,
  115.         "approve": false,
  116.         "reject": false,
  117.         "resubmit": false
  118.       },
  119.       "$currency_symbol": "¥",
  120.       "Parent_Id": {
  121.         "name": "1001",
  122.         "id": "1234546000000239389"
  123.       },
  124.       "$editable": true,
  125.       "field1": 15000,
  126.       "field": {
  127.         "name": "作業費 # PCデータ移行作業",
  128.         "id": "3872746000000241031"
  129.       },
  130.       "$process_flow": false,
  131.       "field7": 90000,
  132.       "field6": 90000,
  133.       "id": "3872746000000241037",
  134.       "field3": null,
  135.       "field2": 6,
  136.       "$approved": true,
  137.       "field5": 0,
  138.       "field4": 100
  139.     },
  140.     {
  141.       "$approval": {
  142.         "delegate": false,
  143.         "approve": false,
  144.         "reject": false,
  145.         "resubmit": false
  146.       },
  147.       "$currency_symbol": "¥",
  148.       "Parent_Id": {
  149.         "name": "1001",
  150.         "id": "1234546000000239389"
  151.       },
  152.       "$editable": true,
  153.       "field1": 15000,
  154.       "field": {
  155.         "name": "作業費 # PCデータ移行作業",
  156.         "id": "3872746000000241031"
  157.       },
  158.       "$process_flow": false,
  159.       "field7": 90000,
  160.       "field6": 90000,
  161.       "id": "3872746000000241057",
  162.       "field3": null,
  163.       "field2": 6,
  164.       "$approved": true,
  165.       "field5": 0,
  166.       "field4": 100
  167.     }
  168.   ],
  169.   "field2": "PC6台",
  170.   "field5": 2680000,
  171.   "field4": 1000000
  172. }
It is some of these values that I want to pass to the invoice,
How do I pass a list of subforms ("field3") to an invoice?
Please give me some advice.