Skip to content

Latest commit

 

History

History
416 lines (302 loc) · 17.1 KB

MerchantsItemsApi.md

File metadata and controls

416 lines (302 loc) · 17.1 KB

sparkfly_client.MerchantsItemsApi

All URIs are relative to https://api.sparkfly.com

Method HTTP request Description
create_merchant_item POST /v1.0/merchants/{merchant_id}/items Create an item for merchant
delete_merchant_item DELETE /v1.0/merchants/{merchant_id}/items/{item_id} Delete item by ID for merchant
get_merchant_item GET /v1.0/merchants/{merchant_id}/items/{item_id} Get item by ID for merchant
get_merchant_items GET /v1.0/merchants/{merchant_id}/items Get all items for merchant
update_merchant_item PUT /v1.0/merchants/{merchant_id}/items/{item_id} Update item by ID for merchant

create_merchant_item

ItemResponse create_merchant_item(merchant_id, item_input_request=item_input_request)

Create an item for merchant

Example

  • Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
from sparkfly_client.models.item_input_request import ItemInputRequest
from sparkfly_client.models.item_response import ItemResponse
from sparkfly_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.sparkfly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = sparkfly_client.Configuration(
    host = "https://api.sparkfly.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: X-Auth-Token
configuration.api_key['X-Auth-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with sparkfly_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sparkfly_client.MerchantsItemsApi(api_client)
    merchant_id = 56 # int | The id of the merchant
    item_input_request = sparkfly_client.ItemInputRequest() # ItemInputRequest | Item to add (optional)

    try:
        # Create an item for merchant
        api_response = api_instance.create_merchant_item(merchant_id, item_input_request=item_input_request)
        print("The response of MerchantsItemsApi->create_merchant_item:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MerchantsItemsApi->create_merchant_item: %s\n" % e)

Parameters

Name Type Description Notes
merchant_id int The id of the merchant
item_input_request ItemInputRequest Item to add [optional]

Return type

ItemResponse

Authorization

X-Auth-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Item successfully created * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Etag -
* Location -
* Server -
* Set-Cookie -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -
400 Error parsing request * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Server -
* Set-Cookie -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -
401 Unauthorized * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Server -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_merchant_item

delete_merchant_item(merchant_id, item_id)

Delete item by ID for merchant

Example

  • Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
from sparkfly_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.sparkfly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = sparkfly_client.Configuration(
    host = "https://api.sparkfly.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: X-Auth-Token
configuration.api_key['X-Auth-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with sparkfly_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sparkfly_client.MerchantsItemsApi(api_client)
    merchant_id = 56 # int | The id of the merchant
    item_id = 56 # int | The id of the item

    try:
        # Delete item by ID for merchant
        api_instance.delete_merchant_item(merchant_id, item_id)
    except Exception as e:
        print("Exception when calling MerchantsItemsApi->delete_merchant_item: %s\n" % e)

Parameters

Name Type Description Notes
merchant_id int The id of the merchant
item_id int The id of the item

Return type

void (empty response body)

Authorization

X-Auth-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Successful deletion * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Etag -
* Server -
* Set-Cookie -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -
401 Unauthorized * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Server -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -
404 Item was not found by id * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Server -
* Set-Cookie -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_merchant_item

ItemResponse get_merchant_item(merchant_id, item_id)

Get item by ID for merchant

Example

  • Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
from sparkfly_client.models.item_response import ItemResponse
from sparkfly_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.sparkfly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = sparkfly_client.Configuration(
    host = "https://api.sparkfly.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: X-Auth-Token
configuration.api_key['X-Auth-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with sparkfly_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sparkfly_client.MerchantsItemsApi(api_client)
    merchant_id = 56 # int | The id of the merchant
    item_id = 56 # int | The id of the item

    try:
        # Get item by ID for merchant
        api_response = api_instance.get_merchant_item(merchant_id, item_id)
        print("The response of MerchantsItemsApi->get_merchant_item:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MerchantsItemsApi->get_merchant_item: %s\n" % e)

Parameters

Name Type Description Notes
merchant_id int The id of the merchant
item_id int The id of the item

Return type

ItemResponse

Authorization

X-Auth-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Item to be returned * Cache-Control -
* Content-Length -
* Date -
* Etag -
* Server -
* Set-Cookie -
* X-Auth-Token -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -
401 Unauthorized * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Server -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -
404 Event was not found by id * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Server -
* Set-Cookie -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_merchant_items

ItemListResponse get_merchant_items(merchant_id, name=name, code=code)

Get all items for merchant

Example

  • Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
from sparkfly_client.models.item_list_response import ItemListResponse
from sparkfly_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.sparkfly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = sparkfly_client.Configuration(
    host = "https://api.sparkfly.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: X-Auth-Token
configuration.api_key['X-Auth-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with sparkfly_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sparkfly_client.MerchantsItemsApi(api_client)
    merchant_id = 56 # int | The id of the merchant
    name = 'name_example' # str | The item name to search by (optional)
    code = 'code_example' # str | The code to search by (optional)

    try:
        # Get all items for merchant
        api_response = api_instance.get_merchant_items(merchant_id, name=name, code=code)
        print("The response of MerchantsItemsApi->get_merchant_items:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MerchantsItemsApi->get_merchant_items: %s\n" % e)

Parameters

Name Type Description Notes
merchant_id int The id of the merchant
name str The item name to search by [optional]
code str The code to search by [optional]

Return type

ItemListResponse

Authorization

X-Auth-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 successful retrieval of items * Cache-Control -
* Content-Length -
* Date -
* Etag -
* Server -
* Set-Cookie -
* X-Auth-Token -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -
401 Unauthorized * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Server -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_merchant_item

ItemResponse update_merchant_item(merchant_id, item_id, item_input_request=item_input_request)

Update item by ID for merchant

Example

  • Api Key Authentication (X-Auth-Token):
import time
import os
import sparkfly_client
from sparkfly_client.models.item_input_request import ItemInputRequest
from sparkfly_client.models.item_response import ItemResponse
from sparkfly_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.sparkfly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = sparkfly_client.Configuration(
    host = "https://api.sparkfly.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: X-Auth-Token
configuration.api_key['X-Auth-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with sparkfly_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sparkfly_client.MerchantsItemsApi(api_client)
    merchant_id = 56 # int | The id of the merchant
    item_id = 56 # int | The id of the item
    item_input_request = sparkfly_client.ItemInputRequest() # ItemInputRequest | Fields of item to update in system (optional)

    try:
        # Update item by ID for merchant
        api_response = api_instance.update_merchant_item(merchant_id, item_id, item_input_request=item_input_request)
        print("The response of MerchantsItemsApi->update_merchant_item:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MerchantsItemsApi->update_merchant_item: %s\n" % e)

Parameters

Name Type Description Notes
merchant_id int The id of the merchant
item_id int The id of the item
item_input_request ItemInputRequest Fields of item to update in system [optional]

Return type

ItemResponse

Authorization

X-Auth-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successfully updated item * Cache-Control -
* Content-Length -
* Date -
* Etag -
* Server -
* Set-Cookie -
* X-Auth-Token -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -
400 Error parsing request * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Server -
* Set-Cookie -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -
401 Unauthorized * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Server -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -
404 Event was not found by id * Cache-Control -
* Content-Length -
* Content-Type -
* Date -
* Server -
* Set-Cookie -
* X-Request-Id -
* X-Runtime -
* X-Ua-Compatible -

[Back to top] [Back to API list] [Back to Model list] [Back to README]