Git Product home page Git Product logo

bucoorderdocumentsapi's Introduction

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) resource BucoOrderDocuments and the privileges read and delete 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:

    {
        "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 type application/pdf in the request header Accept.

    Example output (for JSON representation):

    {
        "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:

    {
        "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.

bucoorderdocumentsapi's People

Contributors

buddhacode avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.