Download the PHP package noosh24/open-api without Composer

On this page you can find all versions of the php package noosh24/open-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package open-api

Noosh24 # Noosh24 Open API for PHP **The official PHP client for the [Noosh24 Open API](https://developer.noosh24.com).**
Menu, reservations, orders and bills, payments and the Z-report, tables, customers, loyalty, stock and reviews of a Noosh24 venue, plus creating and cancelling reservations. CI PHP 8.2+ Packagist MIT license [Developer site](https://developer.noosh24.com) · [API reference](https://developer.noosh24.com/reference) · [All SDKs](https://github.com/noosh24/sdks) · [Report an issue](https://github.com/noosh24/sdks/issues)

[!IMPORTANT] Keep the API key on your server. A key belongs to one venue and opens its data: guests' phone numbers, payments, and writing reservations. Never put it in a browser, a mobile app or a public repository.

Contents: License

Requirements

Install

Quick start

The key belongs to one venue, so there is no venue parameter anywhere. Keys are issued in the Noosh24 panel; keep them on your server, never in a browser or a mobile app.

Options

timeout is in seconds. transport takes your own Noosh24\OpenApi\Http\Transport if you do not want cURL.

Resources

Group Methods
whoami() the venue, the key's scopes and the venue's modules
menu listCategories(), listProducts(), iterateProducts(), getProduct($id, $expand), getStopList()
reservations list(), iterate(), get($id), availability($date, $time, $guests), create([...]), cancel($id)
orders list(), iterate(), get($id), listBills(), iterateBills(), getBill($id)
payments list(), iterate(), get($id), zReport($date)
tables list(), listHalls()
customers list(), iterate(), get($id)
loyalty getProgram(), listCards(), iterateCards()
stock listIngredients(), iterateIngredients(), listMoves(), iterateMoves(), listStores()
reviews list(), iterate()

Every response is a typed model (Product, Reservation, Order, ...) with public properties named as in the API. Timestamps are DateTimeImmutable in UTC, money is float in AZN. $model->toArray() gives the raw JSON, including fields this version of the SDK does not know yet.

Lists, filters and pages

List methods take limit, offset, sort, where and, for products, expand. They return a Page with items, total, limit, offset and hasMore().

where is AND only. Build it with Where so strings and dates are quoted correctly:

The iterate*() methods walk every page for you and fetch the next page only when you reach it:

offset stops at 10000. For bigger exports, narrow where by date and walk one window at a time.

Reservations

A booking lands as pending and the venue confirms it. Always send externalRef (your own booking id): sending the same externalRef again returns the booking that already exists instead of making a second one, so a create is safe to retry. The client retries a create only when it carries an externalRef. You can cancel only bookings your key created.

Errors

Every API error throws a subclass of Noosh24\OpenApi\Exception\ApiException with getStatus(), getErrorCode() (the API's error field), getMessage() and getHeaders(). Branch on the class or on getErrorCode(), not on the message.

error Exception Parent
validation_error ValidationException ApiException
no_api_key NoApiKeyException AuthenticationException
invalid_api_key InvalidApiKeyException AuthenticationException
insufficient_scope InsufficientScopeException PermissionDeniedException
module_not_enabled ModuleNotEnabledException PermissionDeniedException
venue_suspended VenueSuspendedException PermissionDeniedException
not_your_reservation NotYourReservationException PermissionDeniedException
not_found NotFoundException ApiException
table_not_found TableNotFoundException NotFoundException
table_taken TableTakenException ConflictException
cannot_cancel CannotCancelException ConflictException
outside_hours, in_the_past, table_too_small OutsideHoursException, InThePastException, TableTooSmallException UnprocessableException
rate_limit_exceeded RateLimitException (getRetryAfter()) ApiException
temporarily_unavailable TemporarilyUnavailableException ServerException

A network failure or timeout throws ConnectionException. All of them implement Noosh24Exception.

Retries and rate limits

A key gets 600 requests a minute. On 429 and 502/503/504 the client waits (Retry-After when the API sends it, otherwise 0.5 s, 1 s, 2 s ...) and tries again, up to maxRetries times. It never waits more than 60 seconds; a longer Retry-After is thrown to you as a RateLimitException. Reads, cancels and creates with an externalRef are retried; a create without an externalRef is not.

Development

License

MIT


All versions of open-api with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package noosh24/open-api contains the following files

Loading the files please wait ...