{"id":17989542,"url":"https://github.com/evilfreelancer/resova-api-php","last_synced_at":"2025-07-20T09:40:09.683Z","repository":{"id":56980257,"uuid":"207102717","full_name":"EvilFreelancer/resova-api-php","owner":"EvilFreelancer","description":"Resova API PHP7 client","archived":false,"fork":false,"pushed_at":"2020-06-18T07:53:57.000Z","size":80,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-20T22:09:56.910Z","etag":null,"topics":["api-client","library","php7","psr","resova","resova-api","restful","sdk"],"latest_commit_sha":null,"homepage":"https://developers.resova.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EvilFreelancer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"efreelancer"}},"created_at":"2019-09-08T11:31:08.000Z","updated_at":"2024-02-06T02:25:01.000Z","dependencies_parsed_at":"2022-08-21T10:50:25.364Z","dependency_job_id":null,"html_url":"https://github.com/EvilFreelancer/resova-api-php","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fresova-api-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fresova-api-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fresova-api-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fresova-api-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvilFreelancer","download_url":"https://codeload.github.com/EvilFreelancer/resova-api-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245561158,"owners_count":20635683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","library","php7","psr","resova","resova-api","restful","sdk"],"created_at":"2024-10-29T19:14:54.940Z","updated_at":"2025-03-25T23:30:44.708Z","avatar_url":"https://github.com/EvilFreelancer.png","language":"PHP","funding_links":["https://patreon.com/efreelancer"],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/evilfreelancer/resova-api-php/v/stable)](https://packagist.org/packages/evilfreelancer/resova-api-php)\n[![Build Status](https://travis-ci.org/EvilFreelancer/resova-api-php.svg?branch=master)](https://travis-ci.org/EvilFreelancer/resova-api-php)\n[![Total Downloads](https://poser.pugx.org/evilfreelancer/resova-api-php/downloads)](https://packagist.org/packages/evilfreelancer/resova-api-php)\n[![License](https://poser.pugx.org/evilfreelancer/resova-api-php/license)](https://packagist.org/packages/evilfreelancer/resova-api-php)\n[![Code Climate](https://codeclimate.com/github/EvilFreelancer/resova-api-php/badges/gpa.svg)](https://codeclimate.com/github/EvilFreelancer/resova-api-php)\n[![Code Coverage](https://scrutinizer-ci.com/g/EvilFreelancer/resova-api-php/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/EvilFreelancer/resova-api-php/?branch=master)\n[![Scrutinizer CQ](https://scrutinizer-ci.com/g/evilfreelancer/resova-api-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/evilfreelancer/resova-api-php/)\n\n# Resova API PHP7 client\n\nThis project is a simple and minimalistic client for work with Resova API, based on Guzzle Http client.\n\n    composer require evilfreelancer/resova-api-php\n\n## Laravel framework support\n\nResova API client is optimized for usage as normal Laravel package, all functional is available via `\\ResovaApi` facade,\nfor access to client object you need instead:\n\n```php\n$config = new \\Resova\\Config(['api_key' =\u003e 'my-secret-key']);\n$resova = new \\Resova\\Client($config);\n```\n\nUse:\n\n```php\n$resova = \\ResovaApi::getClient();\n```\n\nYou also may provide additional parameters to your client by passing array of parameters to `getClient` method:\n\n```php\n$resova = \\ResovaApi::getClient([\n    'api_key' =\u003e 'my-secret-key',\n    'timeout' =\u003e 1000,\n]);\n```\n\n### Laravel installation\n\nInstall the package via Composer:\n\n    composer require evilfreelancer/resova-api-php\n\nBy default the package will automatically register its service provider, but\nif you are a happy owner of Laravel version less than 5.3, then in a project, which is using your package\n(after composer require is done, of course), add into`providers` block of your `config/app.php`:\n\n```php\n'providers' =\u003e [\n    // ...\n    Resova\\Laravel\\ClientServiceProvider::class,\n],\n```\n\nOptionally, publish the configuration file if you want to change any defaults:\n\n    php artisan vendor:publish --provider=\"Resova\\\\Laravel\\\\ClientServiceProvider\"\n\n## Terminology\n\nThere are four key objects in Resova that every API developer should know about.\n\n| Objects      | Description |\n|--------------|-------------|\n| items        | An activity/service is known as an Item, these are what your customers will purchase. |\n| instances    | An instance is a date and time belonging to an item. An instance is required to be included when creating a booking. |\n| bookings     | A customer will make a booking for a specific Item and Instance (date/time), they're essentially purchasing something. All bookings belong to a Transaction |\n| transactions | A Transaction is the overall purchase order. All Bookings belong to a Transaction and there can be more than one Booking per Transaction. |\n\n## How to use\n\nSee other examples of usage [here](examples) separated by class names.\n\n### Basic example\n\n```php\n\u003c?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\nuse Resova\\Config;\nuse Resova\\Client;\n\n$config = new Config(['api_key' =\u003e getenv('API_KEY')]);\n$resova = new Client($config);\n\n// Get all slots for all items in dates range\n$calendar = $resova-\u003eavailability-\u003ecalendar(date('Y-m-d'), date('Y-m-d'))-\u003eexec();\n\nforeach ($calendar as $instances) {\n    // Get availability of slots for some item\n    $instance = $resova-\u003eavailability-\u003einstance(3)-\u003eexec();\n}\n```\n\n**Where can I find my api key?**\n\nIf you haven't already, you can sign up for a new account here.\nOnce you have logged into your account head over to **Settings \u003e General Settings \u003e Developer**\nwhere your API KEY will be located.\n\n\u003cdetails\u003e\n\u003csummary\u003e\n\u003cb\u003e*Items* endpoints\u003c/b\u003e\n\u003c/summary\u003e\n\nItems mean your rooms in Resova system.\n\nhttps://developers.resova.com/reference#items\n\n```php\n// Single\n$result = $resova-\u003eitem(1)-\u003eexec();\nprint_r($result);\n\n// Single: Reviews list\n$result = $resova-\u003eitem(1)-\u003ereviews()-\u003eexec();\nprint_r($result);\n\n// Single: Booking questions list\n$result = $resova-\u003eitem(1)-\u003ebooking_questions()-\u003eexec();\nprint_r($result);\n\n// Single: Extras list\n$result = $resova-\u003eitem(1)-\u003eextras()-\u003eexec();\nprint_r($result);\n\n// All\n$result = $resova-\u003eitems-\u003eexec();\nprint_r($result);\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\n\u003cb\u003e*Availability* endpoints\u003c/b\u003e\n\u003c/summary\u003e\n\nAvailability details of instances, instances prices and calendars of dates etc.\n\n\u003e Instance - in logic of Resova API mean time slot with price\n\nhttps://developers.resova.com/reference#availability\n\n```php\nuse \\Resova\\Models\\Pricing;\n\n$result = $resova-\u003eavailability-\u003einstance(123)-\u003eexec();\nprint_r($result);\n\n$pricing = new Pricing([\n    'quantities' =\u003e [\n        ['pricing_category_id' =\u003e 1, 'quantity' =\u003e 2],\n        ['pricing_category_id' =\u003e 1, 'quantity' =\u003e 3],\n        ['pricing_category_id' =\u003e 1, 'quantity' =\u003e 4],\n    ]\n]);\n$result = $resova-\u003eavailability-\u003einstance(123)-\u003epricing($pricing)-\u003eexec();\nprint_r($result);\n\n$result = $resova-\u003eavailability-\u003ecalendar(date('Y-m-d'), date('Y-m-d'))-\u003eexec();\nprint_r($result);\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\n\u003cb\u003e*Baskets* endpoints\u003c/b\u003e\n\u003c/summary\u003e\n\nBaskets in Resova it mean Carts, it contain details about prepared for booking carts created by clients.\n\nhttps://developers.resova.com/reference#the-basket-object\n\n```php\nuse \\Resova\\Models\\BasketRequest;\n\n// Basket request object\n$basket = new BasketRequest([\n    'customer_id' =\u003e 123,\n    'expires_at'  =\u003e '1558101934',\n]);\n\n// Create\n$result = $resova-\u003ebaskets-\u003ecreate($basket)-\u003eexec();\nprint_r($result);\n\n// List\n$result = $resova-\u003ebaskets-\u003eexec();\nprint_r($result);\n\n// Single\n$result = $resova-\u003ebasket(123)-\u003eexec();\nprint_r($result);\n\n// Update\n$result = $resova-\u003ebasket(123)-\u003eupdate($basket)-\u003eexec();\nprint_r($result);\n\n// Delete\n$result = $resova-\u003ebasket(123)-\u003edelete()-\u003eexec();\nprint_r($result);\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\n\u003cb\u003e*Customers* endpoints\u003c/b\u003e\n\u003c/summary\u003e\n\nFor work with customers information, like emails, phones, addresses, etc.\n\nhttps://developers.resova.com/reference#customers\n\n```php\nuse \\Resova\\Models\\Customer;\nuse \\Resova\\Models\\CustomerCreate;\n\n// Customer create request object\n$customerCreate = new CustomerCreate([\n    'first_name' =\u003e 'John',\n    'last_name'  =\u003e 'Doe',\n    'email'      =\u003e 'email@example.com'\n]);\n\n// Create\n$result = $resova-\u003ecustomers-\u003ecreate($customerCreate)-\u003eexec();\nprint_r($result);\n\n// Single\n$result = $resova-\u003ecustomer(123)-\u003eexec();\nprint_r($result);\n\n// Customer update request object\n$customerUpdate = new Customer([\n    'first_name' =\u003e 'John',\n    'last_name'  =\u003e 'Doe',\n    'email'      =\u003e 'email@example.com'\n]);\n\n// Update\n$result = $resova-\u003ecustomer(123)-\u003eupdate($customerUpdate)-\u003eexec();\nprint_r($result);\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\n\u003cb\u003e*Gift Voucher* endpoints\u003c/b\u003e\n\u003c/summary\u003e\n\nGift Vouchers in Resova it mean Promocodes, you can manage your promo campaigns. \n\nhttps://developers.resova.com/reference#gift-vouchers\n\n```php\n// Single\n$result = $resova-\u003egift_voucher(123)-\u003eexec();\nprint_r($result);\n\n// All\n$result = $resova-\u003egift_vouchers-\u003eexec();\nprint_r($result);\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\n\u003cb\u003e*Webhooks* endpoints\u003c/b\u003e\n\u003c/summary\u003e\n\n```php\n// All\n$result = $resova-\u003ewebhooks-\u003eall()-\u003eexec();\nprint_r($result);\n```\n\n\u003c/details\u003e\n\n# Some things which you also should know\n\n1. Resova's technical support is very reluctant to answer any of your\nrequests, even if you have a bank card connected and you earn money,\nwith a small degree of probability any requests from you will stop\nbeing processed, and your mail will be blacklisted\n\n2. On trial account you can't use API, so you can't check functionality\nbefore adding the bank card\n\n3. You should add your server's IP to whitelist in Resova developer settings\n\n4. But despite paragraph `3.` your server's IP may be blocked\nautomatically without explanations (via probably fail2ban),\nand support team after few unanswered questions will add your\nemail/facebook account to blacklist\n\n5. Optimal amount of HTTP requests before your IP will banned\nis no more than 1000 per day, or about 40 requests per hour,\nmaybe this is due to the recent DDoS ​​attack to their servers,\nso be very careful, otherwise you will have to configure\nintermediate proxy servers, which is not very convenient\n(and which also will be banned after some time)\n\n6. Resova does not provide test accounts or stagging environments\nto test the functionality of your application before publishing to\nproduction, so be very careful when working with Resova API,\ndouble-check all data\n\n# Links\n\n* [Review of Resova API](https://docs.google.com/document/d/11RVyOVyMxKqBIg-yNkJfhXS2dO0HwpocJt4QhjwXOU0/edit?usp=sharing)\n* https://resova.com\n* https://developers.resova.com/reference\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilfreelancer%2Fresova-api-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevilfreelancer%2Fresova-api-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilfreelancer%2Fresova-api-php/lists"}