Skip to content

create_procurement_portal_preference async

create_procurement_portal_preference(
    procurement_portal_name: ProcurementPortalName,
    buyer_domain: BuyerDomain,
    buyer_identifier: BasicStringWithoutSpace,
    supplier_domain: SupplierDomain,
    supplier_identifier: BasicStringWithoutSpace,
    einvoice_delivery_enabled: bool,
    purchase_order_retrieval_enabled: bool,
    contacts: Contacts,
    *,
    config_overrides: Optional[AsyncInvoicingClientConfig] = None,
    selector: Optional[ProcurementPortalPreferenceSelector] = None,
    procurement_portal_shared_secret: Optional[SensitiveBasicStringWithoutSpace] = None,
    procurement_portal_instance_endpoint: Optional[BasicStringWithoutSpace] = None,
    test_env_preference: Optional[TestEnvPreferenceInput] = None,
    einvoice_delivery_preference: Optional[EinvoiceDeliveryPreference] = None,
    marketplace_punch_out_enabled: Optional[bool] = None,
    marketplace_punch_out_preference: Optional[MarketplacePunchOutPreference] = None,
    resource_tags: Optional[ResourceTagList] = None,
    client_token: Optional[BasicStringWithoutSpace] = None,
) -> CreateProcurementPortalPreferenceResponse

This feature API is subject to changing at any time. For more information, see the Amazon Web Services Service Terms (Betas and Previews).

Creates a procurement portal preference configuration for e-invoice delivery and purchase order retrieval. This preference defines how invoices are delivered to a procurement portal and how purchase orders are retrieved.

