Download the PHP package izberg/izberg without Composer
On this page you can find all versions of the php package izberg/izberg. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download izberg/izberg
More information about izberg/izberg
Files in izberg/izberg
Package izberg
Short Description Php library to use Izberg marketplace API
License MIT
Informations about the package izberg
IZBERG-API-PHP
About
PHP Wrapper around the IZBERG API
Get started
Create an account on IZBERG-Marketplace. Create an application to be able to use this API.
API DOCUMENTATION
You can found our API documentation to help you.
Initialize the class
You can use your access token or our Single Sign On (SSO) system to identify:
IZBERG uses psr-4 convention for autoload
With Access token
With SSO
Sandbox
To use our sandbox environment, just pass the param sandbox
in options when you create your Izberg object:
Note: It will request a none https URL.
Authentication
By default, we authenticate the admin user with informations specified on initialization (email
, firstname
, lastname
). If you want to
authenticate a new user, you can do it using the setUser()
function:
This is useful when you want to link your API calls to a user, you will need it during an order process.
Resources
Basically, all resources are handled the same way, using the 5 same generic methods
- You have access to the following resources directly through the main Izberg object:
- Address
- Brand
- Cart
- ApplicationCategory (Categories of your application)
- Category (Categories created by IZBERG)
- Country
- Feed
- Webhook
- Merchant
- Order
- OrderItem
- Webhook
- LocaleConfig
- MerchantOrder
- Payment
- User
- Review
- Message
Instanciating resources
Get List
The get_list()
method will return an array containing all the instanciated objects from the called resource.
The first parameter is the resource's name, the second one are optional parameters, the last one is the accept type, for most of the action, you will
only need the $resource
parameter.
For example, the following will return the list of all the merchants on your marketplace.
Get
The get()
method works like get_list()
, but it returns only one object, you have to specify the object's id
For example, the following will return the cart object with ID '963':
Create
The create()
method will create a new element of the specified resource
$name
is the resource's name and $params
are the object you want to create ($params
can be either an object or an array)
The following example will create a new address:
Update
The update()
method will update one element from a specified resource
$name
is the resource's name, $id
is the object's id and $params
are the fields you want to update.
The following example will update an existing merchant
Resources specific methods
Each object returned by the handling methods can use both the save and delete functions
Save
Save the current object
Delete
Deletes an element from a specific resource
Order Process
Simple Order
Creating an order on IZBERG is really easy, the only thing you need is the Item ID, and your customer's informations.
Now that we have set the User informations, we can add the offer to the cart.
You have to use Cart::addItem()
for each different offer you want to add to your cart.
We need the country_id
in in order to set the customer's address (Default value is "FR").
Now we can set the Shipping and Billing addresses.
Now that both addresses are set, we can place the order.
Webhook
Create
Get and Update
Locale
GET
Update and reset using delete
Coupons
APPLY
Documentation
To generate doc, we use apigen , with this command:
apigen generate --source lib --destination doc
Run tests
- Install php unit : http://phpunit.de/getting-started.html
- cd /to/the/izberg/php/library/folder
- run 'USERNAME1=sebfie TOKEN1=156d219e38f84953c159a857738119bc0c35de96 API_SECRET_KEY=6cb0c550-9686-41af-9b5e-5cf2dc2aa3d0 phpunit --debug tests'
All versions of izberg with dependencies
ext-soap Version *
php Version >=7.4
html2text/html2text Version ^4.3
ext-curl Version *
ext-simplexml Version *