PHPackages                             retail-cosmos/trx-mall-upload-sales-data-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. retail-cosmos/trx-mall-upload-sales-data-api

ActiveLibrary[API Development](/categories/api)

retail-cosmos/trx-mall-upload-sales-data-api
============================================

This is a Laravel package providing the functionality to upload sales data to the TRX mall via APIs

v2.0.1(1y ago)230.9k↑13.6%1[3 PRs](https://github.com/Retail-Cosmos/trx-mall-upload-sales-data-api/pulls)MITPHPPHP ^8.3CI passing

Since Jan 17Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Retail-Cosmos/trx-mall-upload-sales-data-api)[ Packagist](https://packagist.org/packages/retail-cosmos/trx-mall-upload-sales-data-api)[ Docs](https://github.com/retail-cosmos/trx-mall-upload-sales-data-api)[ GitHub Sponsors](https://github.com/Retail-Cosmos)[ RSS](/packages/retail-cosmos-trx-mall-upload-sales-data-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (14)Used By (0)

The TRX Mall Upload Sales Data API
==================================

[](#the-trx-mall-upload-sales-data-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8941e4b6eb7db89aaecfb0460ca460a217eedfa2b65027e44bebc351ca19b80c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72657461696c2d636f736d6f732f7472782d6d616c6c2d75706c6f61642d73616c65732d646174612d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/retail-cosmos/trx-mall-upload-sales-data-api)[![GitHub Tests Action Status](https://camo.githubusercontent.com/ce6a48991535ad053c935e9137502e5f69bb6419a6a7f2814e533abc185a6538/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f72657461696c2d636f736d6f732f7472782d6d616c6c2d75706c6f61642d73616c65732d646174612d6170692f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/retail-cosmos/trx-mall-upload-sales-data-api/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/b8dfe079de936bf6780159de9489dcf41861e80eab3823d307b0598b6c328ee2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f72657461696c2d636f736d6f732f7472782d6d616c6c2d75706c6f61642d73616c65732d646174612d6170692f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/retail-cosmos/trx-mall-upload-sales-data-api/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/2a77f6b8cb1c67d00c9b790022455a9aca0b5274bfdc98eb484f718ceaa95f05/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72657461696c2d636f736d6f732f7472782d6d616c6c2d75706c6f61642d73616c65732d646174612d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/retail-cosmos/trx-mall-upload-sales-data-api)

The TRX Mall Upload Sales Data API is a Laravel package to upload sales data to TRX Mall via API.

Installation
------------

[](#installation)

1. Install the package via composer:

```
composer require retail-cosmos/trx-mall-upload-sales-data-api
```

2. Publish the config file:

```
php artisan vendor:publish --tag="trx-mall-upload-sales-data-api-config"
```

3. Read the config file options and set `.env` variables accordingly.

Usage
-----

[](#usage)

1. You need to add code in your Laravel app to share the sales data with the package. A service class needs to be added for the same. We provide an option to generate the class with a single command:

```
php artisan vendor:publish --tag="trx-mall-upload-sales-data-api-service"
```

2. A new class is added at `app/Services/TrxMallUploadSalesDataApiService.php`. It contains a couple of methods to return the stores and sales data as per the requirements. You may make those methods dynamic by changing the code. You may check [this stub](stubs/TrxMallUploadSalesDataApiService.php) file anytime for future reference.
3. Add a [scheduler](https://laravel.com/docs/10.x/scheduling) in your [Laravel](https://laravel.com) project to call the command `trx:send-sales` daily at midnight. It sends the sales for the previous day for each store as returned from the application.

```
$schedule->command('trx:send-sales')->daily();
```

Notes
-----

[](#notes)

1. The sales command sends the sales for the previous day for each store by default. If you wish to send sales for a specific date/store, you may pass the following options to the command:
    - `--date` - Date in the Y-m-d (2024-12-31) format to send sales for a specific date.
    - `--store_identifier` - To send a sales for a specific store only. check the [stub file](stubs/TrxMallUploadSalesDataApiService.php) for the store identifier.

Example:

```
php artisan trx:send-sales --date=2024-11-31 --store_identifier=store1
```

2. If you have set respective .env variables, this package sends notification emails after successful/failed attempt to send sales data to TRX. If you want to customize the notification email, you can publish the view by running the following command:

```
php artisan vendor:publish --tag="trx-mall-upload-sales-data-api-view"
```

3. The package calculates 'Batch ID' for the sales data based on the `TRX_MALL_DATE_OF_FIRST_SALES_UPLOAD` in the `.env` file. It finds the difference between the date specified for `TRX_MALL_DATE_OF_FIRST_SALES_UPLOAD` and the date for which you are attempting to send the sales data and adds one(1) to it. For example, if the `TRX_MALL_DATE_OF_FIRST_SALES_UPLOAD` is set to `2024-01-10` and you are attempting to send the sales data for `2024-01-20` then the batch ID will be '11'.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Punyapal Shah](https://github.com/MrPunyapal)
- [Gaurav Makhecha](https://github.com/gauravmak)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance67

Regular maintenance activity

Popularity32

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 76.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~41 days

Recently: every ~86 days

Total

10

Last Release

482d ago

Major Versions

v1.0.7 → v2.0.02024-10-01

PHP version history (2 changes)v1.0.0PHP ^8.1

v2.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/2628a8e3bd55b2ab1a2b4aaccb5a88d33854348c7a7d99e4f76f49c502692329?d=identicon)[gauravmak](/maintainers/gauravmak)

---

Top Contributors

[![MrPunyapal](https://avatars.githubusercontent.com/u/53343069?v=4)](https://github.com/MrPunyapal "MrPunyapal (230 commits)")[![gauravmak](https://avatars.githubusercontent.com/u/11887260?v=4)](https://github.com/gauravmak "gauravmak (53 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![hvsharma63](https://avatars.githubusercontent.com/u/19151036?v=4)](https://github.com/hvsharma63 "hvsharma63 (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")[![nirav5920](https://avatars.githubusercontent.com/u/95966060?v=4)](https://github.com/nirav5920 "nirav5920 (1 commits)")

---

Tags

laravelRetail-Cosmostrx-mall-upload-sales-data-api

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/retail-cosmos-trx-mall-upload-sales-data-api/health.svg)

```
[![Health](https://phpackages.com/badges/retail-cosmos-trx-mall-upload-sales-data-api/health.svg)](https://phpackages.com/packages/retail-cosmos-trx-mall-upload-sales-data-api)
```

###  Alternatives

[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
