Skip to main content
POST
/
inventory
/
commission-structures
/
generate-report
Generate Commission Report
curl --request POST \
  --url https://api.decodahealth.com/inventory/commission-structures/generate-report \
  --header 'API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TENANT: <tenant>' \
  --data '
{
  "structure_ids": [
    "<string>"
  ],
  "start_date": "2023-12-25",
  "end_date": "2023-12-25"
}
'
[
  {
    "commissionStructure": {
      "name": "<string>",
      "id": "<string>",
      "description": "<string>",
      "commissions": [
        {
          "commissionStructureId": "<string>",
          "id": "<string>",
          "itemId": "<string>",
          "itemCategory": "<string>",
          "itemIsPhysical": true,
          "totalSalesAmount": 123,
          "percentage": 123,
          "amount": 123,
          "deductCost": false,
          "isArchived": false,
          "updatedDate": "2023-11-07T05:31:56Z",
          "createdDate": "2023-11-07T05:31:56Z",
          "item": {
            "name": "<string>",
            "price": 123,
            "id": "<string>",
            "brandName": "<string>",
            "description": "<string>",
            "category": "<string>",
            "unit": "AMPOULES",
            "isPhysical": true,
            "isArchived": false,
            "internalNotes": "<string>",
            "taxable": false,
            "sortOrder": 123,
            "allowCustomPricing": false,
            "type": "PRODUCT"
          }
        }
      ],
      "providers": [
        {
          "id": "<string>",
          "firstName": "<string>",
          "lastName": "<string>",
          "email": "<string>",
          "createdDate": "2023-11-07T05:31:56Z"
        }
      ]
    },
    "startDate": "2023-12-25",
    "endDate": "2023-12-25",
    "payouts": [
      {
        "commissionReportId": "<string>",
        "commissionId": "<string>",
        "providerId": "<string>",
        "amount": 123,
        "provider": {
          "id": "<string>",
          "firstName": "<string>",
          "lastName": "<string>",
          "email": "<string>",
          "createdDate": "2023-11-07T05:31:56Z"
        },
        "commission": {
          "commissionStructureId": "<string>",
          "id": "<string>",
          "itemId": "<string>",
          "itemCategory": "<string>",
          "itemIsPhysical": true,
          "totalSalesAmount": 123,
          "percentage": 123,
          "amount": 123,
          "deductCost": false,
          "isArchived": false,
          "updatedDate": "2023-11-07T05:31:56Z",
          "createdDate": "2023-11-07T05:31:56Z",
          "item": {
            "name": "<string>",
            "price": 123,
            "id": "<string>",
            "brandName": "<string>",
            "description": "<string>",
            "category": "<string>",
            "unit": "AMPOULES",
            "isPhysical": true,
            "isArchived": false,
            "internalNotes": "<string>",
            "taxable": false,
            "sortOrder": 123,
            "allowCustomPricing": false,
            "type": "PRODUCT"
          }
        },
        "chargeItems": [
          {
            "chargeId": "<string>",
            "quantity": 123,
            "price": 123,
            "id": "<string>",
            "itemId": "<string>",
            "name": "<string>",
            "description": "<string>",
            "discountAmount": 123,
            "discountPercentage": 123,
            "discountReason": "<string>",
            "soldPackageId": "<string>",
            "bankedQuantity": 123,
            "bankedItemId": "<string>",
            "issuedDiscountId": "<string>",
            "soldByProviderId": "<string>",
            "taxAmount": 123,
            "pricingId": "<string>",
            "shipmentIds": [
              "<string>"
            ],
            "item": {
              "name": "<string>",
              "price": 123,
              "id": "<string>",
              "brandName": "<string>",
              "description": "<string>",
              "category": "<string>",
              "unit": "AMPOULES",
              "isPhysical": true,
              "isArchived": false,
              "internalNotes": "<string>",
              "taxable": false,
              "sortOrder": 123,
              "allowCustomPricing": false,
              "type": "PRODUCT"
            },
            "locationId": "<string>",
            "locationName": "<string>",
            "saleDate": "2023-11-07T05:31:56Z"
          }
        ],
        "events": [
          {
            "id": "<string>",
            "title": "<string>",
            "start": "2023-11-07T05:31:56Z",
            "end": "2023-11-07T05:31:56Z",
            "type": "APPOINTMENT",
            "status": "PENDING",
            "location": {
              "id": "<string>",
              "isVirtual": true
            },
            "attendees": [],
            "recurringEventId": "<string>",
            "recurringEvent": {
              "id": "<string>",
              "rrule": "<string>",
              "startDate": "2023-11-07T05:31:56Z",
              "durationMinutes": 123,
              "timezone": "<string>",
              "type": "APPOINTMENT",
              "title": "<string>",
              "organizerId": "<string>",
              "serviceIds": [
                "<string>"
              ],
              "capacity": 123,
              "attendeeIds": [
                "<string>"
              ],
              "locationId": "<string>"
            },
            "eventServices": [],
            "icons": [],
            "capacity": 123
          }
        ],
        "soldPackages": [
          {
            "packageId": "<string>",
            "patientId": "<string>",
            "chargeItemId": "<string>",
            "status": "USED",
            "createdDate": "2023-11-07T05:31:56Z",
            "id": "<string>",
            "package": {
              "name": "<string>",
              "price": 123,
              "id": "<string>",
              "description": "<string>",
              "isArchived": false,
              "internalNotes": "<string>",
              "items": [
                {
                  "packageId": "<string>",
                  "itemId": "<string>",
                  "price": 123,
                  "id": "<string>",
                  "quantity": 123,
                  "item": {
                    "name": "<string>",
                    "price": 123,
                    "id": "<string>",
                    "brandName": "<string>",
                    "description": "<string>",
                    "category": "<string>",
                    "unit": "AMPOULES",
                    "isPhysical": true,
                    "isArchived": false,
                    "internalNotes": "<string>",
                    "taxable": false,
                    "sortOrder": 123,
                    "allowCustomPricing": false,
                    "type": "PRODUCT"
                  }
                }
              ],
              "category": "<string>"
            },
            "updatedDate": "2023-11-07T05:31:56Z"
          }
        ],
        "id": "<string>",
        "createdDate": "2023-11-07T05:31:56Z"
      }
    ],
    "totalPayout": 123,
    "commissionStructureId": "<string>",
    "creatorId": "<string>",
    "id": "<string>",
    "createdDate": "2023-11-07T05:31:56Z",
    "updatedDate": "2023-11-07T05:31:56Z",
    "isArchived": false
  }
]

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Body

application/json
structure_ids
string[]
required
start_date
string<date>
required
end_date
string<date>
required

Response

Successful Response

commissionStructure
CommissionStructureDetail · object
required

Commission structure this report belongs to

startDate
string<date>
required

Start date of the report

endDate
string<date>
required

End date of the report

payouts
CommissionPayoutDetail · object[]
required

Payouts for this commission structure

totalPayout
integer
required

Total payout for this commission structure

commissionStructureId
string
required

Commission structure this report belongs to

creatorId
string
required

Creator of the report

id
string
required

Unique identifier for the commission report

createdDate
string<date-time> | null

When the report was created

updatedDate
string<date-time> | null

When the report was last updated

isArchived
boolean
default:false

Whether the report is archived