Price Tables

Explore the limitless potential of Price Tables, designed to bring unparalleled flexibility to your pricing strategies. Price Tables functionality adapts to your needs seamlessly, allowing you to craft tailored pricing structures effortlessly and swap prices on the fly.

The Price Table object

Required attributes

  • Name
    _id
    Type
    string
    Description

    The ID of the price table

  • Name
    sellerId
    Type
    string
    Description

    The ID of the seller of the price table

  • Name
    name
    Type
    string
    Description

    The name of the price table. Is used for identification

Optional attributes

  • Name
    categories
    Type
    array<object>
    Description

    An array of price categories

    Required nested attributes (1)
    • Name
      name
      Type
      string
      Description

      The name of the price category. Is used for identification

    Optional nested attributes (1)
    • Name
      _id
      Type
      string
      Description

      The ID of the price category

  • Name
    types
    Type
    array<object>
    Description

    An array of price types

    Required nested attributes (3)
    • Name
      name
      Type
      string
      Description

      The name of the price type. Is used for identification

    • Name
      categoryId
      Type
      string
      Description

      The ID of the price category

    • Name
      price
      Type
      number
      Description

      The default price for the type, can be overridden per price tier

    Optional nested attributes (1)
    • Name
      _id
      Type
      string
      Description

      The ID of the price type

  • Name
    tiers
    Type
    array<object>
    Description

    An array of price tiers

    Required nested attributes (1)
    • Name
      name
      Type
      string
      Description

      The name of the price tier. Is used for identification

    Optional nested attributes (2)
    • Name
      _id
      Type
      string
      Description
    • Name
      prices
      Type
      array<object>
      Description
      Required nested attributes (2)
      • Name
        priceTypeId
        Type
        string
        Description

        The ID of the price type

      • Name
        price
        Type
        number
        Description

        The price for the associated price type

Example

{
  "_id": "507f191e810c19729de860ea",
  "sellerId": "507f191e810c19729de860ea",
  "name": "Example Name",
  "categories": [
    {
      "name": "Example Name",
      "_id": "507f191e810c19729de860ea"
    }
  ],
  "types": [
    {
      "name": "Example Name",
      "categoryId": "507f191e810c19729de860ea",
      "price": 10.5,
      "_id": "507f191e810c19729de860ea"
    }
  ],
  "tiers": [
    {
      "name": "Example Name",
      "_id": "507f191e810c19729de860ea",
      "prices": [
        {
          "priceTypeId": "507f191e810c19729de860ea",
          "price": 10.5
        }
      ]
    }
  ]
}

POST/api/price-tables

Create a Price Table

Create a Price Table

Payload

Required attributes

  • Name
    name
    Type
    string
    Description

    The name of the price table. Is used for identification

Optional attributes

  • Name
    categories
    Type
    array<object>
    Description

    An array of price categories

    Required nested attributes (1)
    • Name
      name
      Type
      string
      Description

      The name of the price category. Is used for identification

    Optional nested attributes (1)
    • Name
      _id
      Type
      string
      Description

      The ID of the price category

  • Name
    types
    Type
    array<object>
    Description

    An array of price types

    Required nested attributes (3)
    • Name
      name
      Type
      string
      Description

      The name of the price type. Is used for identification

    • Name
      categoryId
      Type
      string
      Description

      The ID of the price category

    • Name
      price
      Type
      number
      Description

      The default price for the type, can be overridden per price tier

    Optional nested attributes (1)
    • Name
      _id
      Type
      string
      Description

      The ID of the price type

  • Name
    tiers
    Type
    array<object>
    Description

    An array of price tiers

    Required nested attributes (1)
    • Name
      name
      Type
      string
      Description

      The name of the price tier. Is used for identification

    Optional nested attributes (2)
    • Name
      _id
      Type
      string
      Description
    • Name
      prices
      Type
      array<object>
      Description
      Required nested attributes (2)
      • Name
        priceTypeId
        Type
        string
        Description

        The ID of the price type

      • Name
        price
        Type
        number
        Description

        The price for the associated price type

Request

POST
/api/price-tables
const response = await fetch('https://vivenu.com/api/price-tables', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer {token}',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(  {
    "name": "Example Name",
    "categories": [
      {
        "name": "Example Name",
        "_id": "507f191e810c19729de860ea"
      }
    ],
    "types": [
      {
        "name": "Example Name",
        "categoryId": "507f191e810c19729de860ea",
        "price": 10.5,
        "_id": "507f191e810c19729de860ea"
      }
    ],
    "tiers": [
      {
        "name": "Example Name",
        "_id": "507f191e810c19729de860ea",
        "prices": [
          {
            "priceTypeId": "507f191e810c19729de860ea",
            "price": 10.5
          }
        ]
      }
    ]
  }),
})

const data = await response.json()

Response (201)

