SAP Sales and Distribution (SD) Customer Material API

Operations on customer material info records (A_CustomerMaterial)

Documentation

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-sales-and-distribution-sd/refs/heads/main/json-schema/sap-sd-sales-order-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-sales-and-distribution-sd/refs/heads/main/json-schema/sap-sd-sales-order-item-schema.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-sales-and-distribution-sd/refs/heads/main/json-structure/sap-sd-sales-order-structure.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-sales-and-distribution-sd/refs/heads/main/json-schema/sap-sd-business-partner-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-sales-and-distribution-sd/refs/heads/main/json-schema/sap-sd-outbound-delivery-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-sales-and-distribution-sd/refs/heads/main/json-schema/sap-sd-billing-document-schema.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-sales-and-distribution-sd/refs/heads/main/json-structure/sap-sd-billing-document-structure.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-sales-and-distribution-sd/refs/heads/main/json-schema/sap-sd-pricing-condition-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-sales-and-distribution-sd/refs/heads/main/json-schema/sap-sd-product-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-sales-and-distribution-sd/refs/heads/main/json-schema/sap-sd-customer-return-schema.json

Other Resources

OpenAPI Specification

sap-sales-and-distribution-sd-customer-material-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: SAP Sales and Distribution (SD) SAP Billing Document Customer Material API
  description: Read, cancel, and retrieve billing documents in PDF format from SAP S/4HANA. This OData service (API_BILLING_DOCUMENT_SRV) provides access to billing document headers, items, partners, and pricing elements. Supports invoices, credit memos, debit memos, and other billing document types as part of the order-to-cash cycle.
  version: 1.0.0
  contact:
    name: SAP Support
    url: https://support.sap.com
  license:
    name: SAP Developer License
    url: https://www.sap.com/about/agreements/product-use-and-support-terms.html
servers:
- url: https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BILLING_DOCUMENT_SRV
  description: SAP S/4HANA Cloud Sandbox
- url: https://{host}:{port}/sap/opu/odata/sap/API_BILLING_DOCUMENT_SRV
  description: SAP S/4HANA On-Premise
  variables:
    host:
      default: localhost
    port:
      default: '443'
security:
- basicAuth: []
- oauth2: []
tags:
- name: Customer Material
  description: Operations on customer material info records (A_CustomerMaterial)
