Skip to content

put_procurement_portal_preference

put_procurement_portal_preference(
    procurement_portal_preference_arn: ProcurementPortalPreferenceArnString,
    einvoice_delivery_enabled: bool,
    purchase_order_retrieval_enabled: bool,
    contacts: Contacts,
    *,
    config_overrides: Optional[InvoicingClientConfig] = 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,
    client_token: Optional[BasicStringWithoutSpace] = None,
) -> PutProcurementPortalPreferenceResponse

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

Updates an existing procurement portal preference configuration. This operation can modify settings for e-invoice delivery and purchase order retrieval.

Parameters:

  • procurement_portal_preference_arn (ProcurementPortalPreferenceArnString) –

    The Amazon Resource Name (ARN) of the procurement portal preference to update.

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

    The updated shared secret or authentication credential for the procurement portal. This value must be encrypted at rest.

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

    The updated 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 ) –

    Updated configuration settings for the test environment of the procurement portal.

  • einvoice_delivery_enabled (bool) –

    Updated flag indicating whether e-invoice delivery is enabled for this procurement portal preference.

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

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

  • purchase_order_retrieval_enabled (bool) –

    Updated flag indicating whether purchase order retrieval is enabled for this procurement portal preference.

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

    Whether Marketplace PunchOut is enabled for this connection. Defaults to false if not provided.

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

    Configuration for Marketplace PunchOut. Required when MarketplacePunchOutEnabled is true.

  • contacts (Contacts) –

    Updated list of contact information for portal administrators and technical contacts.

  • 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.

  • ResourceNotFoundException –

    The resource could not be found.

  • 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:

PutProcurementPortalPreference for Coupa pref

>>> client.put_procurement_portal_preference(procurement_portal_preference_arn='arn:aws:invoicing::111111111111:procurement-portal-preference/f71dd02e-f855-4b13-b793-0fd25c0b3ecd', procurement_portal_shared_secret='Coupa_Secret_2', procurement_portal_instance_endpoint='https://www.placeholder-domain.test', selector={'InvoiceUnitArns': ['arn:aws:invoicing::111111111111:invoice-unit/12345679'], 'SellerOfRecords': ['AWS_INC']}, test_env_preference={'BuyerDomain': 'NetworkID', 'BuyerIdentifier': 'BuyerId_1_Test', 'SupplierDomain': 'NetworkID', 'SupplierIdentifier': 'SupplierId_1_Test', 'ProcurementPortalSharedSecret': 'Coupa_Secret_test_2', '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, contacts=[{'Name': 'John Doe2', 'Email': '[email protected]'}], client_token='e362c68e-4e74-48d7-9228-0bc5aa447b45')
Source code in docs_src/capo_invoicing/_services/invoicing.py
def put_procurement_portal_preference(
    self,
    procurement_portal_preference_arn: "capo_invoicing.types.procurement_portal_preference_arn_string.ProcurementPortalPreferenceArnString",
    einvoice_delivery_enabled: bool,
    purchase_order_retrieval_enabled: bool,
    contacts: "capo_invoicing.types.contacts.Contacts",
    *,
    config_overrides: Optional[InvoicingClientConfig] = 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,
    client_token: Optional[
        "capo_invoicing.types.basic_string_without_space.BasicStringWithoutSpace"
    ] = None,
) -> "capo_invoicing.types.put_procurement_portal_preference_response.PutProcurementPortalPreferenceResponse":
    """<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>Updates an existing procurement portal preference configuration. This operation can modify settings for e-invoice delivery and purchase order retrieval.</p>

    Args:
        procurement_portal_preference_arn: <p>The Amazon Resource Name (ARN) of the procurement portal preference to update.</p>
        procurement_portal_shared_secret: <p>The updated shared secret or authentication credential for the procurement portal. This value must be encrypted at rest.</p>
        procurement_portal_instance_endpoint: <p>The updated endpoint URL where e-invoices will be delivered to the procurement portal. Must be a valid HTTPS URL.</p>
        test_env_preference: <p>Updated configuration settings for the test environment of the procurement portal.</p>
        einvoice_delivery_enabled: <p>Updated flag indicating whether e-invoice delivery is enabled for this procurement portal preference.</p>
        einvoice_delivery_preference: <p>Updated e-invoice delivery configuration including document types, attachment types, and customization settings for the portal.</p>
        purchase_order_retrieval_enabled: <p>Updated flag indicating whether purchase order retrieval is enabled for this procurement portal preference.</p>
        marketplace_punch_out_enabled: Whether Marketplace PunchOut is enabled for this connection. Defaults to false if not provided.
        marketplace_punch_out_preference: Configuration for Marketplace PunchOut. Required when MarketplacePunchOutEnabled is true.
        contacts: <p>Updated list of contact information for portal administrators and technical contacts.</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.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found. </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:
        PutProcurementPortalPreference for Coupa pref

        >>> client.put_procurement_portal_preference(procurement_portal_preference_arn='arn:aws:invoicing::111111111111:procurement-portal-preference/f71dd02e-f855-4b13-b793-0fd25c0b3ecd', procurement_portal_shared_secret='Coupa_Secret_2', procurement_portal_instance_endpoint='https://www.placeholder-domain.test', selector={'InvoiceUnitArns': ['arn:aws:invoicing::111111111111:invoice-unit/12345679'], 'SellerOfRecords': ['AWS_INC']}, test_env_preference={'BuyerDomain': 'NetworkID', 'BuyerIdentifier': 'BuyerId_1_Test', 'SupplierDomain': 'NetworkID', 'SupplierIdentifier': 'SupplierId_1_Test', 'ProcurementPortalSharedSecret': 'Coupa_Secret_test_2', '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, contacts=[{'Name': 'John Doe2', 'Email': '[email protected]'}], client_token='e362c68e-4e74-48d7-9228-0bc5aa447b45')
    """

    def _handler(
        req: "OperationRequest[capo_invoicing.types.put_procurement_portal_preference_request.PutProcurementPortalPreferenceRequest]",
    ) -> OperationResponse[
        "capo_invoicing.types.put_procurement_portal_preference_response.PutProcurementPortalPreferenceResponse"
    ]:
        import capo_invoicing._operations.invoicing.put_procurement_portal_preference

        output, http_response = (
            capo_invoicing._operations.invoicing.put_procurement_portal_preference.put_procurement_portal_preference(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_invoicing.types.put_procurement_portal_preference_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "PutProcurementPortalPreference", redact_input=_redact_input
        ),
    )
    input_: capo_invoicing.types.put_procurement_portal_preference_request.PutProcurementPortalPreferenceRequest = {
        "procurement_portal_preference_arn": procurement_portal_preference_arn,
        "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 client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output