Home

Série 1

Páginas filhas
  • PriceTable

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Leitura de registro (GET):

localhost/first/api/v1/pricetable/

Retorno:

{

  "total": 2,

  "hasNext": false,

  "syncing": false,

  "lines": [

    {

      "pk": "004",

      "id": "004",

      "description": "TERESINA NORMAL",

      "initialValidDate": "20121113",

      "initialValidTime": "00:00",

      "finalValidDate": "20491231",

      "finalValidTime": "23:59",

      "paymentCondition": "",

      "active": "1",

      "items": {

        "url": "/first/api/v1/pricetableitem?tableId=004"

      }

    },

    {

      "pk": "005",

      "id": "005",

      "description": "TERESINA A VISTA",

      "initialValidDate": "20121118",

      "initialValidTime": "00:00",

      "finalValidDate": "20491231",

      "finalValidTime": "23:59",

      "paymentCondition": "",

      "active": "2",

      "items": {

        "url": "/first/api/v1/pricetableitem?tableId=005"

      }

    }

]

Inclusão de registro (POST):

localhost/first/api/v1/pricetable

Body:

    {

      "id": "880",

      "description": "nova tabela",

      "initialValidDate": "20121113",

      "initialValidTime": "00:00",

      "finalValidDate": "20491231",

      "finalValidTime": "23:59",

      "paymentCondition": "",

      "active": "1",

      "items": {

        "productId":"00001",

        "basePrice":99,

        "salePrice":99,

        active:"1"

      }

    }

Retorno:

{

  "url": "/first/api/v1/pricetable/880",

  "id": "880"

}

...

No exemplo abaixo estamos deletando o atual item da tabela e colocando outro no lugar.

localhost/first/api/v1/pricetable/880

Body:

    {

      "description": "nova tabela alterada",

      "items": [

          {

            "item": "0001",

            delete: true

          },

          {

            "productId":"00002",

            "basePrice":10,

            "salePrice": 44,

            active: "1",

            add:true

          }

      ]

}

Retorno:

{

  "url": "/first/api/v1/pricetable/880",

  "id": "880"

}

Exclusão de registro (DELETE):

http://localhost/first/api/v1/pricetable/880

 

Retorno:

{

  "url": "/first/api/v1/pricetable/880",

  "id": "880"

}

...

Para filtrar por Tabela de preço podemos utilizar query string:

localhost/first/api/v1/pricetableitem?tableId=012

...