# INVOICEREQUEST_IN

**SOAP v1.2.0 — ACTIVE**

## Title / 标题
**Supplier Invoice - Create (B2B, Inbound, Asynchronous) / 供应商发票 – 创建**

## Operation / 操作
`SupplierInvoiceCreate`

---

## Description / 描述
Create supplier invoices using this asynchronous inbound service.

使用此异步入站服务创建供应商发票。

---

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

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `InvoiceHeader` | Structure | Invoice header data | 发票抬头数据 |
| `?CompanyCode` | `CHAR(4)` | Company code | 公司代码 |
| `?Supplier` | `CHAR(10)` | Supplier account number | 供应商账号 |
| `?InvoiceDate` | `DATE` | Document date in invoice | 发票凭证日期 |
| `?PostingDate` | `DATE` | Posting date | 过账日期 |
| `?Reference` | `CHAR(16)` | Invoice reference number | 发票参考号 |
| `?Amount` | `DECIMAL` | Invoice amount | 发票金额 |
| `?Currency` | `CUKY(5)` | Currency | 货币 |
| `?TaxAmount` | `DECIMAL` | Tax amount | 税额 |
| `?TaxCode` | `CHAR(2)` | Tax code | 税码 |
| `InvoiceItems` | Table | Invoice line items | 发票行项目 |
| `?Material` | `CHAR(18)` | Material number | 物料号 |
| `?Quantity` | `QUAN` | Quantity | 数量 |
| `?Unit` | `UNIT` | Unit of measure | 计量单位 |
| `?NetAmount` | `DECIMAL` | Net amount | 净额 |
| `?PoReference` | `CHAR(10)` | Purchase order reference | 采购订单参考 |

### 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 | 消息文本 |
| `InvoiceDocument` | `CHAR(10)` | Created invoice document number | 已创建的发票凭证号 |

---

## Example Payload / 示例负载

### Request
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SupplierInvoiceCreate>
      <InvoiceHeader>
        <CompanyCode>1000</CompanyCode>
        <Supplier>50000001</Supplier>
        <InvoiceDate>2026-07-23</InvoiceDate>
        <PostingDate>2026-07-23</PostingDate>
        <Reference>INV-2026-0789</Reference>
        <Amount>11500.00</Amount>
        <Currency>CNY</Currency>
        <TaxAmount>1500.00</TaxAmount>
        <TaxCode>V1</TaxCode>
      </InvoiceHeader>
      <InvoiceItems>
        <item>
          <Material>MAT-20001</Material>
          <Quantity>10.000</Quantity>
          <Unit>EA</Unit>
          <NetAmount>10000.00</NetAmount>
          <PoReference>4500012345</PoReference>
        </item>
      </InvoiceItems>
    </SupplierInvoiceCreate>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SupplierInvoiceCreateResponse>
      <Return>
        <Type>S</Type>
        <Message>Invoice created successfully / 发票创建成功</Message>
      </Return>
      <InvoiceDocument>5100000123</InvoiceDocument>
    </SupplierInvoiceCreateResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `INV_001` | Supplier not found | 未找到供应商 |
| `INV_002` | Invalid purchase order | 无效的采购订单 |
| `INV_003` | Invoice amount exceeds PO amount | 发票金额超过采购订单金额 |
| `INV_004` | Duplicate invoice reference | 重复的发票参考号 |
| `INV_005` | Tax code not configured | 未配置税码 |
| `INV_006` | Material not found or blocked | 未找到物料或物料被冻结 |

---

## Notes / 备注
- This is an asynchronous service; the invoice document number is returned upon submission / 这是异步服务；提交时返回发票凭证号
- The supplier invoice reference must be unique per company code / 供应商发票参考号在每个公司代码下必须唯一
- Invoice amount must equal sum of item net amounts plus tax / 发票金额必须等于项目净额加税额之和
