API Documentation

Integrate PnL By Azzi into your applications with our REST API.

Introduction

The PnL By Azzi API allows you to programmatically calculate profit and loss for your ecommerce orders. Base URL:

# Base URL https://api.pnlbyazzi.com/v1

Current version: v1

Authentication

Include your API key in the request header:

# Example Request curl -X POST https://api.pnlbyazzi.com/v1/calculate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json"

Calculate P&L

POST /v1/calculate

Request Body:

{ "orders": [ { "id": "ORD-001", "product": "Lipstick", "quantity": 2, "selling_price": 499, "cost_price": 150, "gst": 18 } ], "costs": { "packaging": 15, "shipping": 60, "platform_fee": 132 } }

Export Report

POST /v1/export

Export your P&L report as PDF or Excel:

{ "format": "pdf", // or "excel" "include_charts": true, "branding": false }

Error Codes

Code Message
400Bad Request - Invalid data
401Unauthorized - Invalid API key
429Rate limit exceeded
500Server error

Rate Limits

  • Free: 100 requests/day
  • Pro: 10,000 requests/day
  • Enterprise: Unlimited