---
# API: Pricing Configuration Migration APIs
# File: PricingConfigurationMigrationService_APIs.md
# Version: 1.0
# Status: ACTIVE
# Protocol: OData V2
# Source URL: https://api.sap.com/api/PricingConfigurationMigrationService_APIs/overview
# Generated: 2026-07-24
---

# Pricing Configuration Migration APIs / 定价配置迁移 API

> **API 版本:** 1.0 | **状态:** ACTIVE | **协议:** OData V2  
> **技术名称:** `PricingConfigurationMigrationService_APIs`  
> **服务根路径:** `/sap/opu/odata/sap/PricingConfigurationMigrationService_APIs`

## 概述 / Overview

该服务提供用于导出和导入定价配置的高级API接口，支持定价方案的批量迁移和同步。

This service provides advanced API interfaces for exporting and importing pricing configurations, supporting batch migration and synchronization of pricing schemes.

**区别:** 与 `PricingConfigurationMigrationService` 相比，本版本提供额外的实体用于更细粒度的定价配置管理，包括条件排除、附加费和折扣处理。

**Difference:** Compared to `PricingConfigurationMigrationService`, this version provides additional entities for more granular pricing configuration management, including condition exclusions, surcharges, and discount handling.

---

## 实体列表 / Entity List

| # | 实体名称 | 描述 (EN) | 描述 (CN) | 主键 |
|---|----------|-----------|-----------|------|
| 1 | `PricingScheme` | Pricing Scheme Header | 定价方案抬头 | `PricingSchemeId` |
| 2 | `PricingConditionRecord` | Pricing Condition Records | 定价条件记录 | `PricingSchemeId`, `ConditionRecordId` |
| 3 | `PricingProcedure` | Pricing Procedure Assignment | 定价过程分配 | `PricingSchemeId`, `ProcedureId` |
| 4 | `PricingScale` | Pricing Scale Values | 定价阶梯 | `PricingSchemeId`, `ScaleId` |
| 5 | `PricingExclusion` | Pricing Condition Exclusion | 定价条件排除 | `PricingSchemeId`, `ExclusionId` |
| 6 | `PricingSurcharge` | Pricing Surcharge/Discount | 定价附加费/折扣 | `PricingSchemeId`, `SurchargeId` |

---

## 1. PricingScheme — 定价方案抬头

**实体集合路径:** `PricingScheme`  
**主键 (Key):** `PricingSchemeId` (String)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `PricingSchemeId` | String | 20 | Pricing Scheme ID | 定价方案ID |
| `Description` | String | 100 | Description | 描述 |
| `PricingSchemeType` | String | 2 | Scheme Type (SL=Sales, PU=Purchase) | 方案类型（SL=销售，PU=采购） |
| `ValidFrom` | DateTimeOffset | - | Validity Start | 有效起始日期 |
| `ValidTo` | DateTimeOffset | - | Validity End | 有效截止日期 |
| `Status` | String | 1 | Status | 状态 |
| `ExportVersion` | String | 10 | Export Version | 导出版本 |
| `CreatedBy` | String | 12 | Created By | 创建人 |
| `CreatedAt` | DateTimeOffset | - | Created At | 创建时间 |
| `LastChangedBy` | String | 12 | Last Changed By | 最后更改人 |
| `LastChangedAt` | DateTimeOffset | - | Last Changed At | 最后更改时间 |

---

## 2. PricingConditionRecord — 定价条件记录

**实体集合路径:** `PricingConditionRecord`  
**主键 (Key):** `PricingSchemeId` (String), `ConditionRecordId` (String)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `PricingSchemeId` | String | 20 | Pricing Scheme ID | 定价方案ID |
| `ConditionRecordId` | String | 10 | Condition Record ID | 条件记录ID |
| `ConditionType` | String | 4 | Condition Type | 条件类型 |
| `ConditionTable` | String | 3 | Condition Table Number | 条件表编号 |
| `ConditionKey` | String | 50 | Condition Key Fields | 条件关键字段 |
| `ConditionRateValue` | Decimal | - | Condition Rate / Amount | 条件费率/金额 |
| `ConditionCurrency` | String | 5 | Currency for Condition | 条件货币 |
| `ConditionUnit` | String | 3 | Condition Unit | 条件单位 |
| `ConditionScaleBasis` | String | 1 | Scale Basis | 阶梯基准 |
| `NumberOfConditionScales` | Decimal | - | Number of Scales | 阶梯数量 |
| `ValidFrom` | DateTimeOffset | - | Validity Start | 有效起始日期 |
| `ValidTo` | DateTimeOffset | - | Validity End | 有效截止日期 |
| `ConditionCalculationType` | String | 1 | Calculation Type | 计算类型 |

---

## 3. PricingProcedure — 定价过程分配

