Create Customers

If you look at the API docs for SAP S/4 HANA Cloud, you'll notice that the /customers resource does not include a POST method. This is because you create customers using POST /business-partners. Follow the steps below to create a customer.

  1. Call the POST /business-partners endpoint with this body (replacing values with your own):
    {
      "BusinessPartnerCategory": "1",
      "BusinessPartnerGrouping": "0001",
      "FirstName": "WeMake",
      "LastName": "Integrations",
      "BusinessPartnerFullName": "WeMake Integrations",
      "CorrespondenceLanguage": "EN",
      "IsMale" : true,
      "to_BusinessPartnerAddress": [
        {
          "Country": "DE",
          "StreetName": "Dietmar-Hopp-Allee 16",
          "PostalCode": "69190",
          "CityName": "Walldorf",
          "to_AddressUsage": [
            {
              "AddressUsage": "XXDEFAULT"
            }
          ]
        }
      ],
      "to_BusinessPartnerTax": [
        {
          "BPTaxType": "DE0",
          "BPTaxNumber": "DE012345678"
        }
      ],
      "to_BusinessPartnerRole": {
        "results": [
          {
            "BusinessPartnerRole": "FLCU01"
          }
        ]
      }
    }
    
  2. In the response, find BusinessPartner, and copy the value (the Business Partner id).
  3. Call the GET/business-partners/{id}?expand=to_Customer endpoint, using the BusinessPartner value from the previous step as the id.
  4. In the response, find Customer (nested in to_Customer), and copy the value (the Customer id).
  5. Call the GET/customer/{id} endpoint, using the Customer value from the previous step as the id.
  6. Use PATCH/customers/{id} to add details to the customer.

Related Links