Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/buddhaCode/BucoOrderDocumentsApi
Shopware plugin which adds a REST API endpoint to access and delete order documents
https://github.com/buddhaCode/BucoOrderDocumentsApi
document order shopware shopware-api shopware-plugin shopware-plugins
Last synced: 3 months ago
JSON representation
Shopware plugin which adds a REST API endpoint to access and delete order documents
- Host: GitHub
- URL: https://github.com/buddhaCode/BucoOrderDocumentsApi
- Owner: buddhaCode
- License: gpl-3.0
- Archived: true
- Created: 2019-05-21T13:54:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-27T07:02:02.000Z (over 5 years ago)
- Last Synced: 2024-04-18T18:56:17.586Z (7 months ago)
- Topics: document, order, shopware, shopware-api, shopware-plugin, shopware-plugins
- Language: PHP
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-shopware - Orders: Documents API - REST API endpoint to access and delete order documents. (Backend Plugins)
README
# BucoOrderDocumentsApi
Shopware plugin which adds a REST API endpoint to access and delete order documents.## Features
This plugin adds a new REST API endpoint to access and delete the order documents including
their attributes. Creating and modifying order documents it currently not implemented. The access to the endpoint can be restricted with the access
control list (ACL) resourceBucoOrderDocuments
and the privilegesread
anddelete
in the user manager.The REST API can be accessed in the following ways:
-
GET /api/BucoOrderDocuments/
returns a listing. The well known limit, order and query parameters can be applied.
Example output:
```javascript
{
"data": [
{
"id": 11756,
"date": "2017-07-31T00:00:00+0200",
"typeId": 1,
"customerId": 6,
"orderId": 1,
"amount": 1598,
"documentId": "55483",
"hash": "7d2431092sadsa3a8047756edf0fec2da",
"attribute": { // null, if no attributes available
"id": 11668,
"documentId": 11756,
"someExampleAttribute": 42,
}
},
{ ... }
],
"total": 1337,
"success": true
}
```
-GET /api/BucoOrderDocuments/{id}
returns a specific order document with a base64 encoded representation of the PDF document directly within the JSON response. To retrieve the PDF document directly without the meta data, include or set the MIME typeapplication/pdf
in the request headerAccept
.
Example output (for JSON representation):
```javascript
{
"data": {
"id": 11756,
"date": "2017-07-31T00:00:00+0200",
"typeId": 1,
"customerId": 6,
"orderId": 1,
"amount": 1598,
"documentId": "55483",
"hash": "7d2431092sadsa3a8047756edf0fec2da",
"attribute": { // null, if no attributes available
"id": 11668,
"documentId": 11756,
"someExampleAttribute": 42,
},
"pdfDocument": "some random base64 encoded data[...]" // null, if file do not exist
},
"success": true
}
```
-DELETE /api/BucoOrderDocuments/{id}
deletes a specific order document.
Example output:
```javascript
{
"success": true
}
```## Feature Ideas
- Implement POST and PUT methods
- ```POST``` Generate document via Shopware
- ```POST``` Upload externally generated document
- ```PUT``` manipulate meta data like amount and attributes
- ```PUT``` upload PDF file## Compatibility
* Shopware >= 5.2.0
* PHP >= 7.0## Installation
### Git Version
* Checkout plugin in `/custom/plugins/BucoOrderDocumentsApi`
* Install and active plugin with the Plugin Manager### Install with composer
* Change to your root installation of Shopware
* Run command `composer require buddha-code/buco-order-documents-api`
* Install and active plugin with `./bin/console sw:plugin:install --activate BucoOrderDocumentsApi`## Contributing
Feel free to fork and send pull requests!## Licence
This project uses the [GPLv3 License](LICENCE).