glovo.client.csharp
1.5.0
dotnet add package glovo.client.csharp --version 1.5.0
NuGet\Install-Package glovo.client.csharp -Version 1.5.0
<PackageReference Include="glovo.client.csharp" Version="1.5.0" />
<PackageVersion Include="glovo.client.csharp" Version="1.5.0" />
<PackageReference Include="glovo.client.csharp" />
paket add glovo.client.csharp --version 1.5.0
#r "nuget: glovo.client.csharp, 1.5.0"
#:package glovo.client.csharp@1.5.0
#addin nuget:?package=glovo.client.csharp&version=1.5.0
#tool nuget:?package=glovo.client.csharp&version=1.5.0
glovo.client.csharp - the C# library for the Glovo Partners API
Introduction
The Glovo Partners API is aimed at developers from POS systems that want to programmatically manage stores, keep their content updated and handle orders with the purpose of improving efficiency and keeping data in sync with their business.
Getting started
If this is the first time you operate with our API, please contact your Glovo Account Manager (AM) to setup your credentials.
You'll be asked to provide the following information:
- Details of the store(s) you want to operate with.
- An unique identifier for each store.
- A set of endpoint URLs for the notifications you want to receive from Glovo (for example when an order is dispatched to your store).
API Credentials
To operate with this API you will be provided of a single static token that will work for all of the Stores under your control. This token is secret and should be kept in a secure place.
For more details on how to use it please review the Authentication section.
Unique identifier of the store
Since you could be operating with multiple stores, identifying each one in every operation is be essential. It's important that you hold and share with us an unique identifier for every store integrated through this API.
This identifier will be requested for every endpoint call as a path parameter:
/stores/YOUR-STORE-ID/...
We will also make sure that you receive it as part all notifications we will be sending to your webhooks:
{
...
\"store_id\": \"YOUR-STORE-ID\",
...
}
Marketplace orders
The delivery of an order can be either taken care by a Glovo courier or by the store itself. For the cases Glovo is not involved in the delivery process we identify these stores as marketplace. Through this documention you will see notes and references destinated to these types of stores that require extra information to fulfill an order.
Event notifications using webhooks
Notifications about different events that happen in Glovo are going to be send to your systems using Webhooks.
Your AM is going to request a set of endpoint URLs from your systems for us to send those notifications. Having a single endpoint for all notifications or different ones will be completely up to you and how your system is designed.
// example of some webhooks
https://yourserver.com/glovo/orders/dispatched
https://yourserver.com/glovo/orders/cancelled
It is important that all the webhook URLs are accessible from any IP address. To understand more about security for these webhooks, please refer to the Authentication section.
As a general rule, we will be calling your registered webhooks with an HTTP POST method unless otherwise specified in the notification description.
Please refer to the Order Notifications section to see all different events you can subscribe to along with the notification schemas.
Best Usage Policy
Please follow these guidelines in order to reduce potential issues that could delay rollout of your integration.
We strongly advise before using our system that the you check two important concepts:
- The rate limit for the endpoint that you are intending to used is respected by the systems that will call it.
- That the menu uploaded matches our JSON schema, or it will be rejected as part of the upload process.
- All image urls that are uploaded to the system should use the protocol HTTPS for security reasons - the JSON schema above will reject any that are not served by it.
If either of these cause issues or are not understood please contact your account manager for further information and support.
Store Image Guidelines
It is important to select appropriate images as the structure of store's menu affects the visual display of the products and directly impacts the user experience in both the Glovo app and the website.
Product Images
Product images are nice-to-have but not mandatory.
Specifications:
* Orientation: Square.
* Dimensions: 1000 x 1000 px.
* Format: JPG.
* File size: below 1MB
* Background: light, plain colour or plain texture (e.g. wooden)
* Protocol: HTTPS
* You must show the product in a frontal plane
* Each product separately
Note: It's important to maintain the coherent style of the product images (e.g. follow the same color palette and perspective) and keep in mind that for improving the user’s experience, it is recommended to have either all the products with an image or no pictures at all. Having only a few products with images across the menu creates visual chaos and can unwillingly contribute to boosting sales of only those products with visual representation.
In the most common menu type (with Sections only) the products that contain images will be displayed as below:
<div align="center" class="img-div"> <img alt="product image 1" src="img/product_image_1.png#center" /> </div>
After selecting any product, the image becomes square:
<div align="center" class="img-div"> <img alt="product image 2" src="img/product_image_2.png#center" /> </div>
Collection Images
Collection images generated automatically from 3 selected images of products grouped under the same collection. They will be displayed together as seen below:
<div align="center" class="img-div"> <img alt="collection image" src="img/collection_image.png#center" /> </div>
Supercollection Images
These are mandatory for all supercollections.
Specifications:
* Orientation: Horizontal.
* Dimensions - 2484 x 1380 px.
* Format: JPG.
* File size: below 1,5 MB
* Protocol: HTTPS.
* Must show the product in a close-up, without transparency
* They can not be photomontages or contain logos or promotional elements pasted on the image
* They can have the logo of the brand applied to commercial elements as napkins, tablecloths, etc.
They will appear in the app like this:
<div align="center" class="img-div"> <img alt="collection image" src="img/supercollection_image.png#center" /> </div>
Future changes
Please note that this part of the document is flux. There is the possibility of changes to some of the images specified here in the near future.
Authentication
A static token to operate with our API will be provided by your AM. It's important that you keep it in a secure place. All API calls must be made over HTTPS.
The token won't be require to be changed over time, but if you think it was compromised in some way, please contact us so we can generate a new one.
<SecurityDefinitions />
This C# SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen
<a name="frameworks-supported"></a>
Frameworks supported
<a name="dependencies"></a>
Dependencies
- RestSharp - 106.13.0 or later
- Json.NET - 12.0.3 or later
- JsonSubTypes - 1.8.0 or later
- System.ComponentModel.Annotations - 5.0.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.
<a name="installation"></a>
Installation
Run the following command to generate the DLL
- [Mac/Linux]
/bin/sh build.sh - [Windows]
build.bat
Then include the DLL (under the bin folder) in the C# project, and use the namespaces:
using glovo.client.csharp.Api;
using glovo.client.csharp.Client;
using glovo.client.csharp.Model;
<a name="packaging"></a>
Packaging
A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.
This .nuspec uses placeholders from the .csproj, so build the .csproj directly:
nuget pack -Build -OutputDirectory out glovo.client.csharp.csproj
Then, publish to a local feed or other host and consume the new package via Nuget as usual.
<a name="usage"></a>
Usage
To use the API client with a HTTP proxy, setup a System.Net.WebProxy
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
<a name="getting-started"></a>
Getting Started
using System.Collections.Generic;
using System.Diagnostics;
using glovo.client.csharp.Api;
using glovo.client.csharp.Client;
using glovo.client.csharp.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://stageapi.glovoapp.com";
// Configure API key authorization: token
config.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new MenuApi(config);
var storeId = "storeId_example"; // string | [Unique identifier of the store](#section/Getting-started/Unique-identifier-of-the-store)
var contentType = "\"application/json\""; // string | Specify that the content will be sent as JSON (default to "application/json")
var inlineObject = new InlineObject(); // InlineObject | (optional)
try
{
// Upload menu
TransactionId result = apiInstance.UploadMenu(storeId, contentType, inlineObject);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling MenuApi.UploadMenu: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
<a name="documentation-for-api-endpoints"></a>
Documentation for API Endpoints
All URIs are relative to https://stageapi.glovoapp.com
| Class | Method | HTTP request | Description |
|---|---|---|---|
| MenuApi | UploadMenu | POST /webhook/stores/{storeId}/menu | Upload menu |
| MenuApi | ValidateMenu | POST /paris/menu/validate | Validate menu |
| MenuApi | VerifyUploadMenu | GET /webhook/stores/{storeId}/menu/{transactionId} | Verify menu upload |
| MenuItemsApi | BulkUpdateItems | POST /webhook/stores/{storeId}/menu/updates | Bulk update items |
| MenuItemsApi | ModifyAttribute | PATCH /webhook/stores/{storeId}/attributes/{attributeId} | Modify attributes |
| MenuItemsApi | ModifyProduct | PATCH /webhook/stores/{storeId}/products/{productId} | Modify products |
| MenuItemsApi | VerifyBulkUpdateItems | GET /webhook/stores/{storeId}/menu/updates/{transactionId} | Verify bulk update items status |
| OrdersApi | ModifyOrderProducts | POST /webhook/stores/{storeId}/orders/{orderId}/replace_products | Modify order products |
| OrdersApi | UpdateOrderStatus | PUT /webhook/stores/{storeId}/orders/{orderId}/status | Update order status |
| SchedulingApi | ActiveTemporaryClosing | GET /webhook/stores/{storeId}/closing | Active temporary closing |
| SchedulingApi | CloseTemporaly | PUT /webhook/stores/{storeId}/closing | Close temporaly |
| SchedulingApi | RemoveCloseTemporaly | DELETE /webhook/stores/{storeId}/closing | Remove temporary closing |
| SchedulingApi | StoreSchedule | GET /webhook/stores/{storeId}/schedule | Schedule |
<a name="documentation-for-models"></a>
Documentation for Models
- Model.BadRequest
- Model.BulkUpdateItems
- Model.BulkUpdateItemsAttributes
- Model.BulkUpdateItemsProducts
- Model.BulkUpdateItemsStatus
- Model.InlineObject
- Model.InlineObject1
- Model.InlineResponse200
- Model.Menu
- Model.Menu2
- Model.MenuAttributeGroups
- Model.MenuAttributes
- Model.MenuCollections
- Model.MenuProducts
- Model.MenuSections
- Model.MenuSupercollections
- Model.MenuUploadStatus
- Model.MenuValidationResponse
- Model.ModifyAttribute
- Model.ModifyAttributeResult
- Model.ModifyOrder
- Model.ModifyOrderAddedProducts
- Model.ModifyOrderAttributes
- Model.ModifyOrderProduct
- Model.ModifyOrderProductAttributes
- Model.ModifyOrderReplacements
- Model.ModifyProduct
- Model.ModifyProductResult
- Model.Order
- Model.Order2
- Model.OrderAttributes
- Model.OrderCancelled
- Model.OrderCourier
- Model.OrderCustomer
- Model.OrderCustomerInvoicingDetails
- Model.OrderDeliveryAddress
- Model.OrderProducts
- Model.OrderStatus
- Model.StoreSchedule
- Model.StoreScheduleSchedule
- Model.StoreScheduleTimeSlots
- Model.TransactionId
<a name="documentation-for-authorization"></a>
Documentation for Authorization
<a name="token"></a>
token
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 is compatible. netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.0
- JsonSubTypes (>= 1.8.0)
- Newtonsoft.Json (>= 13.0.1)
- Polly (>= 7.2.2)
- RestSharp (>= 106.13.0)
- System.ComponentModel.Annotations (>= 5.0.0)
-
.NETCoreApp 3.1
- JsonSubTypes (>= 1.8.0)
- Newtonsoft.Json (>= 13.0.1)
- Polly (>= 7.2.2)
- RestSharp (>= 106.13.0)
- System.ComponentModel.Annotations (>= 5.0.0)
-
net5.0
- JsonSubTypes (>= 1.8.0)
- Newtonsoft.Json (>= 13.0.1)
- Polly (>= 7.2.2)
- RestSharp (>= 106.13.0)
- System.ComponentModel.Annotations (>= 5.0.0)
-
net6.0
- JsonSubTypes (>= 1.8.0)
- Newtonsoft.Json (>= 13.0.1)
- Polly (>= 7.2.2)
- RestSharp (>= 106.13.0)
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Minor update