All URIs are relative to https://api.facestore.local/v1
Method | HTTP request | Description |
---|---|---|
add_product | POST /products | |
delete_product_by_id | DELETE /products/{id}/ | |
get_product_by_id | GET /products/{id}/ | |
get_products | GET /products | |
update_product_by_id | PUT /products/{id}/ | |
update_product_by_id_0 | PATCH /products/{id}/ |
InlineResponse2014 add_product(product)
Creates a new product in the store.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['APIToken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIToken'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.ProductsApi(swagger_client.ApiClient(configuration))
product = swagger_client.Product() # Product | Product to add to the store
try:
api_response = api_instance.add_product(product)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProductsApi->add_product: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
product | Product | Product to add to the store |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_product_by_id(id)
deletes a single product based on the ID supplied
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['APIToken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIToken'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.ProductsApi(swagger_client.ApiClient(configuration))
id = 789 # int | ID of product to delete
try:
api_instance.delete_product_by_id(id)
except ApiException as e:
print("Exception when calling ProductsApi->delete_product_by_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID of product to delete |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse2014 get_product_by_id(id, includes=includes, limit=limit)
Returns a product based on a single ID ### Includes You can give the following values on includes parameter: brands, categories, routes, stocks
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['APIToken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIToken'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.ProductsApi(swagger_client.ApiClient(configuration))
id = 789 # int | ID of product to fetch
includes = ['includes_example'] # list[str] | Include associated objects within response (optional)
limit = 56 # int | max records to return (optional)
try:
api_response = api_instance.get_product_by_id(id, includes=includes, limit=limit)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProductsApi->get_product_by_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID of product to fetch | |
includes | list[str] | Include associated objects within response | [optional] |
limit | int | max records to return | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse2006 get_products(includes=includes, limit=limit, order_by=order_by)
Returns all products from the system that the user has access to ### Includes You can give the following values on includes parameter: brands, categories, routes, stocks
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['APIToken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIToken'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.ProductsApi(swagger_client.ApiClient(configuration))
includes = ['includes_example'] # list[str] | Include associated objects within response (optional)
limit = 56 # int | max records to return (optional)
order_by = ['order_by_example'] # list[str] | Specify the field to be sorted, examples: - `?order_by=id|desc` - `?order_by=updated_at|desc,position|asc` (optional)
try:
api_response = api_instance.get_products(includes=includes, limit=limit, order_by=order_by)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProductsApi->get_products: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
includes | list[str] | Include associated objects within response | [optional] |
limit | int | max records to return | [optional] |
order_by | list[str] | Specify the field to be sorted, examples: - `?order_by=id | desc` - `?order_by=updated_at |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_product_by_id(id, tax)
update a single product based on the ID supplied
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['APIToken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIToken'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.ProductsApi(swagger_client.ApiClient(configuration))
id = 789 # int | ID of product to update
tax = swagger_client.Product() # Product | Product to add to the store
try:
api_instance.update_product_by_id(id, tax)
except ApiException as e:
print("Exception when calling ProductsApi->update_product_by_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID of product to update | |
tax | Product | Product to add to the store |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_product_by_id_0(id, tax)
update a single product based on the ID supplied
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['APIToken'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIToken'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.ProductsApi(swagger_client.ApiClient(configuration))
id = 789 # int | ID of product to update
tax = swagger_client.Product() # Product | Product to add to the store
try:
api_instance.update_product_by_id_0(id, tax)
except ApiException as e:
print("Exception when calling ProductsApi->update_product_by_id_0: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID of product to update | |
tax | Product | Product to add to the store |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]