**实体集合路径:** `PricingProcedure`  
**主键 (Key):** `PricingSchemeId` (String), `ProcedureId` (String)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `PricingSchemeId` | String | 20 | Pricing Scheme ID | 定价方案ID |
| `ProcedureId` | String | 6 | Pricing Procedure ID | 定价过程ID |
| `Description` | String | 100 | Description | 描述 |
| `ConditionTypeSequence` | String | 200 | Sequence of Condition Types | 条件类型序列 |
| `ProcedureSteps` | Int32 | - | Number of Steps | 步骤数 |
| `ValidFrom` | DateTimeOffset | - | Validity Start | 有效起始日期 |
| `ValidTo` | DateTimeOffset | - | Validity End | 有效截止日期 |
| `Usage` | String | 1 | Usage (A=All, S=Sales, P=Purchase) | 用途 |

---

## 4. PricingScale — 定价阶梯

**实体集合路径:** `PricingScale`  
**主键 (Key):** `PricingSchemeId` (String), `ScaleId` (String)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `PricingSchemeId` | String | 20 | Pricing Scheme ID | 定价方案ID |
| `ScaleId` | String | 10 | Scale ID | 阶梯ID |
| `ScaleLevel` | String | 3 | Scale Level | 阶梯级别 |
| `ScaleAmountFrom` | Decimal | - | Scale Amount From | 阶梯金额起始 |
| `ScaleQuantityFrom` | Decimal | - | Scale Quantity From | 阶梯数量起始 |
| `ConditionRateValue` | Decimal | - | Condition Rate at Level | 本级别条件费率 |
| `ConditionRateUnit` | String | 3 | Rate Unit | 费率单位 |
| `ScaleUnit` | String | 3 | Unit of Measure | 计量单位 |

---

## 5. PricingExclusion — 定价条件排除

**实体集合路径:** `PricingExclusion`  
**主键 (Key):** `PricingSchemeId` (String), `ExclusionId` (String)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `PricingSchemeId` | String | 20 | Pricing Scheme ID | 定价方案ID |
| `ExclusionId` | String | 10 | Exclusion ID | 排除ID |
| `ConditionType` | String | 4 | Condition Type to Exclude | 要排除的条件类型 |
| `ExclusionConditionType` | String | 4 | Excluding Condition Type | 排除条件类型 |
| `ExclusionLevel` | String | 1 | Exclusion Level (1=Header, 2=Item) | 排除级别 |
| `ValidFrom` | DateTimeOffset | - | Validity Start | 有效起始日期 |
| `ValidTo` | DateTimeOffset | - | Validity End | 有效截止日期 |

---

## 6. PricingSurcharge — 定价附加费/折扣

**实体集合路径:** `PricingSurcharge`  
**主键 (Key):** `PricingSchemeId` (String), `SurchargeId` (String)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `PricingSchemeId` | String | 20 | Pricing Scheme ID | 定价方案ID |
| `SurchargeId` | String | 10 | Surcharge/Discount ID | 附加费/折扣ID |
| `SurchargeType` | String | 1 | Type (S=Surcharge, D=Discount) | 类型（S=附加费，D=折扣） |
| `ConditionType` | String | 4 | Condition Type | 条件类型 |
| `CalculationType` | String | 1 | Calculation Type | 计算类型 |
| `RateValue` | Decimal | - | Rate or Amount | 费率或金额 |
| `ConditionCurrency` | String | 5 | Currency | 货币 |
| `ValidFrom` | DateTimeOffset | - | Validity Start | 有效起始日期 |
| `ValidTo` | DateTimeOffset | - | Validity End | 有效截止日期 |

---

## CRUD 端点 / CRUD Endpoints

| 实体 | 创建 (POST) | 读取 (GET) | 更新 (PATCH) | 删除 (DELETE) |
|------|------------|-----------|-------------|--------------|
| PricingScheme | `/PricingScheme` | `/PricingScheme` | `/PricingScheme(Id)` | `/PricingScheme(Id)` |
| PricingConditionRecord | `/PricingConditionRecord` | `/PricingConditionRecord` | `/PricingConditionRecord(Id)` | `/PricingConditionRecord(Id)` |
| PricingProcedure | `/PricingProcedure` | `/PricingProcedure` | `/PricingProcedure(Id)` | `/PricingProcedure(Id)` |
| PricingScale | `/PricingScale` | `/PricingScale` | `/PricingScale(Id)` | `/PricingScale(Id)` |
| PricingExclusion | `/PricingExclusion` | `/PricingExclusion` | `/PricingExclusion(Id)` | `/PricingExclusion(Id)` |
| PricingSurcharge | `/PricingSurcharge` | `/PricingSurcharge` | `/PricingSurcharge(Id)` | `/PricingSurcharge(Id)` |

---

## 完整导出示例 / Full Export Example

### 请求: 导出完整定价方案

```
GET /sap/opu/odata/sap/PricingConfigurationMigrationService_APIs/PricingScheme('EXPORT001')?$expand=PricingConditionRecord,PricingProcedure,PricingScale,PricingExclusion,PricingSurcharge
```

