A proxy service for PromoStandards SOAP to a REST API
This package is a client to PSRESTful API
This Python package is automatically generated by the Swagger Codegen project:
- API version: 0.0.1
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
Python 2.7 and 3.4+
pip install git+https://github.com/GallardoSolutions/psrestful_python_client.git(you may need to run pip with root permission: sudo pip install git+https://github.com/GallardoSolutions/psrestful_python_client.git)
Then import the package:
import psrestful Install via Setuptools.
python setup.py install --user(or sudo python setup.py install to install the package for all users)
Then import the package:
import psrestfulPlease follow the installation procedure and then run the following:
from __future__ import print_function
from datetime import datetime, timedelta
import os
import psrestful
from psrestful.rest import ApiException
from pprint import pprint
PSRESTFUL_API_KEY = os.environ.get('PSRESTFUL_API_KEY') # YOUR_API_KEY
# Configure API key authorization: APIKeyHeader
configuration = psrestful.Configuration()
configuration.api_key['X-API-Key'] = PSRESTFUL_API_KEY
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'# Configure HTTP basic authorization: HTTPBasic
configuration = psrestful.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure OAuth2 access token for authorization: OAuth2PasswordBearer
configuration = psrestful.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
#
supplier_code = 'Ariel'
api_version = '2.0.0'
product_id = 'ALB-BT24'
body = None
x_forwarded_for = None
x_account_id = None
product_id_type = None
environment = 'PROD'
now = datetime.now()
last_week = now - timedelta(days=7)
# create an instance of the API class
api_instance = psrestful.InventoryApi(psrestful.ApiClient(configuration))
try:
# Get Inventory Levels
api_response = api_instance.get_inventory_by_product_v200(supplier_code, product_id, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling InventoryApi->get_inventory_by_product_v200: %s\n" % e)
# Product Data
api_instance = psrestful.ProductDataApi(psrestful.ApiClient(configuration))
# Get Product Sellable
try:
api_response = api_instance.get_product_sellable_v200(supplier_code, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProductDataApi->get_product_sellable_v200: %s\n" % e)
# Get Product Closeout
try:
api_response = api_instance.get_product_closeout_v200(supplier_code, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProductDataApi->get_product_closeout_v200: %s\n" % e)
# Get Product Modified Since
try:
api_response = api_instance.get_product_date_modified_v200(since=last_week, supplier_code=supplier_code,
async_req=False)
print(api_response)
except ApiException as e:
print("Exception when calling ProductDataApi->get_product_date_modified_v200: %s\n" % e)
# Get Product
try:
api_response = api_instance.get_product_v200(supplier_code, product_id, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProductDataApi->get_product: %s\n" % e)
# Get Media Content
api_instance = psrestful.MediaContentApi(psrestful.ApiClient(configuration))
try:
api_response = api_instance.get_media_content(supplier_code, product_id, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling MediaContentApi->get_media_content: %s\n" % e)
try:
api_response = api_instance.get_media_date_modified(supplier_code, since=last_week, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling MediaContentApi->get_media_date_modified: %s\n" % e)
# PPC
api_instance = psrestful.ProductPriceAndConfigurationApi(psrestful.ApiClient(configuration))
# get available locations
try:
api_response = api_instance.get_available_locations(supplier_code, product_id, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProductPriceAndConfigurationApi->get_available_locations: %s\n" % e)
# get available charges
try:
api_response = api_instance.get_available_charges(supplier_code, product_id, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProductPriceAndConfigurationApi->get_available_charges: %s\n" % e)
# get fob points
try:
api_response = api_instance.get_fob_points(supplier_code, product_id, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProductPriceAndConfigurationApi->get_fob_points: %s\n" % e)
# get decoration colors
try:
api_response = api_instance.get_decoration_colors(location_id=6791, supplier_code=supplier_code,
product_id=product_id, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProductPriceAndConfigurationApi->get_decoration_colors: %s\n" % e)
# get configuration and pricing
try:
api_response = api_instance.get_configuration_and_pricing('USD', 'MO63114', 'Net',
supplier_code, product_id, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProductPriceAndConfigurationApi->get_configuration_and_pricing: %s\n" % e)
# Order Status
api_instance = psrestful.OrderStatusApi(psrestful.ApiClient(configuration))
try:
api_response = api_instance.get_order_status_details_v100(query_type=4, supplier_code=supplier_code,
async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling OrderStatusApi->get_order_status_details_v100: %s\n" % e)
# Invoice
api_instance = psrestful.InvoiceApi(psrestful.ApiClient(configuration))
try:
api_response = api_instance.get_invoices(query_type=4, supplier_code=supplier_code, async_req=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling InvoiceApi->get_invoices: %s\n" % e)All URIs are relative to https://api.psrestful.com/
| Class | Method | HTTP request | Description |
|---|---|---|---|
| InventoryApi | get_filter_values | GET /v{api_version}/suppliers/{supplier_code}/inventory/filter-values/{product_id} | Get Filter Values |
| InventoryApi | get_inventory_by_product_v121 | GET /v1.2.1/suppliers/{supplier_code}/inventory/{product_id} | Get Inventory By Product V121 |
| InventoryApi | get_inventory_by_product_v200 | GET /v2.0.0/suppliers/{supplier_code}/inventory/{product_id} | Get Inventory By Product V200 |
| InvoiceApi | get_invoices | GET /v1.0.0/suppliers/{supplier_code}/invoices/ | Get Invoices |
| InvoiceApi | get_voided_invoices | GET /v1.0.0/suppliers/{supplier_code}/voided-invoices/ | Get Voided Invoices |
| MediaContentApi | get_media_content | GET /v1.1.0/suppliers/{supplier_code}/medias/{product_id} | Get Media Content |
| MediaContentApi | get_media_date_modified | GET /v1.1.0/suppliers/{supplier_code}/media-modified-since/ | Get Media Date Modified |
| OrderShipmentNotificationApi | get_order_shipment_notification_v100 | GET /v1.0.0/suppliers/{supplier_code}/order-shipment-notifications/ | Get Order Shipment Notification V100 |
| OrderShipmentNotificationApi | get_order_shipment_notification_v200 | GET /v2.0.0/suppliers/{supplier_code}/order-shipment-notifications/ | Get Order Shipment Notification V200 |
| OrderStatusApi | get_issue_v200 | GET /v2.0.0/suppliers/{supplier_code}/issues/{issue_id}/ | Get Issue |
| OrderStatusApi | get_order_status_details_v100 | GET /v1.0.0/suppliers/{supplier_code}/order-status-details/ | Get Order Status Details |
| OrderStatusApi | get_order_status_types_v100 | GET /v1.0.0/suppliers/{supplier_code}/order-status-types/ | Get Order Status Types |
| OrderStatusApi | get_order_status_v200 | GET /v2.0.0/suppliers/{supplier_code}/order-status/ | Get Order Status |
| OrderStatusApi | get_service_methods_v200 | GET /v2.0.0/suppliers/{supplier_code}/service-methods/ | Get Service Methods |
| ProductDataApi | get_product_closeout_v100 | GET /v1.0.0/suppliers/{supplier_code}/products-closeout | Get Product Closeout V100 |
| ProductDataApi | get_product_closeout_v200 | GET /v2.0.0/suppliers/{supplier_code}/products-closeout | Get Product Closeout V200 |
| ProductDataApi | get_product_date_modified_v100 | GET /v1.0.0/suppliers/{supplier_code}/products-modified-since | Get Product Date Modified V100 |
| ProductDataApi | get_product_date_modified_v200 | GET /v2.0.0/suppliers/{supplier_code}/products-modified-since | Get Product Date Modified V200 |
| ProductDataApi | get_product_v200 | GET /v2.0.0/suppliers/{supplier_code}/products/{product_id} | Get Product V200 |
| ProductPriceAndConfigurationApi | get_available_charges | GET /v1.0.0/suppliers/{supplier_code}/available-charges/{product_id} | Get Available Charges |
| ProductPriceAndConfigurationApi | get_available_locations | GET /v1.0.0/suppliers/{supplier_code}/available-locations/{product_id} | Get Available Locations |
| ProductPriceAndConfigurationApi | get_configuration_and_pricing | GET /v1.0.0/suppliers/{supplier_code}/pricing-and-configuration/{product_id} | Get Configuration And Pricing |
| ProductPriceAndConfigurationApi | get_decoration_colors | GET /v1.0.0/suppliers/{supplier_code}/decoration-colors/{product_id} | Get Decoration Colors |
| ProductPriceAndConfigurationApi | get_fob_points | GET /v1.0.0/suppliers/{supplier_code}/fob-points/{product_id} | Get Fob Points |
| PurchaseOrderApi | get_supported_order_types | GET /v1.0.0/suppliers/{supplier_code}/supported-order-types/ | Get Supported Order Types |
| PurchaseOrderApi | send_po | POST /v1.0.0/suppliers/{supplier_code}/purchase-orders/ | Send Po |
| DefaultApi | get_service_codes | GET /service-codes | Get Service Codes |
| DefaultApi | get_services | GET /services/{supplier_code} | Get Services |
- AccountInfo
- Address
- ApparelSize
- Artwork
- ArtworkFile
- ArtworkFileArray
- ArtworkType
- AvailableCharge
- AvailableChargeArray
- AvailableChargesResponse
- AvailableLocationArray
- AvailableLocationsResponse
- BodySendPo
- ChargeArrayInput
- ChargeArrayOutput
- ChargeInput
- ChargeOutput
- ChargePrice
- ChargePriceArray
- ChargeTypeInput
- ChargeTypeOutput
- ClassType
- ClassTypeArray
- Color
- ColorArray
- ColorSystem
- ConfigurationAndPricingResponse
- ConfigurationInput
- ConfigurationOutput
- ConfigurationType
- ContactDetailsInput
- ContactDetailsOutput
- ContactInput
- ContactOutput
- ContactTypeInput
- ContactTypeOutput
- CountryIso2
- Currency
- CurrencySupported
- CurrencySupportedArray
- CustomMessage
- DecorationArrayInput
- DecorationColorResponse
- DecorationColors
- DecorationGeometryType
- DecorationInput
- DecorationMethod
- DecorationMethodArray
- DecorationUomType
- DigitalProof
- DigitalProofAddress
- DigitalProofAddressArray
- DigitalProofType
- DimUOM
- Dimension
- DimensionUoMInput
- DimensionUoMOutput
- Dimensions
- Environment
- ErrorMessage
- FilterArray
- FilterArray1
- FilterValuesResponseV200
- Fob
- FobArray
- FobPointsResponse
- FreightDetails
- FutureAvailability
- FutureAvailabilityArray
- GeometryType
- GetInvoiceResponse
- GetIssueResponseV200
- GetMediaDateModifiedResponse
- GetOrderShipmentNotificationResponse
- GetOrderStatusResponseV200
- GetProductSellableResponseV100
- GetProductSellableResponseV200
- GetServiceMethodsResponseV200
- GetSupportedOrderTypesResponse
- GetVoidedResponse
- HTTPValidationError
- Inventory
- InventoryLevelsResponseV121
- InventoryLevelsResponseV200
- InventoryLocation
- InventoryLocationArray
- Invoice
- InvoiceArray
- InvoiceLineItem
- Issue
- IssueArray
- IssueStatus
- Item
- ItemArray
- LabelSize
- LabelSizeArray
- LayerOrStop
- LayerOrStopArray
- Layers
- LineItem
- LineItemArray
- LineType
- LocationArrayInput
- LocationDecoration
- LocationDecorationArray
- LocationId
- LocationIdArray
- LocationInput
- MediaContent
- MediaContentArray
- MediaContentDetailsResponse
- MediaDateModified
- MediaDateModifiedArray
- MediaType
- OrderContactArrayInput
- OrderContactArrayOutput
- OrderShipmentNotification
- OrderShipmentNotificationArray
- OrderStatusDetailsResponse
- OrderStatusTypesResponse
- OrderType
- PO
- Package
- PackageArray
- PartArrayInput
- PartArrayOutput
- PartColorArray
- PartInput
- PartInventory
- PartInventoryArray
- PartOutput
- PartPrice
- PartPriceArray
- PriceType
- PrimaryColor
- Product
- ProductArray
- ProductCategory
- ProductCategoryArray
- ProductCloseOut
- ProductCloseOutArray
- ProductCloseOutResponseV100
- ProductCloseOutResponseV200
- ProductDateModified
- ProductDateModifiedArray
- ProductDateModifiedResponseV100
- ProductDateModifiedResponseV200
- ProductIDType
- ProductKeyword
- ProductKeywordArray
- ProductMarketingPoint
- ProductMarketingPointArray
- ProductPackage
- ProductPackagingArray
- ProductPart
- ProductPartArray
- ProductPrice
- ProductPriceArray
- ProductPriceGroup
- ProductPriceGroupArray
- ProductResponseV100
- ProductResponseV200
- ProductSellable
- ProductSellableArray
- ProductV100
- ProductV200
- ProductVariationInventory
- ProductVariationInventoryArray
- Program
- PsDomainModelInvoiceQueryType
- PsDomainModelMediaContentDecoration
- PsDomainModelMediaContentDecorationArray
- PsDomainModelMediaContentLocation
- PsDomainModelMediaContentLocationArray
- PsDomainModelOrderStatusV100OrderStatus
- PsDomainModelOrderStatusV100OrderStatusArray
- PsDomainModelOrderStatusV100OrderStatusDetail
- PsDomainModelOrderStatusV100OrderStatusDetailArray
- PsDomainModelOrderStatusV100QueryType
- PsDomainModelOrderStatusV200OrderStatus
- PsDomainModelOrderStatusV200OrderStatusArray
- PsDomainModelOrderStatusV200OrderStatusDetail
- PsDomainModelOrderStatusV200OrderStatusDetailArray
- PsDomainModelOsnCommonQueryType
- PsDomainModelPpcDecoration
- PsDomainModelPpcDecorationArray
- PsDomainModelPpcFobPoint
- PsDomainModelPpcFobPointArray
- PsDomainModelPpcLocation
- PsDomainModelPpcLocationArray
- PsDomainModelProductDataCommonFobPoint
- PsDomainModelProductDataCommonFobPointArray
- PsDomainModelProductDataCommonLocation
- QuantityAvailable
- QuantityInput
- QuantityOutput
- QuantityUoM
- RealFilterValues
- ReferenceNuberType
- RelatedProduct
- RelatedProductArray
- ResponseTo
- ResponseToArray
- SalesOrder
- SalesOrderArray
- SalesOrderNumber
- SalesOrderNumbersArray
- SelectionArray
- SendPOResponse
- ServiceMessage
- ServiceMessageArray
- ServiceMethod
- ServiceMethodArray
- Severity
- ShipTo
- Shipment
- ShipmentArray
- ShipmentDestinationType
- ShipmentLink
- ShipmentLinkArray
- ShipmentLocation
- ShipmentLocationArray
- ShippingPackage
- ShippingPackageArray
- Status
- StatusArray
- SupportedOrderType
- Tax
- TaxInformationArray
- TaxTypeInput
- TaxTypeOutput
- TexInformation
- ThirdPartyAccount
- ToleranceDetails
- ToleranceType
- ToleranceUoM
- TransportMechanism
- Typeset
- UOM
- ValidationError
- VoidedInvoice
- VoidedInvoiceArray
- WeightUOM
- WeightUoM
- Type: API key
- API key parameter name: X-API-Key
- Location: HTTP header
- Type: HTTP basic authentication
- Type: OAuth
- Flow: password
- Authorization URL:
- Scopes:
Edilio Gallardo