Parameters:

  • procurement_portal_name (ProcurementPortalName) –

    The name of the procurement portal.

  • buyer_domain (BuyerDomain) –

    The domain identifier for the buyer in the procurement portal.

  • buyer_identifier (BasicStringWithoutSpace) –

    The unique identifier for the buyer in the procurement portal.

  • supplier_domain (SupplierDomain) –

    The domain identifier for the supplier in the procurement portal.

  • supplier_identifier (BasicStringWithoutSpace) –

    The unique identifier for the supplier in the procurement portal.

  • procurement_portal_shared_secret (Optional[SensitiveBasicStringWithoutSpace], default: None ) –

    The shared secret or authentication credential used to establish secure communication with the procurement portal. This value must be encrypted at rest.

  • procurement_portal_instance_endpoint (Optional[BasicStringWithoutSpace], default: None ) –

    The endpoint URL where e-invoices will be delivered to the procurement portal. Must be a valid HTTPS URL.

  • test_env_preference (Optional[TestEnvPreferenceInput], default: None ) –

    Configuration settings for the test environment of the procurement portal. Includes test credentials and endpoints that are used for validation before production deployment.

  • einvoice_delivery_enabled (bool) –

    Indicates whether e-invoice delivery is enabled for this procurement portal preference. Set to true to enable e-invoice delivery, false to disable.

  • einvoice_delivery_preference (Optional[EinvoiceDeliveryPreference], default: None ) –

    Specifies the e-invoice delivery configuration including document types, attachment types, and customization settings for the portal.

  • purchase_order_retrieval_enabled (bool) –

    Indicates whether purchase order retrieval is enabled for this procurement portal preference. Set to true to enable PO retrieval, false to disable.

  • marketplace_punch_out_enabled (Optional[bool], default: None ) –

    Defaults to false if not provided.

  • marketplace_punch_out_preference (Optional[MarketplacePunchOutPreference], default: None ) –

    Required for Coupa when MarketplacePunchOutEnabled is true.

  • contacts (Contacts) –

    List of contact information for portal administrators and technical contacts responsible for the e-invoice integration.

  • resource_tags (Optional[ResourceTagList], default: None ) –

    The tags to apply to this procurement portal preference resource. Each tag consists of a key and an optional value.

  • client_token (Optional[BasicStringWithoutSpace], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure idempotency of the request.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this action.

  • ConflictException –

    The request could not be completed due to a conflict with the current state of the resource. This exception occurs when a concurrent modification is detected during an update operation, or when attempting to create a resource that already exists.

  • InternalServerException –

    The processing request failed because of an unknown error, exception, or failure.

  • ServiceQuotaExceededException –

    The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by an Amazon Web Services service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

CreateProcurementPortalPreference for Coupa

>>> await client.create_procurement_portal_preference(procurement_portal_name='COUPA', buyer_domain='NetworkID', buyer_identifier='BuyerId_1', supplier_domain='NetworkID', supplier_identifier='SupplierId_1', selector={'InvoiceUnitArns': ['arn:aws:invoicing::111111111111:invoice-unit/12345678', 'arn:aws:invoicing::111111111111:invoice-unit/12345679'], 'SellerOfRecords': ['AWS_INC', 'AWS_EUROPE']}, procurement_portal_shared_secret='Coupa_Secret', procurement_portal_instance_endpoint='https://www.placeholder-domain.test', test_env_preference={'BuyerDomain': 'NetworkID', 'BuyerIdentifier': 'BuyerId_1_Test', 'SupplierDomain': 'NetworkID', 'SupplierIdentifier': 'SupplierId_1_Test', 'ProcurementPortalSharedSecret': 'Coupa_Secret_test', 'ProcurementPortalInstanceEndpoint': 'https://www.placeholder-domain.test'}, einvoice_delivery_enabled=True, einvoice_delivery_preference={'EinvoiceDeliveryDocumentTypes': ['AWS_CLOUD_INVOICE'], 'EinvoiceDeliveryAttachmentTypes': ['INVOICE_PDF'], 'Protocol': 'CXML', 'PurchaseOrderDataSources': [{'EinvoiceDeliveryDocumentType': 'AWS_CLOUD_INVOICE', 'PurchaseOrderDataSourceType': 'ASSOCIATED_PURCHASE_ORDER_REQUIRED'}], 'ConnectionTestingMethod': 'PROD_ENV_DOLLAR_TEST', 'EinvoiceDeliveryActivationDate': 1750279280.091}, purchase_order_retrieval_enabled=True, marketplace_punch_out_enabled=True, marketplace_punch_out_preference={'ApprovalRequestRedirectUrl': 'https://www.placeholder-domain.test/approvals'}, contacts=[{'Name': 'John Doe', 'Email': '[email protected]'}], resource_tags=[{'Key': 'testKey', 'Value': 'testValue'}], client_token='e362c68e-4e74-48d7-9228-0bc5aa447b42')
Source code in docs_src/capo_invoicing/_services/async_invoicing.py
async def create_procurement_portal_preference(
    self,
    procurement_portal_name: "capo_invoicing.types.procurement_portal_name.ProcurementPortalName",
    buyer_domain: "capo_invoicing.types.buyer_domain.BuyerDomain",
    buyer_identifier: "capo_invoicing.types.basic_string_without_space.BasicStringWithoutSpace",
    supplier_domain: "capo_invoicing.types.supplier_domain.SupplierDomain",
    supplier_identifier: "capo_invoicing.types.basic_string_without_space.BasicStringWithoutSpace",
    einvoice_delivery_enabled: bool,
    purchase_order_retrieval_enabled: bool,
    contacts: "capo_invoicing.types.contacts.Contacts",
    *,
    config_overrides: Optional[AsyncInvoicingClientConfig] = None,
    selector: Optional[
        "capo_invoicing.types.procurement_portal_preference_selector.ProcurementPortalPreferenceSelector"
    ] = None,
    procurement_portal_shared_secret: Optional[
        "capo_invoicing.types.sensitive_basic_string_without_space.SensitiveBasicStringWithoutSpace"
    ] = None,
    procurement_portal_instance_endpoint: Optional[
        "capo_invoicing.types.basic_string_without_space.BasicStringWithoutSpace"
    ] = None,
    test_env_preference: Optional[
        "capo_invoicing.types.test_env_preference_input.TestEnvPreferenceInput"
    ] = None,
    einvoice_delivery_preference: Optional[
        "capo_invoicing.types.einvoice_delivery_preference.EinvoiceDeliveryPreference"
    ] = None,
    marketplace_punch_out_enabled: Optional[bool] = None,
    marketplace_punch_out_preference: Optional[
        "capo_invoicing.types.marketplace_punch_out_preference.MarketplacePunchOutPreference"
    ] = None,
    resource_tags: Optional[
        "capo_invoicing.types.resource_tag_list.ResourceTagList"
    ] = None,
    client_token: Optional[
        "capo_invoicing.types.basic_string_without_space.BasicStringWithoutSpace"
    ] = None,
) -> "capo_invoicing.types.create_procurement_portal_preference_response.CreateProcurementPortalPreferenceResponse":
    """<p> <i> <b>This feature API is subject to changing at any time. For more information, see the <a href="https://aws.amazon.com/service-terms/">Amazon Web Services Service Terms</a> (Betas and Previews).</b> </i> </p> <p>Creates a procurement portal preference configuration for e-invoice delivery and purchase order retrieval. This preference defines how invoices are delivered to a procurement portal and how purchase orders are retrieved.</p>

    Args:
        procurement_portal_name: <p>The name of the procurement portal.</p>
        buyer_domain: <p>The domain identifier for the buyer in the procurement portal.</p>
        buyer_identifier: <p>The unique identifier for the buyer in the procurement portal. </p>
        supplier_domain: <p>The domain identifier for the supplier in the procurement portal.</p>
        supplier_identifier: <p>The unique identifier for the supplier in the procurement portal.</p>
        procurement_portal_shared_secret: <p>The shared secret or authentication credential used to establish secure communication with the procurement portal. This value must be encrypted at rest.</p>
        procurement_portal_instance_endpoint: <p>The endpoint URL where e-invoices will be delivered to the procurement portal. Must be a valid HTTPS URL.</p>
        test_env_preference: <p>Configuration settings for the test environment of the procurement portal. Includes test credentials and endpoints that are used for validation before production deployment.</p>
        einvoice_delivery_enabled: <p>Indicates whether e-invoice delivery is enabled for this procurement portal preference. Set to true to enable e-invoice delivery, false to disable.</p>
        einvoice_delivery_preference: <p>Specifies the e-invoice delivery configuration including document types, attachment types, and customization settings for the portal.</p>
        purchase_order_retrieval_enabled: <p>Indicates whether purchase order retrieval is enabled for this procurement portal preference. Set to true to enable PO retrieval, false to disable.</p>
        marketplace_punch_out_enabled: Defaults to false if not provided.
        marketplace_punch_out_preference: Required for Coupa when MarketplacePunchOutEnabled is true.
        contacts: <p>List of contact information for portal administrators and technical contacts responsible for the e-invoice integration.</p>
        resource_tags: <p>The tags to apply to this procurement portal preference resource. Each tag consists of a key and an optional value.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure idempotency of the request.</p>

    Raises:
        capo_invoicing.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action.</p>
        capo_invoicing.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource. This exception occurs when a concurrent modification is detected during an update operation, or when attempting to create a resource that already exists.</p>
        capo_invoicing.errors.internal_server_exception.InternalServerException: <p>The processing request failed because of an unknown error, exception, or failure. </p>
        capo_invoicing.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded. </p>
        capo_invoicing.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_invoicing.errors.validation_exception.ValidationException: <p> The input fails to satisfy the constraints specified by an Amazon Web Services service. </p>
        capo_invoicing.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        CreateProcurementPortalPreference for Coupa

        >>> await client.create_procurement_portal_preference(procurement_portal_name='COUPA', buyer_domain='NetworkID', buyer_identifier='BuyerId_1', supplier_domain='NetworkID', supplier_identifier='SupplierId_1', selector={'InvoiceUnitArns': ['arn:aws:invoicing::111111111111:invoice-unit/12345678', 'arn:aws:invoicing::111111111111:invoice-unit/12345679'], 'SellerOfRecords': ['AWS_INC', 'AWS_EUROPE']}, procurement_portal_shared_secret='Coupa_Secret', procurement_portal_instance_endpoint='https://www.placeholder-domain.test', test_env_preference={'BuyerDomain': 'NetworkID', 'BuyerIdentifier': 'BuyerId_1_Test', 'SupplierDomain': 'NetworkID', 'SupplierIdentifier': 'SupplierId_1_Test', 'ProcurementPortalSharedSecret': 'Coupa_Secret_test', 'ProcurementPortalInstanceEndpoint': 'https://www.placeholder-domain.test'}, einvoice_delivery_enabled=True, einvoice_delivery_preference={'EinvoiceDeliveryDocumentTypes': ['AWS_CLOUD_INVOICE'], 'EinvoiceDeliveryAttachmentTypes': ['INVOICE_PDF'], 'Protocol': 'CXML', 'PurchaseOrderDataSources': [{'EinvoiceDeliveryDocumentType': 'AWS_CLOUD_INVOICE', 'PurchaseOrderDataSourceType': 'ASSOCIATED_PURCHASE_ORDER_REQUIRED'}], 'ConnectionTestingMethod': 'PROD_ENV_DOLLAR_TEST', 'EinvoiceDeliveryActivationDate': 1750279280.091}, purchase_order_retrieval_enabled=True, marketplace_punch_out_enabled=True, marketplace_punch_out_preference={'ApprovalRequestRedirectUrl': 'https://www.placeholder-domain.test/approvals'}, contacts=[{'Name': 'John Doe', 'Email': '[email protected]'}], resource_tags=[{'Key': 'testKey', 'Value': 'testValue'}], client_token='e362c68e-4e74-48d7-9228-0bc5aa447b42')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_invoicing.types.create_procurement_portal_preference_request.CreateProcurementPortalPreferenceRequest]",
    ) -> AsyncOperationResponse[
        "capo_invoicing.types.create_procurement_portal_preference_response.CreateProcurementPortalPreferenceResponse"
    ]:
        import capo_invoicing._operations.invoicing.create_procurement_portal_preference

        (
            output,
            http_response,
        ) = await capo_invoicing._operations.invoicing.create_procurement_portal_preference.async_create_procurement_portal_preference(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_invoicing.types.create_procurement_portal_preference_request.CreateProcurementPortalPreferenceRequest",
    ) -> dict[str, Any]:
        import capo_invoicing.types.create_procurement_portal_preference_request

        return capo_invoicing.types.create_procurement_portal_preference_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateProcurementPortalPreference", redact_input=_redact_input
        ),
    )
    input_: capo_invoicing.types.create_procurement_portal_preference_request.CreateProcurementPortalPreferenceRequest = {
        "procurement_portal_name": procurement_portal_name,
        "buyer_domain": buyer_domain,
        "buyer_identifier": buyer_identifier,
        "supplier_domain": supplier_domain,
        "supplier_identifier": supplier_identifier,
        "einvoice_delivery_enabled": einvoice_delivery_enabled,
        "purchase_order_retrieval_enabled": purchase_order_retrieval_enabled,
        "contacts": contacts,
    }
    if selector is not None:
        input_["selector"] = selector
    if procurement_portal_shared_secret is not None:
        input_["procurement_portal_shared_secret"] = (
            procurement_portal_shared_secret
        )
    if procurement_portal_instance_endpoint is not None:
        input_["procurement_portal_instance_endpoint"] = (
            procurement_portal_instance_endpoint
        )
    if test_env_preference is not None:
        input_["test_env_preference"] = test_env_preference
    if einvoice_delivery_preference is not None:
        input_["einvoice_delivery_preference"] = einvoice_delivery_preference
    if marketplace_punch_out_enabled is not None:
        input_["marketplace_punch_out_enabled"] = marketplace_punch_out_enabled
    if marketplace_punch_out_preference is not None:
        input_["marketplace_punch_out_preference"] = (
            marketplace_punch_out_preference
        )
    if resource_tags is not None:
        input_["resource_tags"] = resource_tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output