Qeasy Cloud
Get Started
POSThttp://api.guanyierp.com/rest/erp_openappkey + sessionkey + MD5 签名

Call Convention and Signing (appkey/sessionkey/sign)

管易云 C-ERP openAPI 调用规范:统一网关 /rest/erp_open,JSON 报文携带 appkey、sessionkey、method 与 sign;sign 为参数排序拼接后首尾加 secret 的 MD5。

## Overview GuanYi C-ERP's openAPI follows a single-gateway + method-routing model: every interface POSTs to one URL (V1 tenants http://api.guanyierp.com/rest/erp_open, V2 tenants http://v2.api.guanyierp.com/rest/erp_open) with a UTF-8 JSON body, and the method field selects the business API (e.g. gy.erp.trade.get). ### System-level parameters | Parameter | Meaning | | --- | --- | | appkey | Application key, from Control Panel > App Authorization > Cloud ERP Authorization | | sessionkey | Session key, same page | | method | API name | | sign | Signature | ### Signing steps 1. Take every parameter except sign (system + business) and sort ascending by name. 2. Concatenate as key+value pairs. 3. Prepend and append the app secret. 4. MD5 the result — that is the sign. ### Responses and errors Responses carry success (true/false); failures add errorCode, subErrorCode, errorDesc and subErrorDesc — e.g. an expired sessionkey returns errorCode "Base Param error" with subErrorCode "ErrorSessionKey". Alert classification should key on subErrorCode. ### Notes - appkey/sessionkey/secret all come from the same console page; V1 and V2 gateways differ and must not be mixed. - Paged queries require page_no/page_size; the total field reports the full count under the current conditions. ### Troubleshooting order When a call fails, check in this order: the gateway host matches the tenant version (V1 vs V2), the sessionkey is still valid, parameters are sorted strictly ascending, and nothing in the concatenated string was URL-encoded. The official C-ERP support site documents the spec and should win over community blog posts whenever behavior differs.

Code examples

pseudo
params = { appkey, sessionkey, method: "gy.erp.trade.get", ...biz }
sign = md5(secret + concatSortedKV(params) + secret)
POST http://api.guanyierp.com/rest/erp_open
Content-Type: application/json; charset=UTF-8
{ ...params, sign }

Error codes

CodeMessageMeaning
Base Param error / ErrorSessionKey基本参数错误sessionkey 无效或过期,重新获取授权信息
Base Param error / ErrorAppKey基本参数错误appkey 错误或未授权
Sign error签名错误按签名规则重算 sign,检查排序与 secret