openapi: 3.1.0 info: title: SAP Sales and Distribution (SD) SAP Billing Document Product 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: Product description: Operations on product/material master header (A_Product) paths: /A_Product: get: operationId: listProducts summary: Retrieve a list of products description: Returns a collection of material master records. Use OData query options to filter by material number, material type, material group, and other attributes. Supports $expand for descriptions, plant data, and sales data. tags: - Product parameters: - $ref: '#/components/parameters/top' - $ref: '#/components/parameters/skip' - $ref: '#/components/parameters/filter' - $ref: '#/components/parameters/orderby' - $ref: '#/components/parameters/select' - $ref: '#/components/parameters/expand' - $ref: '#/components/parameters/inlinecount' responses: '200': description: Successfully retrieved products content: application/json: schema: type: object properties: d: type: object properties: results: type: array items: $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '500': $ref: '#/components/responses/InternalServerError' post: operationId: createProduct summary: Create a new product description: Creates a new material master record with support for deep insert including descriptions, plant data, and sales data. tags: - Product requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ProductCreate' responses: '201': description: Product successfully created content: application/json: schema: type: object properties: d: $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '500': $ref: '#/components/responses/InternalServerError' /A_Product('{Product}'): get: operationId: getProduct summary: Retrieve a single product description: Returns a single material master record by its material number. tags: - Product parameters: - name: Product in: path required: true description: Material number (40 characters) schema: type: string maxLength: 40 - $ref: '#/components/parameters/select' - $ref: '#/components/parameters/expand' responses: '200': description: Successfully retrieved the product content: application/json: schema: type: object properties: d: $ref: '#/components/schemas/Product' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' patch: operationId: updateProduct summary: Update a product description: Updates an existing material master record. tags: - Product parameters: - name: Product in: path required: true description: Material number schema: type: string maxLength: 40 - $ref: '#/components/parameters/ifMatch' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ProductUpdate' responses: '204': description: Product successfully updated '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' components: schemas: ProductDescriptionCreate: type: object properties: Language: type: string maxLength: 2 ProductDescription: type: string maxLength: 40 Product: type: object description: Product/material master header entity (A_Product) properties: Product: type: string maxLength: 40 description: Material number ProductType: type: string maxLength: 4 description: Material type ProductGroup: type: string maxLength: 9 description: Material group BaseUnit: type: string maxLength: 3 description: Base unit of measure GrossWeight: type: string description: Gross weight NetWeight: type: string description: Net weight WeightUnit: type: string maxLength: 3 description: Weight unit Volume: type: string description: Volume VolumeUnit: type: string maxLength: 3 description: Volume unit Division: type: string maxLength: 2 description: Division ProductOldID: type: string maxLength: 40 description: Old material number IndustryStandardName: type: string maxLength: 18 description: EAN/UPC code CreationDate: type: string format: date description: Creation date LastChangeDate: type: string format: date description: Date of last change CreatedByUser: type: string maxLength: 12 description: Created by user LastChangedByUser: type: string maxLength: 12 description: Last changed by user IsMarkedForDeletion: type: boolean description: Deletion flag ProductStandardID: type: string maxLength: 18 description: Global Trade Item Number (GTIN) SizeOrDimensionText: type: string maxLength: 32 description: Size/dimensions text Error: type: object properties: error: type: object properties: code: type: string message: type: object properties: lang: type: string value: type: string ProductUpdate: type: object description: Product update payload properties: ProductGroup: type: string maxLength: 9 GrossWeight: type: string NetWeight: type: string WeightUnit: type: string maxLength: 3 IsMarkedForDeletion: type: boolean ProductCreate: type: object description: Product creation payload required: - Product - ProductType properties: Product: type: string maxLength: 40 ProductType: type: string maxLength: 4 ProductGroup: type: string maxLength: 9 BaseUnit: type: string maxLength: 3 GrossWeight: type: string NetWeight: type: string WeightUnit: type: string maxLength: 3 Division: type: string maxLength: 2 to_Description: type: object properties: results: type: array items: $ref: '#/components/schemas/ProductDescriptionCreate' 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 expand: name: $expand 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' Unauthorized: description: Authentication required content: application/json: schema: $ref: '#/components/schemas/Error' BadRequest: description: Bad request 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