# CREDITMANAGEMENTACCOUNTBYIDQU1

**SOAP v1.0.0 — ACTIVE**

## Title / 标题
**Credit Management Account – Read / 信用管理账户 - 读取**

## Operation / 操作
`CreditManagementAccountByIdQuery`

---

## Description / 描述
This synchronous inbound service requests and retrieves credit data from SAP Credit Management, providing credit account information and credit exposure details by account ID.

此同步入站服务从SAP信用管理请求和检索信用数据，按账户ID提供信用账户信息和信用敞口详情。

---

## Endpoint / 端点
| Environment | URL |
|-------------|-----|
| Production | `https://sap.example.com/sap/bc/srt/rfc/sap/CREDITMANAGEMENTACCOUNTBYIDQU1` |
| Test | `https://sap-test.example.com/sap/bc/srt/rfc/sap/CREDITMANAGEMENTACCOUNTBYIDQU1` |

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `CreditAccountId` | `CHAR(10)` | Credit management account ID | 信用管理账户ID |
| `CompanyCode` | `CHAR(4)` | Company code | 公司代码 |
| `CreditSegment` | `CHAR(10)` | Credit segment | 信用细分 |

### Response / 响应
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `Return` | `BAPIRETURN` | Application log message | 应用程序日志消息 |
| `?Type` | `CHAR(1)` | Message type (S/E/W/I) | 消息类型（成功/错误/警告/信息） |
| `?Message` | `CHAR(220)` | Message text | 消息文本 |
| `CreditAccount` | `CMACCOUNT` | Credit account details | 信用账户详情 |
| `?CreditLimit` | `DECIMAL` | Credit limit amount | 信用限额 |
| `?Currency` | `CUKY(5)` | Currency of credit limit | 信用限额货币 |
| `?TotalExposure` | `DECIMAL` | Total credit exposure | 总信用敞口 |
| `?AvailableCredit` | `DECIMAL` | Available credit | 可用信用额度 |
| `?CreditScore` | `DECIMAL` | Credit score | 信用评分 |
| `?CreditRating` | `CHAR(3)` | Credit rating | 信用评级 |
| `?BlockedAmount` | `DECIMAL` | Blocked credit amount | 冻结信用金额 |
| `?CreditStatus` | `CHAR(1)` | Credit status (A=active, B=blocked) | 信用状态（A=活跃，B=冻结） |

---

## Example Payload / 示例负载

### Request
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CreditManagementAccountByIdQuery>
      <CreditAccountId>ACC-00010001</CreditAccountId>
      <CompanyCode>1000</CompanyCode>
      <CreditSegment>DOMESTIC</CreditSegment>
    </CreditManagementAccountByIdQuery>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CreditManagementAccountByIdQueryResponse>
      <Return>
        <Type>S</Type>
        <Message>Account data retrieved / 账户数据已检索</Message>
      </Return>
      <CreditAccount>
        <CreditLimit>1000000.00</CreditLimit>
        <Currency>CNY</Currency>
        <TotalExposure>350000.00</TotalExposure>
        <AvailableCredit>650000.00</AvailableCredit>
        <CreditScore>85.50</CreditScore>
        <CreditRating>AA</CreditRating>
        <BlockedAmount>0.00</BlockedAmount>
        <CreditStatus>A</CreditStatus>
      </CreditAccount>
    </CreditManagementAccountByIdQueryResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `CRM_001` | Credit account not found | 未找到信用账户 |
| `CRM_002` | Company code not assigned to account | 公司代码未分配给账户 |
| `CRM_003` | Credit segment is invalid | 信用细分无效 |
| `CRM_004` | Credit management system unavailable | 信用管理系统不可用 |

---

## Notes / 备注
- The account ID must exist in SAP Credit Management / 账户ID必须存在于SAP信用管理中
- Available credit = Credit limit - Total exposure - Blocked amount / 可用信用额度 = 信用限额 - 总敞口 - 冻结金额
- Credit scores are on a scale of 0-100 / 信用评分范围为0-100