REST API

You can also find a fully comprehensive and up-to-date Swagger documentation here.

API Structure

In order to maintain your custom pricing lists, the Pricing Engine offers a range of RESTful endpoints. In the following examples is http://10.222.222.30/api our local endpoint for the shopware api. You can find examples written with guzzle in the official git repo. If you don't have access yet, please create a ticket via your shopware account. You will receive an invitation soon.

Price lists

/api/PriceList

  • GET Get all available price lists

    • limit, offset
GET http://10.222.222.30/api/PriceList
Authorization: Digest demo demo
Content-Type: application/json

{
    "filters": [
        {
            "field-name": "id",
            "value": 6,
            "type": "eq"
        }
    ]
}
  • POST Create a price list

    • priceList
POST http://10.222.222.30/api/PriceList
Authorization: Digest demo demo
Content-Type: application/json

{
    "name": "Create new PriceList",
    "priority": 0
}
  • UPDATE Update a price list
PUT http://10.222.222.30/api/PriceList/11
Authorization: Digest demo demo
Content-Type: application/json

{
    "id": 11,
    "name": "Update PriceList",
    "priority": 0
}
  • DELETE Delete a price list
DELETE http://10.222.222.30/api/PriceList/11
Authorization: Digest demo demo
Content-Type: application/json

Single price list

/api/PriceList/{id}

  • GET Get one price list

    • id
GET http://10.222.222.30/api/PriceList/11
Authorization: Digest demo demo
Content-Type: application/json
  • PUT Update one price list

    • id, priceList
PUT http://10.222.222.30/api/PriceList/11
Authorization: Digest demo demo
Content-Type: application/json

{
    "name": "Update PriceList",
    "priority": 0
}
  • DELETE Delete one price list

    • id
DELETE http://10.222.222.30/api/PriceList/11
Authorization: Digest demo demo
Content-Type: application/json

Conditions

/api/PriceListCondition

  • GET Returns all configurable conditions
GET http://10.222.222.30/api/PriceListCondition
Authorization: Digest demo demo
Content-Type: application/json
  • POST Create one price list condition

    • priceListCondition
POST http://10.222.222.30/api/PriceListCondition
Authorization: Digest demo demo
Content-Type: application/json

{
    "priceListId": 1,
    "type": "SwagEnterprisePricingEngine\\Source\\PriceListCondition\\Conditions\\CurrencyCondition",
    "value": "EUR"

}
  • UPDATE Create one price list condition

    • priceListCondition
PUT http://10.222.222.30/api/PriceListCondition/16
Authorization: Digest demo demo
Content-Type: application/json

{
    "priceListId": 1,
    "type": "SwagEnterprisePricingEngine\\Source\\PriceListCondition\\Conditions\\CurrencyCondition",
    "value": "EUR"

}
  • DELETE Delete

Single condition

/api/PriceListCondition/{id}

  • GET Get one price list condition

    • id
GET http://10.222.222.30/api/PriceListCondition/1337
Authorization: Digest demo demo
Content-Type: application/json

Prices in all lists

/api/PriceListPrices

  • GET Get all available price list prices

    • limit, offset
GET http://10.222.222.30/api/PriceListPrices?limit=10
Authorization: Digest demo demo
Content-Type: application/json

{
    "filters": [
        {
            "field-name": "id",
            "value": 6,
            "type": "eq"
        }
    ]
}
  • POST Create one or more price list prices

    • priceListPrices
POST http://10.222.222.30/api/PriceListPrices
Authorization: Digest demo demo
Content-Type: application/json

{
    "prices": [
        {
            "priceListId": 1,
            "orderNumber": "SW10010",
            "price": 3.78151260504201,
            "pseudoPrice": 5.8823529411764595,
            "from": 1,
            "to": 1,
            "validFrom": null,
            "validTo": null,
            "calculation": null,
            "gross": false
        }
    ]
}
  • PUT Update one or more price list prices

    • priceListPrices
PUT http://10.222.222.30/api/PriceListPrices
Authorization: Digest demo demo
Content-Type: application/json

{
    "prices": [
        {
            "id": 1867,
            "priceListId": 1,
            "orderNumber": "SW10010",
            "price": 3.78151260504201,
            "pseudoPrice": 5.8823529411764595,
            "from": 1,
            "to": 1,
            "validFrom": null,
            "validTo": null,
            "calculation": null,
            "gross": true
        }
    ]
}
  • DELETE Remove an amount of price list prices

    • priceListPrices
DELETE http://10.222.222.30/api/PriceListPrices
Authorization: Digest demo demo
Content-Type: application/json

{
    "prices": [
        {
            "id": 1867
        }
    ]
}

Prices in a single list

/api/PriceListPrices/{id}

  • GET get one price list prices

    • id
GET http://10.222.222.30/api/PriceListPrices/1867
Authorization: Digest demo demo
Content-Type: application/json