> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Get vendor stats

GET https://api-sandbox.payabli.com/api/Statistic/vendorbasic/{mode}/{freq}/{idVendor}

Retrieve the basic statistics about a vendor for a given time period, grouped by frequency.

Reference: https://docs.payabli.com/developers/api-reference/vendor/get-basic-statistics-for-a-vendor

## Authentication

- `Authorization` header (bearer token, required)
- `requestToken` header (required) — Long-lived API token sent in the `requestToken` header. See [API token authentication](/developers/api-tokens).

## Servers

- `https://api-sandbox.payabli.com/api` (Sandbox, default)
- `https://api.payabli.com/api` (Production)

## Request

### Path parameters

- `freq` (string, required) — Frequency to group series. Allowed values: - `m` - monthly - `w` - weekly - `d` - daily - `h` - hourly For example, `w` groups the results by week.
- `idVendor` (integer, required) — Vendor ID.
- `mode` (string, required) — Mode for request. Allowed values: - `ytd` - Year To Date - `mtd` - Month To Date - `wtd` - Week To Date - `today` - All current day - `m12` - Last 12 months - `d30` - Last 30 days - `h24` - Last 24 hours - `lasty` - Last Year - `lastm` - Last Month - `lastw` - Last Week - `yesterday` - Last Day

### Query parameters

- `parameters` (map from string to string, optional) — List of parameters

## Response

### 200

Success

- `list of object`
  - `statX` (string, required) — Statistical grouping identifier
  - `active` (integer, required) — Number of active transactions
  - `activeVolume` (double, required) — Volume of active transactions
  - `sentToApproval` (integer, required) — Number of transactions sent to approval
  - `sentToApprovalVolume` (double, required) — Volume of transactions sent to approval
  - `toApproval` (integer, required) — Number of transactions to approval
  - `toApprovalVolume` (double, required) — Volume of transactions to approval
  - `approved` (integer, required) — Number of approved transactions
  - `approvedVolume` (double, required) — Volume of approved transactions
  - `disapproved` (integer, required) — Number of disapproved transactions
  - `disapprovedVolume` (double, required) — Volume of disapproved transactions
  - `cancelled` (integer, required) — Number of cancelled transactions
  - `cancelledVolume` (double, required) — Volume of cancelled transactions
  - `inTransit` (integer, required) — Number of transactions in transit
  - `inTransitVolume` (double, required) — Volume of transactions in transit
  - `paid` (integer, required) — Number of paid transactions
  - `paidVolume` (double, required) — Volume of paid transactions

## Examples

**Response**

```json
[
  {
    "statX": "2023-03",
    "active": 25,
    "activeVolume": 5000.25,
    "sentToApproval": 10,
    "sentToApprovalVolume": 2500.75,
    "toApproval": 8,
    "toApprovalVolume": 1800.5,
    "approved": 20,
    "approvedVolume": 4200,
    "disapproved": 3,
    "disapprovedVolume": 600.25,
    "cancelled": 2,
    "cancelledVolume": 400,
    "inTransit": 5,
    "inTransitVolume": 1250.75,
    "paid": 18,
    "paidVolume": 3800.5
  }
]
```

**SDK Code**

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        clientId: "YOUR_CLIENT_ID",
        clientSecret: "YOUR_CLIENT_SECRET",
    });
    await client.statistic.vendorBasicStats("ytd", "m", 1, {});
}
main();

```

```python
from payabli import payabli

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

client.statistic.vendor_basic_stats(
    mode="ytd",
    freq="m",
    id_vendor=1,
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;
import io.github.payabli.api.resources.statistic.requests.VendorBasicStatsRequest;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

        client.statistic().vendorBasicStats(
            "ytd",
            "m",
            1,
            VendorBasicStatsRequest
                .builder()
                .build()
        );
    }
}
```

```ruby
require "payabli"

client = Payabli::Client.new(api_key: "YOUR_API_KEY_HERE")

client.statistic.vendor_basic_stats(
  mode: "ytd",
  freq: "m",
  id_vendor: 1
)

```

```csharp
using PayabliApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

        await client.Statistic.VendorBasicStatsAsync(
            mode: "ytd",
            freq: "m",
            idVendor: 1,
            request: new VendorBasicStatsRequest()
        );
    }

}

```

```go
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() {
    client := client.NewClient(
        option.WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        ),
    )
    request := &payabli.VendorBasicStatsRequest{}
    client.Statistic.VendorBasicStats(
        context.TODO(),
        "ytd",
        "m",
        1,
        request,
    )
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\Statistic\Requests\VendorBasicStatsRequest;

$client = new PayabliClient(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
);
$client->statistic->vendorBasicStats(
    'ytd',
    'm',
    1,
    new VendorBasicStatsRequest([]),
);

```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Statistic/vendorbasic/ytd/m/1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```