---
updatedAt: 2026-04-21T05:40:31.000Z
agentTools:
  projectIndex: https://docs.sequra.com/llms.txt
---

# Simulate subscription pricing

Calculates subscription pricing breakdown including subscriber fees based on tiered pricing

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "instore-api",
    "version": "v1"
  },
  "servers": [
    {
      "url": "http://localhost:3009"
    },
    {
      "url": "https://instore-sandbox.sequrapi.com/"
    },
    {
      "url": "https://instore.sequrapi.com/"
    },
    {
      "url": "https://{defaultHost}",
      "variables": {
        "defaultHost": {
          "default": "www.example.com"
        }
      }
    }
  ],
  "paths": {
    "/api/public/v1/subscriptions/simulator": {
      "post": {
        "summary": "Simulate subscription pricing",
        "tags": [
          "Subscriptions"
        ],
        "description": "Calculates subscription pricing breakdown including subscriber fees based on tiered pricing",
        "security": [
          {
            "basic_auth": []
          }
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "examples": {
              "contact lens pricing spread over the exchange cycle": {
                "value": "Basic YXBpdXNlcjE6YXBpdXNlcjE="
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "pricing breakdown calculated successfully",
            "content": {
              "application/json": {
                "examples": {
                  "contact lens pricing spread over the exchange cycle": {
                    "value": {
                      "items_count": 1,
                      "total_subscription_price": 20000,
                      "total_subscription_price_formatted": "200.00 EUR",
                      "subscriber_fee": 0,
                      "subscriber_fee_formatted": "0.00 EUR",
                      "monthly_total": 20000,
                      "monthly_total_formatted": "200.00 EUR",
                      "currency": "EUR"
                    }
                  },
                  "pricing breakdown calculated successfully": {
                    "value": {
                      "items_count": 2,
                      "total_subscription_price": 8000,
                      "total_subscription_price_formatted": "80.00 EUR",
                      "subscriber_fee": 0,
                      "subscriber_fee_formatted": "0.00 EUR",
                      "monthly_total": 8000,
                      "monthly_total_formatted": "80.00 EUR",
                      "currency": "EUR"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "text/html": {
                "examples": {
                  "unauthorized": {
                    "value": "HTTP Basic: Access denied.\n"
                  }
                }
              }
            }
          },
          "422": {
            "description": "invalid cart items",
            "content": {
              "application/json": {
                "examples": {
                  "missing or invalid cart items": {
                    "value": {
                      "errors": [
                        {
                          "code": "invalid_params",
                          "title": "Cart items are required"
                        }
                      ]
                    }
                  },
                  "invalid cart items": {
                    "value": {
                      "errors": [
                        {
                          "code": "invalid_params",
                          "title": "Invalid cart items"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "merchant",
                  "cart_items"
                ],
                "properties": {
                  "merchant": {
                    "type": "object",
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Merchant reference"
                      }
                    }
                  },
                  "cart_items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "price_with_tax"
                      ],
                      "properties": {
                        "price_with_tax": {
                          "type": "integer",
                          "description": "Total price including tax"
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "material_subscription",
                            "contact_lens_subscription",
                            "subscription_package"
                          ],
                          "description": "Item type. Defaults to material_subscription. Contact lens items are priced over their exchange cycle instead of the standard 24 months"
                        },
                        "items": {
                          "type": "array",
                          "minItems": 1,
                          "description": "Sub-items of a subscription_package. A subscription_package must carry its sub-items, and each of them must declare its type",
                          "items": {
                            "type": "object",
                            "required": [
                              "price_with_tax",
                              "type"
                            ],
                            "properties": {
                              "price_with_tax": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              },
              "examples": {
                "contact lens pricing spread over the exchange cycle": {
                  "summary": "contact lens pricing spread over the exchange cycle",
                  "value": {
                    "merchant": {
                      "id": "merchant_1"
                    },
                    "cart_items": [
                      {
                        "price_with_tax": 240000,
                        "name": "Monthly lenses",
                        "type": "contact_lens_subscription"
                      }
                    ]
                  }
                },
                "pricing breakdown calculated successfully": {
                  "summary": "pricing breakdown calculated successfully",
                  "value": {
                    "merchant": {
                      "id": "merchant_1"
                    },
                    "cart_items": [
                      {
                        "price_with_tax": 120000,
                        "name": "Item 1"
                      },
                      {
                        "price_with_tax": 72000,
                        "name": "Item 2"
                      }
                    ]
                  }
                },
                "missing or invalid cart items": {
                  "summary": "missing or invalid cart items",
                  "value": {
                    "merchant": {
                      "id": "merchant_1"
                    }
                  }
                },
                "invalid cart items": {
                  "summary": "invalid cart items",
                  "value": {
                    "merchant": {
                      "id": "merchant_1"
                    },
                    "cart_items": [
                      {
                        "name": "Item without price"
                      }
                    ]
                  }
                },
                "unauthorized": {
                  "summary": "unauthorized",
                  "value": {
                    "merchant": {
                      "id": "invalid_reference"
                    },
                    "cart_items": [
                      {
                        "price_with_tax": 120000,
                        "name": "Item 1"
                      }
                    ]
                  }
                }
              }
            }
          },
          "description": "Cart items to simulate pricing for"
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "basic_auth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  }
}
```