Symptom
When creating sales order through API Sales Order A2X, OData V2 (API_SALES_ORDER_SRV), the Address ID sent in the partner entity is ignored and the partner is always created with default address maintained in the master data.
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
Send a POST request to <host>/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder with the following payload
{
"SalesOrderType": "OR",
"SalesOrganization": "0001",
"DistributionChannel": "01",
"OrganizationDivision": "01",
"SoldToParty": "BP_MULT",
"PurchaseOrderByCustomer": "Created via OData API",
"to_Partner": [
{
"PartnerFunction": "SH",
"Customer": "BP_MULT",
"AddressID" : "127"
},
],
"to_Item": [
{
"SalesOrderItem": "10",
"Material": "MAT06",
"RequestedQuantity": "2000",
"RequestedQuantityUnit": "PC",
"to_Partner": [
{
"PartnerFunction": "CP",
"ContactPerson": "26077",
"AddressID" : "365"
}
]
},
{
"SalesOrderItem": "20",
"Material": "MAT06",
"RequestedQuantity": "1000",
"MatlAccountAssignmentGroup": "03",
"DeliveryGroup": "002"
}
]
}
Cause
AddressID is a read-only field and is not used by the API to determine or override the partner address during sales order creation.
Resolution
Use the field BusinessPartnerAddressUUID in the partner entity to select a specific business partner address during creation.
Example request and payload can be found in the API documentation: Create Sales Order for Business Partner with Multiple Addresses | SAP Help Portal
Keywords
sales order API, A_SalesOrder, API_SALES_ORDER_SRV, partner address, AddressID, read-only, BusinessPartnerAddressUUID, multiple address handling, to_Partner, default address, ship-to, bill-to, OData , KBA , SD-SLS-API-2CL , API (Public Cloud) , Problem
SAP Knowledge Base Article - Public