# 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).
from datetime import datetime
import oci
# 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
marketplace_publisher_client = oci.marketplace_publisher.OfferClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
create_offer_response = marketplace_publisher_client.create_offer(
create_offer_details=oci.marketplace_publisher.models.CreateOfferDetails(
display_name="EXAMPLE-displayName-Value",
seller_compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sellerCompartmentId-Value",
buyer_compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-buyerCompartmentId-Value",
description="EXAMPLE-description-Value",
internal_notes="EXAMPLE-internalNotes-Value",
time_start_date=datetime.strptime(
"2002-04-22T10:36:17.156Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
duration="EXAMPLE-duration-Value",
time_accept_by=datetime.strptime(
"2019-06-08T03:17:38.624Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
pricing=oci.marketplace_publisher.models.Pricing(
currency_type="qtI",
total_amount=792,
billing_cycle="ONE_TIME"),
buyer_information=oci.marketplace_publisher.models.BuyerInformation(
company_name="EXAMPLE-companyName-Value",
note_to_buyer="EXAMPLE-noteToBuyer-Value",
primary_contact=oci.marketplace_publisher.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value"),
additional_contacts=[
oci.marketplace_publisher.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value")]),
seller_information=oci.marketplace_publisher.models.SellerInformation(
primary_contact=oci.marketplace_publisher.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value"),
additional_contacts=[
oci.marketplace_publisher.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value")]),
resource_bundles=[
oci.marketplace_publisher.models.ResourceBundle(
type="LISTING",
quantity=358,
unit_of_measurement="OCPU_PER_HOUR",
resource_ids=["EXAMPLE--Value"])],
custom_fields=[
oci.marketplace_publisher.models.CustomField(
key="EXAMPLE-key-Value",
value="EXAMPLE-value-Value")],
freeform_tags={
'EXAMPLE_KEY_5JkAf': 'EXAMPLE_VALUE_bbpUtTxucIPCtSwB7abF'},
defined_tags={
'EXAMPLE_KEY_PFOYd': {
'EXAMPLE_KEY_yRZku': 'EXAMPLE--Value'}}),
opc_retry_token="EXAMPLE-opcRetryToken-Value",
opc_request_id="ROKVLQ6QIDRFV4KKYV1S<unique_ID>")
# Get the data from response
print(create_offer_response.data)