# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).
import oci
from datetime import datetime
# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()
# Initialize service client with default config file
osp_gateway_client = oci.osp_gateway.SubscriptionServiceClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
pay_subscription_response = osp_gateway_client.pay_subscription(
osp_home_region="EXAMPLE-ospHomeRegion-Value",
subscription_id="ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value",
compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
pay_subscription_details=oci.osp_gateway.models.PaySubscriptionDetails(
subscription=oci.osp_gateway.models.Subscription(
subscription_plan_number="EXAMPLE-subscriptionPlanNumber-Value",
id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
plan_type="FREE_TIER",
time_start=datetime.strptime(
"2016-10-31T15:33:11.918Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
ship_to_cust_acct_site_id="ocid1.test.oc1..<unique_ID>EXAMPLE-shipToCustAcctSiteId-Value",
ship_to_cust_acct_role_id="ocid1.test.oc1..<unique_ID>EXAMPLE-shipToCustAcctRoleId-Value",
bill_to_cust_account_id="ocid1.test.oc1..<unique_ID>EXAMPLE-billToCustAccountId-Value",
is_intent_to_pay=True,
currency_code="EXAMPLE-currencyCode-Value",
gsi_org_code="EXAMPLE-gsiOrgCode-Value",
language_code="EXAMPLE-languageCode-Value",
organization_id="ocid1.test.oc1..<unique_ID>EXAMPLE-organizationId-Value",
upgrade_state="PROMO",
upgrade_state_details="TAX_ERROR",
account_type="PERSONAL",
tax_info=oci.osp_gateway.models.TaxInfo(
tax_payer_id="ocid1.test.oc1..<unique_ID>EXAMPLE-taxPayerId-Value",
tax_reg_number="EXAMPLE-taxRegNumber-Value",
no_tax_reason_code="EXAMPLE-noTaxReasonCode-Value",
no_tax_reason_code_details="EXAMPLE-noTaxReasonCodeDetails-Value",
tax_cnpj="EXAMPLE-taxCnpj-Value",
giro="EXAMPLE-giro-Value"),
payment_options=[
oci.osp_gateway.models.CreditCardPaymentOption(
payment_method="CREDIT_CARD",
wallet_instrument_id="ocid1.test.oc1..<unique_ID>EXAMPLE-walletInstrumentId-Value",
wallet_transaction_id="ocid1.test.oc1..<unique_ID>EXAMPLE-walletTransactionId-Value",
credit_card_type="DINER",
last_digits="EXAMPLE-lastDigits-Value",
name_on_card="EXAMPLE-nameOnCard-Value",
time_expiration=datetime.strptime(
"2049-01-23T17:13:57.381Z",
"%Y-%m-%dT%H:%M:%S.%fZ"))],
payment_gateway=oci.osp_gateway.models.PaymentGateway(
merchant_defined_data=oci.osp_gateway.models.MerchantDefinedData(
promo_type="EXAMPLE-promoType-Value",
cloud_account_name="EXAMPLE-cloudAccountName-Value")),
billing_address=oci.osp_gateway.models.Address(
address_key="EXAMPLE-addressKey-Value",
line1="EXAMPLE-line1-Value",
line2="EXAMPLE-line2-Value",
line3="EXAMPLE-line3-Value",
line4="EXAMPLE-line4-Value",
street_name="EXAMPLE-streetName-Value",
street_number="EXAMPLE-streetNumber-Value",
city="EXAMPLE-city-Value",
county="EXAMPLE-county-Value",
country="EXAMPLE-country-Value",
province="EXAMPLE-province-Value",
postal_code="EXAMPLE-postalCode-Value",
state="EXAMPLE-state-Value",
email_address="EXAMPLE-emailAddress-Value",
company_name="EXAMPLE-companyName-Value",
first_name="EXAMPLE-firstName-Value",
middle_name="EXAMPLE-middleName-Value",
last_name="EXAMPLE-lastName-Value",
phone_country_code="EXAMPLE-phoneCountryCode-Value",
phone_number="EXAMPLE-phoneNumber-Value",
job_title="EXAMPLE-jobTitle-Value",
department_name="EXAMPLE-departmentName-Value",
internal_number="EXAMPLE-internalNumber-Value",
contributor_class="EXAMPLE-contributorClass-Value",
state_inscription="EXAMPLE-stateInscription-Value",
municipal_inscription="EXAMPLE-municipalInscription-Value"),
time_plan_upgrade=datetime.strptime(
"2005-08-10T10:07:59.211Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_personal_to_corporate_conv=datetime.strptime(
"2005-12-29T12:28:46.348Z",
"%Y-%m-%dT%H:%M:%S.%fZ")),
language_code="EXAMPLE-languageCode-Value",
email="EXAMPLE-email-Value"),
if_match="EXAMPLE-ifMatch-Value",
opc_retry_token="EXAMPLE-opcRetryToken-Value",
opc_request_id="XD2SSXCQJIX2EZPYVLB8<unique_ID>")
# Get the data from response
print(pay_subscription_response.data)