Giter VIP home page Giter VIP logo

sdk-python-openapi-based's Introduction

voucherify-client

Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details.

This Python package is automatically generated by the OpenAPI Generator project:

Running local tests with docker

  1. Go in root directory of the SDK.
  2. Copy .env.example to .env and fill in the values.
  3. Run docker build -t python . to build the image.
  4. Run docker run --rm -v $(pwd):/app python to run the tests and delete container immediately after.
  5. Make changes You desire and run again command from step 4. It uses volumes so no need to rebuild the image.

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import voucherify_client

Setuptools

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 voucherify_client

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import time
import voucherify_client
from voucherify_client.rest import ApiException
from pprint import pprint

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

# 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-App-Id
configuration.api_key['X-App-Id'] = os.environ["API_KEY"]

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

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

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


# Enter a context with an instance of the API client
with voucherify_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = voucherify_client.CampaignsApi(api_client)
    campaign_id = 'campaign_id_example' # str | The campaign ID or name of the campaign to which voucher will be added. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value.
    code = 'code_example' # str | A custom **code** that identifies the voucher.
    campaigns_vouchers_create_request_body = {"category_id":"cat_0bb81a481615a37b5e","start_date":"2022-09-24T00:00:00Z","expiration_date":"2022-09-25T23:59:59Z","active":false,"redemption":{"quantity":null},"additional_info":"Voucher added using API","metadata":{"Season":"Fall"}} # CampaignsVouchersCreateRequestBody | Specify the voucher parameters that you would like to overwrite. (optional)

    try:
        # Add Voucher with Specific Code to Campaign
        api_response = api_instance.add_voucher_with_specific_code_to_campaign(campaign_id, code, campaigns_vouchers_create_request_body=campaigns_vouchers_create_request_body)
        print("The response of CampaignsApi->add_voucher_with_specific_code_to_campaign:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CampaignsApi->add_voucher_with_specific_code_to_campaign: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.voucherify.io

Class Method HTTP request Description
CampaignsApi add_voucher_with_specific_code_to_campaign POST /v1/campaigns/{campaignId}/vouchers/{code} Add Voucher with Specific Code to Campaign
CampaignsApi add_vouchers_to_campaign POST /v1/campaigns/{campaignId}/vouchers Add Vouchers to Campaign
CampaignsApi create_campaign POST /v1/campaigns Create Campaign
CampaignsApi delete_campaign DELETE /v1/campaigns/{campaignId} Delete Campaign
CampaignsApi disable_campaign POST /v1/campaigns/{campaignId}/disable Disable Campaign
CampaignsApi enable_campaign POST /v1/campaigns/{campaignId}/enable Enable Campaign
CampaignsApi get_campaign GET /v1/campaigns/{campaignId} Get Campaign
CampaignsApi import_vouchers_to_campaign POST /v1/campaigns/{campaignId}/import Import Vouchers to Campaign
CampaignsApi import_vouchers_to_campaign_using_csv POST /v1/campaigns/{campaignId}/importCSV Import Vouchers to Campaign by CSV
CampaignsApi list_campaigns GET /v1/campaigns List Campaigns
CampaignsApi update_campaign PUT /v1/campaigns/{campaignId} Update Campaign
CategoriesApi create_category POST /v1/categories Create Category
CategoriesApi delete_category DELETE /v1/categories/{categoryId} Delete Category
CategoriesApi get_category GET /v1/categories/{categoryId} Get Category
CategoriesApi list_categories GET /v1/categories List Categories
CategoriesApi update_category PUT /v1/categories/{categoryId} Update Category
CustomersApi create_customer POST /v1/customers Create Customer
CustomersApi customer_permanently_deletion POST /v1/customers/{customerId}/permanent-deletion Delete Customer Permanently
CustomersApi delete_customer DELETE /v1/customers/{customerId} Delete Customer
CustomersApi get_customer GET /v1/customers/{customerId} Get Customer
CustomersApi import_customers_using_csv POST /v1/customers/importCSV Import and Update Customers using CSV
CustomersApi list_customer_activities GET /v1/customers/{customerId}/activities List Customer Activities
CustomersApi list_customer_segments GET /v1/customers/{customerId}/segments List Customer's Segments
CustomersApi list_customers GET /v1/customers List Customers
CustomersApi update_customer PUT /v1/customers/{customerId} Update Customer
CustomersApi update_customers_consents PUT /v1/customers/{customerId}/consents Update Customer's consents
CustomersApi update_customers_consents_client_side PUT /client/v1/customers/{customerId}/consents Update Customer's consents (client-side)
CustomersApi update_customers_in_bulk POST /v1/customers/bulk/async Update Customers in bulk
CustomersApi update_customers_metadata_in_bulk POST /v1/customers/metadata/async Update Customers' Metadata in bulk
EventsApi track_custom_event POST /v1/events Track Custom Event
EventsApi track_custom_event_client_side POST /client/v1/events Track Custom Event (client-side)
ExportsApi create_export POST /v1/exports Create Export
ExportsApi delete_export DELETE /v1/exports/{exportId} Delete Export
ExportsApi download_export GET /v1/exports/{export_Id} Download Export
ExportsApi get_export GET /v1/exports/{exportId} Get Export
ExportsApi list_exports GET /v1/exports List Exports
LoyaltiesApi create_in_bulk_loyalty_tiers POST /v1/loyalties/{campaignId}/tiers Create loyalty tiers
LoyaltiesApi delete_earning_rule DELETE /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} Delete Earning Rule
LoyaltiesApi delete_loyalty_program DELETE /v1/loyalties/{campaignId} Delete Loyalty Campaign
LoyaltiesApi delete_reward_assignment1 DELETE /v1/loyalties/{campaignId}/rewards/{assignmentId} Delete Reward Assignment
LoyaltiesApi disable_earning_rule POST /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable Disable Earning Rule
LoyaltiesApi enable_earning_rule POST /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/enable Enable Earning Rule
LoyaltiesApi export_loyalty_card_transactions POST /v1/loyalties/members/{memberId}/transactions/export Export Loyalty Card Transactions
LoyaltiesApi export_loyalty_card_transactions1 POST /v1/loyalties/{campaignId}/members/{memberId}/transactions/export Export Loyalty Card Transactions
LoyaltiesApi get_earning_rule GET /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} Get Earning Rule
LoyaltiesApi get_loyalty_tier GET /v1/loyalties/{campaignId}/tiers/{loyaltyTierId} Get Loyalty Tier
LoyaltiesApi get_reward_assignment1 GET /v1/loyalties/{campaignId}/reward-assignments/{assignmentId} Get Reward Assignment
LoyaltiesApi get_reward_assignment2 GET /v1/loyalties/{campaignId}/rewards/{assignmentId} Get Reward Assignment
LoyaltiesApi get_reward_details GET /v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward Get Reward Details
LoyaltiesApi list_loyalty_card_transactions GET /v1/loyalties/members/{memberId}/transactions List Loyalty Card Transactions
LoyaltiesApi list_loyalty_card_transactions1 GET /v1/loyalties/{campaignId}/members/{memberId}/transactions List Loyalty Card Transactions
LoyaltiesApi list_loyalty_tier_earning_rules GET /v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/earning-rules List Loyalty Tier Earning Rules
LoyaltiesApi list_loyalty_tier_rewards GET /v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/rewards List Loyalty Tier Rewards
LoyaltiesApi list_loyalty_tiers GET /v1/loyalties/{campaignId}/tiers List Loyalty Tiers
LoyaltiesApi list_member_loyalty_tier GET /v1/loyalties/members/{memberId}/tiers List Member's Loyalty Tiers
LoyaltiesApi list_member_rewards GET /v1/loyalties/members/{memberId}/rewards List Member Rewards
LoyaltiesApi list_points_expiration GET /v1/loyalties/{campaignId}/members/{memberId}/points-expiration Get Points Expiration
LoyaltiesApi redeem_reward POST /v1/loyalties/members/{memberId}/redemption Redeem Reward
LoyaltiesApi redeem_reward1 POST /v1/loyalties/{campaignId}/members/{memberId}/redemption Redeem Reward
LoyaltiesApi transfer_points POST /v1/loyalties/{campaignId}/members/{memberId}/transfers Transfer Loyalty Points
LoyaltiesApi update_loyalty_card_balance POST /v1/loyalties/members/{memberId}/balance Add or Remove Loyalty Card Balance
LoyaltiesApi update_loyalty_card_balance1 POST /v1/loyalties/{campaignId}/members/{memberId}/balance Add or Remove Loyalty Card Balance
OrdersApi create_order POST /v1/orders Create Order
OrdersApi create_order_export POST /v1/orders/export Create Orders Export
OrdersApi get_order GET /v1/orders/{orderId} Get Order
OrdersApi import_orders POST /v1/orders/import Import Orders
OrdersApi list_orders GET /v1/orders List Orders
OrdersApi update_order PUT /v1/orders/{orderId} Update Order
ProductCollectionsApi create_product_collection POST /v1/product-collections Create Product Collection
ProductCollectionsApi delete_product_collection DELETE /v1/product-collections/{productCollectionId} Delete Product Collection
ProductCollectionsApi get_product_collection GET /v1/product-collections/{productCollectionId} Get Product Collection
ProductCollectionsApi list_product_collections GET /v1/product-collections List Product Collections
ProductCollectionsApi list_products_in_collection GET /v1/product-collections/{productCollectionId}/products List Products in Collection
ProductsApi create_product POST /v1/products Create Product
ProductsApi create_sku POST /v1/products/{productId}/skus Create SKU
ProductsApi delete_product DELETE /v1/products/{productId} Delete Product
ProductsApi delete_sku DELETE /v1/products/{productId}/skus/{skuId} Delete SKU
ProductsApi get_product GET /v1/products/{productId} Get Product
ProductsApi get_sku GET /v1/skus/{skuId} Get SKU
ProductsApi import_products_using_csv POST /v1/products/importCSV Import Products using CSV
ProductsApi import_skus_using_csv POST /v1/skus/importCSV Import SKUs using CSV
ProductsApi list_products GET /v1/products List Products
ProductsApi list_skus_in_product GET /v1/products/{productId}/skus List SKUs in Product
ProductsApi update_product PUT /v1/products/{productId} Update Product
ProductsApi update_products_in_bulk POST /v1/products/bulk/async Update Products in bulk
ProductsApi update_products_metadata_in_bulk POST /v1/products/metadata/async Update Products' Metadata in bulk
ProductsApi update_sku PUT /v1/products/{productId}/skus/{skuId} Update SKU
PromotionsApi create_promotion_stack POST /v1/promotions/{campaignId}/stacks Create Promotion Stack
PromotionsApi delete_promotion_stack DELETE /v1/promotions/{campaignId}/stacks/{stackId} Delete Promotion Stack
PromotionsApi delete_promotion_tier DELETE /v1/promotions/tiers/{promotionTierId} Delete Promotion Tier
PromotionsApi disable_promotion_tier POST /v1/promotions/tiers/{promotionTierId}/disable Disable Promotion Tier
PromotionsApi enable_promotion_tier POST /v1/promotions/tiers/{promotionTierId}/enable Enable Promotion Tier
PromotionsApi get_promotion_stack GET /v1/promotions/{campaignId}/stacks/{stackId} Get Promotion Stack
PromotionsApi get_promotion_tier GET /v1/promotions/tiers/{promotionTierId} Get Promotion Tier
PromotionsApi list_all_promotion_stacks GET /v1/promotions/stacks List Promotion Stacks
PromotionsApi list_promotion_stacks_in_campaign GET /v1/promotions/{campaignId}/stacks List Promotion Stacks in Campaign
PromotionsApi list_promotion_tiers_from_campaign GET /v1/promotions/{campaignId}/tiers List Promotion Tiers from Campaign
PromotionsApi update_promotion_stack PUT /v1/promotions/{campaignId}/stacks/{stackId} Update Promotion Stack
PublicationsApi create_publication POST /v1/publications Create Publication
PublicationsApi create_publication1 GET /v1/publications/create Create Publication
PublicationsApi list_publications GET /v1/publications List Publications
QualificationsApi check_eligibility POST /v1/qualifications Check Eligibility
QualificationsApi check_eligibility_client_side POST /client/v1/qualifications Check Eligibility (client-side)
RedemptionsApi get_redemption GET /v1/redemptions/{redemptionId} Get Redemption
RedemptionsApi get_voucher_redemptions GET /v1/vouchers/{code}/redemption Get Voucher's Redemptions
RedemptionsApi list_redemptions GET /v1/redemptions List Redemptions
RedemptionsApi rollback_redemption POST /v1/redemptions/{redemptionId}/rollback Rollback Redemption
RewardsApi create_reward_assignment POST /v1/rewards/{rewardId}/assignments Create Reward Assignment
RewardsApi delete_reward DELETE /v1/rewards/{rewardId} Delete Reward
RewardsApi delete_reward_assignment DELETE /v1/rewards/{rewardId}/assignments/{assignmentId} Delete Reward Assignment
RewardsApi get_reward_assignment GET /v1/rewards/{rewardId}/assignments/{assignmentId} Get Reward Assignment
RewardsApi list_reward_assignments GET /v1/rewards/{rewardId}/assignments List Reward Assignments
RewardsApi update_reward_assignment PUT /v1/rewards/{rewardId}/assignments/{assignmentId} Update Reward Assignment
SegmentsApi delete_segment DELETE /v1/segments/{segmentId} Delete Segment
StackableDiscountsApi redeem_stacked_discounts POST /v1/redemptions Redeem Stackable Discounts
StackableDiscountsApi redeem_stacked_discounts_client_side POST /client/v1/redemptions Redeem Stackable Discounts (client-side)
StackableDiscountsApi rollback_stacked_redemptions POST /v1/redemptions/{parentRedemptionId}/rollbacks Rollback Stackable Redemptions
StackableDiscountsApi validate_stacked_discounts POST /v1/validations Validate Stackable Discounts
StackableDiscountsApi validate_stacked_discounts_client_side POST /client/v1/validations Validate Stackable Discounts (client-side)
ValidationRulesApi create_validation_rules POST /v1/validation-rules Create Validation Rules
ValidationRulesApi delete_validation_rule_assignment DELETE /v1/validation-rules/{validationRuleId}/assignments/{assignmentId} Delete Validation Rule Assignment
ValidationRulesApi delete_validation_rules DELETE /v1/validation-rules/{validationRuleId} Delete Validation Rule
ValidationRulesApi get_validation_rule GET /v1/validation-rules/{validationRuleId} Get Validation Rule
ValidationRulesApi list_validation_rule_assignments GET /v1/validation-rules/{validationRuleId}/assignments List Validation Rule Assignments
ValidationRulesApi list_validation_rules GET /v1/validation-rules List Validation Rules
ValidationRulesApi list_validation_rules_assignments GET /v1/validation-rules-assignments List Validation Rules' Assignment(s)
ValidationRulesApi update_validation_rule PUT /v1/validation-rules/{validationRuleId} Update Validation Rule
VouchersApi delete_voucher DELETE /v1/vouchers/{code} Delete Voucher
VouchersApi disable_voucher POST /v1/vouchers/{code}/disable Disable Voucher
VouchersApi enable_voucher POST /v1/vouchers/{code}/enable Enable Voucher
VouchersApi export_voucher_transactions POST /v1/vouchers/{code}/transactions/export Export Voucher Transactions
VouchersApi get_voucher GET /v1/vouchers/{code} Get Voucher
VouchersApi import_vouchers_using_csv POST /v1/vouchers/importCSV Import Vouchers using CSV
VouchersApi list_voucher_transactions GET /v1/vouchers/{code}/transactions List Voucher Transactions
VouchersApi release_validation_session DELETE /v1/vouchers/{code}/sessions/{sessionKey} Release Validation Session
VouchersApi update_voucher_balance POST /v1/vouchers/{code}/balance Add or Remove Voucher Balance

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

X-App-Id

  • Type: API key
  • API key parameter name: X-App-Id
  • Location: HTTP header

X-App-Token

  • Type: API key
  • API key parameter name: X-App-Token
  • Location: HTTP header

X-Client-Token

  • Type: API key
  • API key parameter name: X-Client-Token
  • Location: HTTP header

X-Client-Application-Id

  • Type: API key
  • API key parameter name: X-Client-Application-Id
  • Location: HTTP header

Author

[email protected]

sdk-python-openapi-based's People

Contributors

jkaliszuk avatar p-zielinski avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.