{"id":38987578,"url":"https://github.com/xaypanya/b1-api-cookbook","last_synced_at":"2026-01-17T17:00:45.078Z","repository":{"id":295282380,"uuid":"989689824","full_name":"Xaypanya/b1-api-cookbook","owner":"Xaypanya","description":"comprehensive resource for developers working with the SAP Business One (SAP B1) Service Layer APIs","archived":false,"fork":false,"pushed_at":"2025-05-24T17:03:16.000Z","size":2831,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-24T17:29:21.500Z","etag":null,"topics":["api","developertools","odatav4","postman-api","restapi","sapb1","sapbusinessone","servicelayer"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xaypanya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-24T16:12:33.000Z","updated_at":"2025-05-24T17:03:20.000Z","dependencies_parsed_at":"2025-05-24T17:40:35.478Z","dependency_job_id":null,"html_url":"https://github.com/Xaypanya/b1-api-cookbook","commit_stats":null,"previous_names":["xaypanya/b1-api-cookbook"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Xaypanya/b1-api-cookbook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xaypanya%2Fb1-api-cookbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xaypanya%2Fb1-api-cookbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xaypanya%2Fb1-api-cookbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xaypanya%2Fb1-api-cookbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xaypanya","download_url":"https://codeload.github.com/Xaypanya/b1-api-cookbook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xaypanya%2Fb1-api-cookbook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","developertools","odatav4","postman-api","restapi","sapb1","sapbusinessone","servicelayer"],"created_at":"2026-01-17T17:00:23.475Z","updated_at":"2026-01-17T17:00:45.015Z","avatar_url":"https://github.com/Xaypanya.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/Xaypanya/b1-api-cookbook/blob/main/b1-api-cookbook.png\" alt=\"b1-api-cookbook logo\" width=\"300\"\u003e\n\n# B1 API Cookbook\n## Overview\n\nThe `b1-api-cookbook` repository is a comprehensive resource for developers working with the **SAP Business One (SAP B1) Service Layer APIs**. It provides detailed information about service endpoints, metadata schemas, and practical examples to assist both beginners and experienced developers in integrating with SAP B1 services. This repository includes:\n\n- **Service Descriptions**: JSON files defining the endpoints and operations for each service.\n- **Metadata Schemas**: OData V4 schemas (in EDMX format) describing the data models used by the APIs.\n- **Guides for Beginners**: Step-by-step instructions to set up and use the APIs.\n- **Code Examples**: Practical examples of API calls for various services.\n\nThe goal of this repository is to simplify interaction with the SAP B1 Service Layer by providing clear documentation and reusable examples.\n\n## Repository Structure\n\n- **/services**: Contains JSON files for each service, detailing endpoints, operations, and examples (e.g., `AccountCategoryService.json`).\n- **/schemas**: Includes OData V4 EDMX files defining the metadata for each service.\n- **/examples**: Provides sample code and API call examples for different services and operations.\n- **/guides**: Beginner-friendly tutorials and setup instructions for working with the SAP B1 Service Layer.\n\n## Getting Started\n\n### Prerequisites\nTo use the SAP B1 Service Layer APIs, ensure you have:\n- Access to an SAP B1 instance with the Service Layer enabled.\n- A valid user account with appropriate permissions.\n- A development environment with tools like Postman, cURL, or a programming language (e.g., Python, JavaScript) for making HTTP requests.\n- Basic understanding of REST APIs and OData V4.\n\n### Setup Instructions\n1. **Access the Service Layer**:\n   - The SAP B1 Service Layer is typically hosted at a URL like `https://\u003cyour-server\u003e:50000/b1s/v2/`.\n   - Log in to the Service Layer using a POST request to the `/Login` endpoint with your credentials:\n     ```json\n     POST https://\u003cyour-server\u003e:50000/b1s/v2/Login\n     {\n       \"UserName\": \"your-username\",\n       \"Password\": \"your-password\",\n       \"CompanyDB\": \"your-company-database\"\n     }\n     ```\n     Save the `SessionId` from the response for subsequent requests.\n\n2. **Explore Available Services**:\n   - The Service Layer exposes various services like `AccountCategoryService`, `BusinessPartners`, and more.\n   - Refer to the JSON files in the `/services` folder for details on each service and its operations.\n\n3. **Use Metadata Schemas**:\n   - The `/schemas` folder contains EDMX files that describe the data models for each service.\n   - Use these schemas to understand the structure of entities and enumerations used in API responses.\n\n4. **Test API Calls**:\n   - Use tools like Postman or cURL to test API endpoints.\n   - Example requests are provided in the `/examples` folder and within the JSON files in `/services`.\n\n## Services and Endpoints\n\nThe `/services` folder contains JSON files that describe the available services and their operations. Below is an example of the `AccountCategoryService` based on its JSON definition:\n\n### AccountCategoryService\n**Description**: This API enables you to invoke the interfaces defined on `AccountCategoryService`, which manages account categories in SAP B1.\n\n**Operations**:\n- **Get Category List**:\n  - **Method**: GET\n  - **Path**: `AccountCategoryService_GetCategoryList`\n  - **Description**: Retrieves a list of account categories.\n  - **Example**:\n    ```\n    GET https://\u003cyour-server\u003e:50000/b1s/v2/AccountCategoryService_GetCategoryList\n    ```\n  - **Method**: POST\n  - **Path**: `AccountCategoryService_GetCategoryList`\n  - **Description**: Invokes the `GetCategoryList` method to retrieve account categories.\n  - **Example**:\n    ```\n    POST https://\u003cyour-server\u003e:50000/b1s/v2/AccountCategoryService_GetCategoryList\n    ```\n\nFor a complete list of services and their operations, refer to the JSON files in the `/services` folder.\n\n## Metadata Schemas\n\nThe Service Layer uses OData V4 to define its data models. The `/schemas` folder contains EDMX files that describe the structure of entities and enumerations. Below is an example schema snippet for the `AccountCategoryService`:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cedmx:Edmx Version=\"4.0\" xmlns:edmx=\"http://docs.oasis-open.org/odata/ns/edmx\"\u003e\n    \u003cedmx:DataServices\u003e\n        \u003cSchema Namespace=\"SAPB1\" xmlns=\"http://docs.oasis-open.org/odata/ns/edm\"\u003e\n            \u003cEnumType IsFlags=\"false\" Name=\"AccountCategorySourceEnum\" UnderlyingType=\"Edm.Int32\"\u003e\n                \u003cMember Name=\"acsBalanceSheet\" Value=\"0\"/\u003e\n                \u003cMember Name=\"acsProfitAndLoss\" Value=\"1\"/\u003e\n                \u003cMember Name=\"acsTrialBalance\" Value=\"2\"/\u003e\n            \u003c/EnumType\u003e\n            \u003cEnumType IsFlags=\"false\" Name=\"AccountSegmentationTypeEnum\" UnderlyingType=\"Edm.Int32\"\u003e\n                \u003cMember Name=\"ast_Alphanumeric\" Value=\"0\"/\u003e\n                \u003cMember Name=\"ast_Numeric\" Value=\"1\"/\u003e\n            \u003c/EnumType\u003e\n            \u003cEnumType IsFlags=\"false\" Name=\"AcquisitionPeriodControlEnum\" UnderlyingType=\"Edm.Int32\"\u003e\n                \u003cMember Name=\"apcProRataTemporis\" Value=\"0\"/\u003e\n                \u003cMember Name=\"apcFirstYearConvention\" Value=\"1\"/\u003e\n                \u003cMember Name=\"apcHalfYear\" Value=\"2\"/\u003e\n                \u003cMember Name=\"apcFullYear\" Value=\"3\"/\u003e\n            \u003c/EnumType\u003e\n            \u003cEnumType IsFlags=\"false\" Name=\"AcquisitionProRataTypeEnum\" UnderlyingType=\"Edm.Int32\"\u003e\n                \u003cMember Name=\"aprtExactlyDailyBase\" Value=\"0\"/\u003e\n                \u003cMember Name=\"aprtFirstDayOfCurrentPeriod\" Value=\"1\"/\u003e\n                \u003cMember Name=\"aprtFirstDayOfNextPeriod\" Value=\"2\"/\u003e\n            \u003c/EnumType\u003e\n            \u003cEnumType IsFlags=\"false\" Name=\"ActivityRecipientObjTypeEnum\" UnderlyingType=\"Edm.Int32\"\u003e\n                \u003cMember Name=\"arotUser\" Value=\"0\"/\u003e\n                \u003cMember Name=\"arotEmployee\" Value=\"1\"/\u003e\n                \u003cMember Name=\"arotRecipientList\" Value=\"2\"/\u003e\n            \u003c/EnumType\u003e\n        \u003c/Schema\u003e\n    \u003c/edmx:DataServices\u003e\n\u003c/edmx:Edmx\u003e\n```\n\nThis schema defines enumerations used by the `AccountCategoryService`, such as `AccountCategorySourceEnum` and `AcquisitionPeriodControlEnum`. Refer to the `/schemas` folder for additional schemas.\n\n## Examples\n\nThe `/examples` folder contains sample API calls for various services. Below is an example for invoking the `AccountCategoryService_GetCategoryList` endpoint:\n\n```bash\ncurl -X GET \"https://\u003cyour-server\u003e:50000/b1s/v2/AccountCategoryService_GetCategoryList\" \\\n-H \"Cookie: B1SESSION=\u003cyour-session-id\u003e\" \\\n-H \"Content-Type: application/json\"\n```\n\nAdditional examples, including POST requests and payloads, can be found in the `/examples` folder and within the JSON files in `/services`.\n\n## Guides for Beginners\n\nThe `/guides` folder contains tutorials to help new developers get started with the SAP B1 Service Layer. Key topics include:\n- **Setting Up Authentication**: How to log in and manage sessions.\n- **Making Your First API Call**: A step-by-step guide to querying the Service Layer.\n- **Understanding OData V4**: An introduction to OData concepts and how they apply to SAP B1.\n- **Troubleshooting Common Issues**: Tips for resolving errors like invalid sessions or incorrect payloads.\n\n## Contributing\n\nContributions to the `b1-api-cookbook` are welcome! To contribute:\n1. Fork the repository.\n2. Create a new branch for your changes.\n3. Add or update JSON files, schemas, or examples.\n4. Submit a pull request with a clear description of your changes.\n\nPlease ensure that any new JSON files or schemas are accurate and follow the OData V4 standard.\n\n## License\n\nThis repository is licensed under the [MIT License](LICENSE). Feel free to use, modify, and distribute the content as needed.\n\n## Contact\n\nFor questions or feedback, please open an issue in the repository or contact the maintainers.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxaypanya%2Fb1-api-cookbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxaypanya%2Fb1-api-cookbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxaypanya%2Fb1-api-cookbook/lists"}