{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-billing-and-cost-management/json-schema/amazon-billing-and-cost-management-put-procurement-portal-preference-request-schema.json",
  "title": "PutProcurementPortalPreferenceRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-billing-and-cost-management-procurement-portal-preference-api-openapi.yml#/components/schemas/PutProcurementPortalPreferenceRequest",
  "type": "object",
  "properties": {
    "ProcurementPortalPreferenceArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the procurement portal preference to update."
    },
    "Selector": {
      "$ref": "#/$defs/ProcurementPortalPreferenceSelector"
    },
    "ProcurementPortalSharedSecret": {
      "type": "string",
      "description": "The updated shared secret or authentication credential for the procurement portal. This value must be encrypted at rest."
    },
    "ProcurementPortalInstanceEndpoint": {
      "type": "string",
      "description": "The updated endpoint URL where e-invoices will be delivered to the procurement portal. Must be a valid HTTPS URL."
    },
    "TestEnvPreference": {
      "$ref": "#/$defs/TestEnvPreferenceInput"
    },
    "EinvoiceDeliveryEnabled": {
      "type": "boolean",
      "description": "Updated flag indicating whether e-invoice delivery is enabled for this procurement portal preference."
    },
    "EinvoiceDeliveryPreference": {
      "$ref": "#/$defs/EinvoiceDeliveryPreference"
    },
    "PurchaseOrderRetrievalEnabled": {
      "type": "boolean",
      "description": "Updated flag indicating whether purchase order retrieval is enabled for this procurement portal preference."
    },
    "MarketplacePunchOutEnabled": {
      "type": "boolean",
      "description": "Whether Marketplace PunchOut is enabled for this connection. Defaults to false if not provided."
    },
    "MarketplacePunchOutPreference": {
      "$ref": "#/$defs/MarketplacePunchOutPreference"
    },
    "Contacts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Contact"
      },
      "description": "Updated list of contact information for portal administrators and technical contacts."
    },
    "ClientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier that you provide to ensure idempotency of the request."
    }
  },
  "required": [
    "ProcurementPortalPreferenceArn",
    "EinvoiceDeliveryEnabled",
    "PurchaseOrderRetrievalEnabled",
    "Contacts"
  ],
  "$defs": {
    "Contact": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name of the contact person or role."
        },
        "Email": {
          "type": "string",
          "description": "The email address of the contact person or role."
        }
      }
    },
    "EinvoiceDeliveryPreference": {
      "type": "object",
      "properties": {
        "EinvoiceDeliveryDocumentTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "AWS_CLOUD_INVOICE",
              "AWS_CLOUD_CREDIT_MEMO",
              "AWS_MARKETPLACE_INVOICE",
              "AWS_MARKETPLACE_CREDIT_MEMO",
              "AWS_REQUEST_FOR_PAYMENT"
            ]
          },
          "description": "The types of e-invoice documents to be delivered."
        },
        "EinvoiceDeliveryAttachmentTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "INVOICE_PDF",
              "RFP_PDF"
            ]
          },
          "description": "The types of attachments to include with the e-invoice delivery."
        },
        "Protocol": {
          "type": "string",
          "enum": [
            "CXML"
          ],
          "description": "The communication protocol to use for e-invoice delivery."
        },
        "PurchaseOrderDataSources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PurchaseOrderDataSource"
          },
          "description": "The sources of purchase order data to use for e-invoice generation and delivery."
        },
        "ConnectionTestingMethod": {
          "type": "string",
          "enum": [
            "PROD_ENV_DOLLAR_TEST",
            "TEST_ENV_REPLAY_TEST"
          ],
          "description": "The method to use for testing the connection to the procurement portal."
        },
        "EinvoiceDeliveryActivationDate": {
          "type": "string",
          "description": "The date when e-invoice delivery should be activated for this preference."
        }
      },
      "required": [
        "EinvoiceDeliveryDocumentTypes",
        "Protocol",
        "PurchaseOrderDataSources",
        "ConnectionTestingMethod",
        "EinvoiceDeliveryActivationDate"
      ]
    },
    "MarketplacePunchOutPreference": {
      "type": "object",
      "properties": {
        "ApprovalRequestRedirectUrl": {
          "type": "string",
          "description": "The URL that buyers are redirected to for approval requests in the procurement portal. This is only supported for Coupa. When provided together with the procurement portal instance endpoint, its host must match the host of that endpoint."
        }
      }
    },
    "ProcurementPortalPreferenceSelector": {
      "type": "object",
      "properties": {
        "InvoiceUnitArns": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The Amazon Resource Name (ARN) of invoice unit identifiers to which this preference applies."
        },
        "SellerOfRecords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of seller of record IDs to which this preference applies."
        }
      }
    },
    "PurchaseOrderDataSource": {
      "type": "object",
      "properties": {
        "EinvoiceDeliveryDocumentType": {
          "type": "string",
          "enum": [
            "AWS_CLOUD_INVOICE",
            "AWS_CLOUD_CREDIT_MEMO",
            "AWS_MARKETPLACE_INVOICE",
            "AWS_MARKETPLACE_CREDIT_MEMO",
            "AWS_REQUEST_FOR_PAYMENT"
          ],
          "description": "The type of e-invoice document that requires purchase order data."
        },
        "PurchaseOrderDataSourceType": {
          "type": "string",
          "enum": [
            "ASSOCIATED_PURCHASE_ORDER_REQUIRED",
            "PURCHASE_ORDER_NOT_REQUIRED"
          ],
          "description": "The type of source for purchase order data."
        }
      }
    },
    "TestEnvPreferenceInput": {
      "type": "object",
      "properties": {
        "BuyerDomain": {
          "type": "string",
          "enum": [
            "NetworkID"
          ],
          "description": "The domain identifier to use for the buyer in the test environment."
        },
        "BuyerIdentifier": {
          "type": "string",
          "description": "The unique identifier to use for the buyer in the test environment."
        },
        "SupplierDomain": {
          "type": "string",
          "enum": [
            "NetworkID"
          ],
          "description": "The domain identifier to use for the supplier in the test environment."
        },
        "SupplierIdentifier": {
          "type": "string",
          "description": "The unique identifier to use for the supplier in the test environment."
        },
        "ProcurementPortalSharedSecret": {
          "type": "string",
          "description": "The shared secret or authentication credential to use for secure communication in the test environment."
        },
        "ProcurementPortalInstanceEndpoint": {
          "type": "string",
          "description": "The endpoint URL where e-invoices will be delivered in the test environment."
        }
      },
      "required": [
        "BuyerDomain",
        "BuyerIdentifier",
        "SupplierDomain",
        "SupplierIdentifier"
      ]
    }
  }
}