paths:
  /A_CustomerMaterial:
    get:
      operationId: listCustomerMaterials
      summary: Retrieve a list of customer material records
      description: Returns a collection of customer-material information records. Supports filtering by customer number, material, sales organization, and distribution channel.
      tags:
      - Customer Material
      parameters:
      - $ref: '#/components/parameters/top'
      - $ref: '#/components/parameters/skip'
      - $ref: '#/components/parameters/filter'
      - $ref: '#/components/parameters/orderby'
      - $ref: '#/components/parameters/select'
      - $ref: '#/components/parameters/inlinecount'
      responses:
        '200':
          description: Successfully retrieved customer material records
          content:
            application/json:
              schema:
                type: object
                properties:
                  d:
                    type: object
                    properties:
                      results:
                        type: array
                        items:
                          $ref: '#/components/schemas/CustomerMaterial'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      operationId: createCustomerMaterial
      summary: Create a customer material record
      description: Creates a new customer-material information record linking a customer part number to an internal SAP material number.
      tags:
      - Customer Material
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerMaterialCreate'
      responses:
        '201':
          description: Customer material record successfully created
          content:
            application/json:
              schema:
                type: object
                properties:
                  d:
                    $ref: '#/components/schemas/CustomerMaterial'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
  ? /A_CustomerMaterial(SalesOrganization='{SalesOrganization}',DistributionChannel='{DistributionChannel}',Customer='{Customer}',Material='{Material}')
  : get:
      operationId: getCustomerMaterial
      summary: Retrieve a single customer material record
      description: Returns a single customer-material information record by its composite key.
      tags:
      - Customer Material
      parameters:
      - name: SalesOrganization
        in: path
        required: true
        description: Sales organization
        schema:
          type: string
          maxLength: 4
      - name: DistributionChannel
        in: path
        required: true
        description: Distribution channel
        schema:
          type: string
          maxLength: 2
      - name: Customer
        in: path
        required: true
        description: Customer number
        schema:
          type: string
          maxLength: 10
      - name: Material
        in: path
        required: true
        description: Material number
        schema:
          type: string
          maxLength: 40
      - $ref: '#/components/parameters/select'
      responses:
        '200':
          description: Successfully retrieved the customer material record
          content:
            application/json:
              schema:
                type: object
                properties:
                  d:
                    $ref: '#/components/schemas/CustomerMaterial'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    patch:
      operationId: updateCustomerMaterial
      summary: Update a customer material record
      description: Updates an existing customer-material information record.
      tags:
      - Customer Material
      parameters:
      - name: SalesOrganization
        in: path
        required: true
        schema:
          type: string
          maxLength: 4
      - name: DistributionChannel
        in: path
        required: true
        schema:
          type: string
          maxLength: 2
      - name: Customer
        in: path
        required: true
        schema:
          type: string
          maxLength: 10
      - name: Material
        in: path
        required: true
        schema:
          type: string
          maxLength: 40
      - $ref: '#/components/parameters/ifMatch'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerMaterialUpdate'
      responses:
        '204':
          description: Customer material record successfully updated
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      operationId: deleteCustomerMaterial
      summary: Delete a customer material record
      description: Deletes an existing customer-material information record.
      tags:
      - Customer Material
      parameters:
      - name: SalesOrganization
        in: path
        required: true
        schema:
          type: string
          maxLength: 4
      - name: DistributionChannel
        in: path
        required: true
        schema:
          type: string
          maxLength: 2
      - name: Customer
        in: path
        required: true
        schema:
          type: string
          maxLength: 10
      - name: Material
        in: path
        required: true
        schema:
          type: string
          maxLength: 40
      - $ref: '#/components/parameters/ifMatch'
      responses:
        '204':
          description: Customer material record successfully deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CustomerMaterial:
      type: object
      description: Customer material info record entity (A_CustomerMaterial)
      properties:
        SalesOrganization:
          type: string
          maxLength: 4
          description: Sales organization
        DistributionChannel:
          type: string
          maxLength: 2
          description: Distribution channel
        Customer:
          type: string
          maxLength: 10
          description: Customer number
        Material:
          type: string
          maxLength: 40
          description: Material number (internal)
        MaterialByCustomer:
          type: string
          maxLength: 35
          description: Customer material number
        MaterialDescriptionByCustomer:
          type: string
          maxLength: 40
          description: Customer description of the material
        Plant:
          type: string
          maxLength: 4
          description: Plant
        DeliveryPriority:
          type: string
          maxLength: 2
          description: Delivery priority
        MinDeliveryQtyInBaseUnit:
          type: string
          description: Minimum delivery quantity
        BaseUnit:
          type: string
          maxLength: 3
          description: Base unit of measure
        PartialDeliveryIsAllowed:
          type: string
          maxLength: 1
          description: Partial delivery allowed flag
    CustomerMaterialCreate:
      type: object
      required:
      - SalesOrganization
      - DistributionChannel
      - Customer
      - Material
      properties:
        SalesOrganization:
          type: string
          maxLength: 4
        DistributionChannel:
          type: string
          maxLength: 2
        Customer:
          type: string
          maxLength: 10
        Material:
          type: string
          maxLength: 40
        MaterialByCustomer:
          type: string
          maxLength: 35
        MaterialDescriptionByCustomer:
          type: string
          maxLength: 40
        Plant:
          type: string
          maxLength: 4
    CustomerMaterialUpdate:
      type: object
      properties:
        MaterialByCustomer:
          type: string
          maxLength: 35
        MaterialDescriptionByCustomer:
          type: string
          maxLength: 40
        DeliveryPriority:
          type: string
          maxLength: 2
        Plant:
          type: string
          maxLength: 4
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: object
              properties:
                lang:
                  type: string
                value:
                  type: string
  parameters:
    skip:
      name: $skip
      in: query
      schema:
        type: integer
        minimum: 0
    select:
      name: $select
      in: query
      schema:
        type: string
    orderby:
      name: $orderby
      in: query
      schema:
        type: string
    ifMatch:
      name: If-Match
      in: header
      required: true
      schema:
        type: string
    filter:
      name: $filter
      in: query
      schema:
        type: string
    top:
      name: $top
      in: query
      schema:
        type: integer
        minimum: 0
    inlinecount:
      name: $inlinecount
      in: query
      schema:
        type: string
        enum:
        - allpages
        - none
  responses:
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://{tenant}.authentication.{landscape}.hana.ondemand.com/oauth/token
          scopes:
            API_BILLING_DOCUMENT_SRV: Access to Billing Document API