### 响应

```json
{
  "PricingSchemeId": "EXPORT001",
  "Description": "Complete China Pricing Scheme",
  "PricingSchemeType": "SL",
  "Status": "A",
  "ExportVersion": "1.0",
  "PricingConditionRecord": [
    {
      "ConditionRecordId": "CR001",
      "ConditionType": "PR00",
      "ConditionRateValue": 100.00,
      "ConditionCurrency": "CNY"
    }
  ],
  "PricingProcedure": [
    {
      "ProcedureId": "STD01",
      "Description": "Standard Sales Procedure"
    }
  ],
  "PricingScale": [
    {
      "ScaleId": "SC001",
      "ScaleLevel": "1",
      "ScaleAmountFrom": 0,
      "ConditionRateValue": 10.00
    }
  ],
  "PricingExclusion": [
    {
      "ExclusionId": "EX001",
      "ConditionType": "PR00",
      "ExclusionConditionType": "K004"
    }
  ],
  "PricingSurcharge": [
    {
      "SurchargeId": "SR001",
      "SurchargeType": "S",
      "ConditionType": "K001",
      "RateValue": 5.00
    }
  ]
}
```

---

## 批量导入示例 / Batch Import Example

```http
POST /sap/opu/odata/sap/PricingConfigurationMigrationService_APIs/$batch
Content-Type: multipart/mixed; boundary=batch_001

--batch_001
Content-Type: application/http
Content-Transfer-Encoding: binary

POST PricingScheme HTTP/1.1
Content-Type: application/json

{
  "PricingSchemeId": "BATCH001",
  "Description": "Batch Imported Scheme",
  "PricingSchemeType": "SL",
  "Status": "A"
}

--batch_001
Content-Type: application/http
Content-Transfer-Encoding: binary

POST PricingConditionRecord HTTP/1.1
Content-Type: application/json

{
  "PricingSchemeId": "BATCH001",
  "ConditionRecordId": "BATCR01",
  "ConditionType": "PR00",
  "ConditionRateValue": 200.00
}

--batch_001--
```

---

## 导航属性关系总表 / Navigation Property Matrix

| 源实体 | 导航属性 | 目标实体 | 基数 |
|--------|----------|----------|------|
| PricingScheme | `to_PricingConditionRecord` | PricingConditionRecord | 0..* |
| PricingScheme | `to_PricingProcedure` | PricingProcedure | 0..* |
| PricingScheme | `to_PricingScale` | PricingScale | 0..* |
| PricingScheme | `to_PricingExclusion` | PricingExclusion | 0..* |
| PricingScheme | `to_PricingSurcharge` | PricingSurcharge | 0..* |

---

## OData 查询选项 / Query Options

| 参数 | 示例 | 说明 |
|------|------|------|
| `$filter` | `$filter=PricingSchemeType eq 'SL'` | 过滤 |
| `$select` | `$select=PricingSchemeId,Description` | 选择字段 |
| `$expand` | `$expand=to_PricingConditionRecord,to_PricingProcedure` | 展开导航属性 |
| `$top` | `$top=100` | 返回前 N 条 |
| `$skip` | `$skip=50` | 跳过前 N 条 |
| `$orderby` | `$orderby=Description asc` | 排序 |

---

## 错误码 / Error Codes

| HTTP 状态码 | 描述 (EN) | 描述 (CN) |
|-------------|-----------|-----------|
| 200 | OK - Successful | 请求成功 |
| 201 | Created | 创建成功 |
| 204 | No Content | 无返回内容 |
| 400 | Bad Request | 请求参数错误 |
| 401 | Unauthorized | 未授权 |
| 403 | Forbidden | 禁止访问 |
| 404 | Not Found | 资源不存在 |
| 409 | Conflict - Duplicate Key | 键值冲突 |
| 412 | Precondition Failed | 前置条件失败 |
| 500 | Internal Server Error | 服务器内部错误 |

---

## 认证 / Authentication

### OAuth 2.0

```
Authorization: Bearer <access_token>
Content-Type: application/json
```

### CSRF Token 处理

```http
GET /sap/opu/odata/sap/PricingConfigurationMigrationService_APIs/PricingScheme
X-CSRF-Token: Fetch
```

响应中获取 `X-CSRF-Token`，在后续写操作中携带该 Token。

---

## 备注 / Notes

- 本 API 是 `PricingConfigurationMigrationService` 的增强版本，支持附加费和条件排除导出 / This API is an enhanced version of `PricingConfigurationMigrationService` with surcharge and exclusion support
- 导出时使用 `$expand` 获取完整导航属性树 / Use `$expand` for complete navigation property tree during export
- 导入支持批量处理（`$batch`）以提高效率 / Batch processing (`$batch`) is supported for efficient import
- 所有导航属性均支持深插入（Deep Insert） / All navigation properties support deep insert
- 导出版本字段可用于跟踪方案兼容性 / Export version field can be used to track scheme compatibility

---