{"id":27138,"library":"mastercard-merchant-identifier","title":"Mastercard Merchant Identifier","description":"Mastercard Merchant Identifier API Python SDK for retrieving merchant information. Version 2.0.0. Release cadence irregular, tied to API updates.","status":"active","version":"2.0.0","language":"python","source_language":"en","source_url":"https://github.com/Mastercard/mastercard-merchant-identifier-python","tags":["mastercard","api","sdk","merchant","identifier","payment"],"install":[{"cmd":"pip install mastercard-merchant-identifier","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required for core API client and authentication","package":"mastercard-api-common","optional":false},{"reason":"Used for OAuth 1.0a signing","package":"oauthlib","optional":false}],"imports":[{"note":"ApiClient is in mastercard-api-common, not this SDK package.","wrong":"from mastercard_merchant_identifier import ApiClient","symbol":"ApiClient","correct":"from mastercard_api_common import ApiClient"},{"note":"The correct import path includes the rest module.","wrong":"from mastercard_merchant_identifier import MerchantIdentifierApi","symbol":"MerchantIdentifierApi","correct":"from mastercard_merchant_identifier.rest import MerchantIdentifierApi"}],"quickstart":{"code":"import os\nfrom mastercard_api_common import ApiClient\nfrom mastercard_merchant_identifier.rest import MerchantIdentifierApi\n\nconsumer_key = os.environ.get('MASTERCARD_CONSUMER_KEY', '')\nkey_alias = os.environ.get('MASTERCARD_KEY_ALIAS', '')\nsigning_key_path = os.environ.get('MASTERCARD_SIGNING_KEY_PATH', '')\n\napi_client = ApiClient(consumer_key, key_alias, signing_key_path, sandbox=True)\napi = MerchantIdentifierApi(api_client)\nresponse = api.get_merchant_identifiers(merchant_id='123456')\nprint(response)","lang":"python","description":"Quickstart using environment variables for credentials and sandbox."},"warnings":[{"fix":"Update imports to use mastercard_merchant_identifier.rest and mastercard-api-common for ApiClient.","message":"Version 2.0.0 changed import paths and removed the old mastercard_merchant_identifier.client module. Code written for v1.x will not work.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"pip install mastercard-api-common and import ApiClient from mastercard_api_common.","message":"The ApiClient class is not in this package; it's in mastercard-api-common. You must install and import from that separate package.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Inspect response or rely on API reference.","message":"The method 'get_merchant_identifiers' may return a dictionary, not a response object. Check the official docs for exact return type.","severity":"deprecated","affected_versions":"2.0.0"},{"fix":"Set MASTERCARD_CONSUMER_KEY, MASTERCARD_KEY_ALIAS, MASTERCARD_SIGNING_KEY_PATH (or equivalently use PKCS12 keystore).","message":"Environment variables for authentication must be set explicitly; the SDK does not use .env files automatically.","severity":"gotcha","affected_versions":"all"},{"fix":"Use ApiClient(..., sandbox=False) for production.","message":"The Sandbox vs Production environment is controlled by a boolean parameter in ApiClient; make sure to set sandbox=False for production.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use from mastercard_merchant_identifier.rest import MerchantIdentifierApi","cause":"Tried to import from the old module path used in version 1.x.","error":"ModuleNotFoundError: No module named 'mastercard_merchant_identifier.client'"},{"fix":"pip install mastercard-api-common and use from mastercard_api_common import ApiClient","cause":"ApiClient is not part of this SDK; it's in mastercard-api-common.","error":"ImportError: cannot import name 'ApiClient' from 'mastercard_merchant_identifier'"},{"fix":"Verify environment variables MASTERCARD_CONSUMER_KEY, MASTERCARD_KEY_ALIAS, MASTERCARD_SIGNING_KEY_PATH are correct and the signing key file is accessible.","cause":"ApiClient initialization failed due to missing or invalid credentials. Often happens when signing key path or consumer key is not set.","error":"AttributeError: 'NoneType' object has no attribute 'get'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}