53 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
# Ozon Seller API Client
 | 
						|
A Ozon Seller API client written in Golang
 | 
						|
 | 
						|
[](https://coveralls.io/github/diPhantxm/ozon-api-client?branch=master)
 | 
						|

 | 
						|
 | 
						|
[Ozon](https://ozon.ru) is a marketplace for small and medium enterprises to launch and grow their businesses in Russia.
 | 
						|
 | 
						|
Read full [documentation](https://docs.ozon.ru/api/seller/en/#tag/Introduction)
 | 
						|
 | 
						|
You can check [list of supported endpoints](ENDPOINTS.md)
 | 
						|
 | 
						|
## How to start
 | 
						|
Just add dependency to your project and you're ready to go.
 | 
						|
```bash
 | 
						|
go get github.com/diphantxm/ozon-api-client
 | 
						|
```
 | 
						|
A simple example on how to use this library:
 | 
						|
```Golang
 | 
						|
package main
 | 
						|
 | 
						|
import (
 | 
						|
	"fmt"
 | 
						|
	"log"
 | 
						|
	"net/http"
 | 
						|
 | 
						|
	"github.com/diphantxm/ozon-api-client/ozon"
 | 
						|
)
 | 
						|
 | 
						|
func main() {
 | 
						|
	// Create a client with your Client-Id and Api-Key
 | 
						|
	// [Documentation]: https://docs.ozon.ru/api/seller/en/#tag/Auth
 | 
						|
	client := ozon.NewClient("my-client-id", "my-api-key")
 | 
						|
 | 
						|
	// Send request with parameters
 | 
						|
	resp, err := client.GetProductDetails(&ozon.GetProductDetailsParams{
 | 
						|
		ProductId: 123456789,
 | 
						|
	})
 | 
						|
	if err != nil || resp.StatusCode != http.StatusOK {
 | 
						|
		log.Fatalf("error when getting product details: %s", err)
 | 
						|
	}
 | 
						|
 | 
						|
	// Do some stuff
 | 
						|
	for _, d := range resp.Result.Barcodes {
 | 
						|
		fmt.Printf("Barcode %s\n", d)
 | 
						|
	}
 | 
						|
}
 | 
						|
```
 | 
						|
 | 
						|
## Contribution
 | 
						|
If you need some endpoints ASAP, create an issue and list all the endpoints. I will add them to library soon.
 | 
						|
 | 
						|
Or you can implement them and contribute to the project. Contribution to the project is welcome.  |