All URIs are relative to http://petstore.swagger.io:80/v2
Method | HTTP request | Description |
---|---|---|
DeleteOrder | DELETE /store/order/{order_id} | Delete purchase order by ID |
GetInventory | GET /store/inventory | Returns pet inventories by status |
GetOrderById | GET /store/order/{order_id} | Find purchase order by ID |
PlaceOrder | POST /store/order | Place an order for a pet |
void DeleteOrder (string orderId)
Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class DeleteOrderExample
{
public void main()
{
var apiInstance = new StoreApi();
var orderId = orderId_example; // string | ID of the order that needs to be deleted
try
{
// Delete purchase order by ID
apiInstance.DeleteOrder(orderId);
}
catch (Exception e)
{
Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
orderId | string | ID of the order that needs to be deleted |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Dictionary<string, int?> GetInventory ()
Returns pet inventories by status
Returns a map of status codes to quantities
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class GetInventoryExample
{
public void main()
{
// Configure API key authorization: api_key
Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("api_key", "Bearer");
var apiInstance = new StoreApi();
try
{
// Returns pet inventories by status
Dictionary<string, int?> result = apiInstance.GetInventory();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message );
}
}
}
}
This endpoint does not need any parameter.
Dictionary<string, int?>
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Order GetOrderById (long? orderId)
Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class GetOrderByIdExample
{
public void main()
{
var apiInstance = new StoreApi();
var orderId = 789; // long? | ID of pet that needs to be fetched
try
{
// Find purchase order by ID
Order result = apiInstance.GetOrderById(orderId);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
orderId | long? | ID of pet that needs to be fetched |
No authorization required
- Content-Type: Not defined
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Order PlaceOrder (Order body)
Place an order for a pet
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class PlaceOrderExample
{
public void main()
{
var apiInstance = new StoreApi();
var body = new Order(); // Order | order placed for purchasing the pet
try
{
// Place an order for a pet
Order result = apiInstance.PlaceOrder(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
body | Order | order placed for purchasing the pet |
No authorization required
- Content-Type: Not defined
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]