# `sp_addCustomer` (procedure) > 测试提供客户插入接口数据源过程 - **Type:** PROCEDURE - **Deterministic:** NO - **SQL data access:** CONTAINS SQL ## Parameters | # | Mode | Name | Type | |---|---|---|---| | 1 | IN | `sSuId` | `varchar(100)` | | 2 | IN | `sBrId` | `varchar(100)` | | 3 | IN | `sBody` | `longtext` | | 4 | OUT | `sCode` | `int` | | 5 | OUT | `sReturn` | `longtext` | | 6 | OUT | `sParam` | `longtext` | ## Body _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `sp_addCustomer`'`._ ## Narrative **Business context:** 第三方接口 (third-party API) template proc. Header says "测试提供客户插入接口数据源过程" — a sample/test interface used in the xly 培训 (training) material to show how an external system can POST a customer payload to the ERP and have it land in `elecustomer`. Parameters follow the canonical interface signature (`sSuId`, `sBrId`, `sBody` IN; `sCode`, `sReturn`, `sParam` OUT), so the proc can be dropped into the generic interface dispatcher without code changes. **What it does:** Validates `sBody` is JSON; iterates `$.column[]`; for each element extracts ~40 customer fields (`sCustomerName`, `sParentId`, `sCustomerType`, `sCustomerShort`, contact/phone/email/address fields, sales-man/merchandiser/tax/payment ids, etc.); runs one `INSERT INTO elecustomer` per element with `sId=newId()` and `sCustomerNo=newId()`. Always returns `sCode=1` / `sReturn='操作成功'`; ignores `handleType` so it can't update or delete, only insert. **Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep) — candidate for maintainer audit. The proc is templated as a demo for the 第三方接口 module and was never wired to a button or external endpoint; production customer creation goes through the `elecustomer` form save chain instead.