{
  "_id": "507f191e810c19729de860ea",
  "sellerId": "507f191e810c19729de860ea",
  "name": "Example Name",
  "categories": [
    {
      "name": "Example Name",
      "_id": "507f191e810c19729de860ea"
    }
  ],
  "types": [
    {
      "name": "Example Name",
      "categoryId": "507f191e810c19729de860ea",
      "price": 10.5,
      "_id": "507f191e810c19729de860ea"
    }
  ],
  "tiers": [
    {
      "name": "Example Name",
      "_id": "507f191e810c19729de860ea",
      "prices": [
        {
          "priceTypeId": "507f191e810c19729de860ea",
          "price": 10.5
        }
      ]
    }
  ]
}

GET/api/price-tables/:id

Get a Price Table

Get a Price Table

Request

GET
/api/price-tables/:id
const response = await fetch('https://vivenu.com/api/price-tables/507f191e810c19729de860ea', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer {token}',
  },
})

const data = await response.json()

Response (200)

{
  "_id": "507f191e810c19729de860ea",
  "sellerId": "507f191e810c19729de860ea",
  "name": "Example Name",
  "categories": [
    {
      "name": "Example Name",
      "_id": "507f191e810c19729de860ea"
    }
  ],
  "types": [
    {
      "name": "Example Name",
      "categoryId": "507f191e810c19729de860ea",
      "price": 10.5,
      "_id": "507f191e810c19729de860ea"
    }
  ],
  "tiers": [
    {
      "name": "Example Name",
      "_id": "507f191e810c19729de860ea",
      "prices": [
        {
          "priceTypeId": "507f191e810c19729de860ea",
          "price": 10.5
        }
      ]
    }
  ]
}

PUT/api/price-tables/:id

Update a Price Table

Update a Price Table

Payload

Optional attributes

  • Name
    name
    Type
    string
    Description

    The name of the price table. Is used for identification

  • Name
    categories
    Type
    array<object>
    Description

    An array of price categories

    Required nested attributes (1)
    • Name
      name
      Type
      string
      Description

      The name of the price category. Is used for identification

    Optional nested attributes (1)
    • Name
      _id
      Type
      string
      Description

      The ID of the price category

  • Name
    types
    Type
    array<object>
    Description

    An array of price types

    Required nested attributes (3)
    • Name
      name
      Type
      string
      Description

      The name of the price type. Is used for identification

    • Name
      categoryId
      Type
      string
      Description

      The ID of the price category

    • Name
      price
      Type
      number
      Description

      The default price for the type, can be overridden per price tier

    Optional nested attributes (1)
    • Name
      _id
      Type
      string
      Description

      The ID of the price type

  • Name
    tiers
    Type
    array<object>
    Description

    An array of price tiers

    Required nested attributes (1)
    • Name
      name
      Type
      string
      Description

      The name of the price tier. Is used for identification

    Optional nested attributes (2)
    • Name
      _id
      Type
      string
      Description
    • Name
      prices
      Type
      array<object>
      Description
      Required nested attributes (2)
      • Name
        priceTypeId
        Type
        string
        Description

        The ID of the price type

      • Name
        price
        Type
        number
        Description

        The price for the associated price type

Request

PUT
/api/price-tables/:id
const response = await fetch('https://vivenu.com/api/price-tables/507f191e810c19729de860ea', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer {token}',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(  {
    "name": "Example Name",
    "categories": [
      {
        "name": "Example Name",
        "_id": "507f191e810c19729de860ea"
      }
    ],
    "types": [
      {
        "name": "Example Name",
        "categoryId": "507f191e810c19729de860ea",
        "price": 10.5,
        "_id": "507f191e810c19729de860ea"
      }
    ],
    "tiers": [
      {
        "name": "Example Name",
        "_id": "507f191e810c19729de860ea",
        "prices": [
          {
            "priceTypeId": "507f191e810c19729de860ea",
            "price": 10.5
          }
        ]
      }
    ]
  }),
})

const data = await response.json()

Response (200)

{
  "_id": "507f191e810c19729de860ea",
  "sellerId": "507f191e810c19729de860ea",
  "name": "Example Name",
  "categories": [
    {
      "name": "Example Name",
      "_id": "507f191e810c19729de860ea"
    }
  ],
  "types": [
    {
      "name": "Example Name",
      "categoryId": "507f191e810c19729de860ea",
      "price": 10.5,
      "_id": "507f191e810c19729de860ea"
    }
  ],
  "tiers": [
    {
      "name": "Example Name",
      "_id": "507f191e810c19729de860ea",
      "prices": [
        {
          "priceTypeId": "507f191e810c19729de860ea",
          "price": 10.5
        }
      ]
    }
  ]
}

GET/api/price-tables

Get all Price Tables

Get all Price Tables

Query parameters

Optional query parameters

  • Name
    name
    Type
    string
    Description
  • Name
    top
    Type
    integer
    Description
  • Name
    skip
    Type
    integer
    Description

Request

GET
/api/price-tables
const response = await fetch('https://vivenu.com/api/price-tables?name=Example+Name&top=1&skip=1', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer {token}',
  },
})

const data = await response.json()

Response (200)

{
  "docs": [],
  "total": 1
}

Was this page helpful?