Skip to content

create_app_payment_registration async

create_app_payment_registration(
    app_id: AppId,
    return_url: Url,
    refresh_url: Url,
    scope: RequestScope,
    *,
    config_overrides: Optional[AsyncAppMonetizationClientConfig] = None,
    legal_name: Optional[LegalName] = None,
    developer_address: Optional[DeveloperAddress] = None,
    tax_registration_number: Optional[TaxRegistrationNumber] = None,
    business_type: Optional[BusinessType] = None,
    email: Optional[Email] = None,
    support_email: Optional[Email] = None,
    display_name: Optional[SellerDisplayName] = None,
    support_phone: Optional[SupportPhone] = None,
    invoice_logo: Optional[InvoiceLogo] = None,
    tax_registrations: Optional[TaxRegistrationList] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateAppPaymentRegistrationResponse

Creates a hosted URL that an app owner uses to register payment and tax details.

Parameters:

  • app_id (AppId) –

    The ID of the app being registered for payment.

  • legal_name (Optional[LegalName], default: None ) –

    Your registered legal name.

  • developer_address (Optional[DeveloperAddress], default: None ) –

    Your business address.

  • tax_registration_number (Optional[TaxRegistrationNumber], default: None ) –

    Your tax registration number (for example, VAT, GST, or EIN).

  • business_type (Optional[BusinessType], default: None ) –

    Whether the seller is an individual or a registered business.

  • email (Optional[Email], default: None ) –

    Your primary contact email for this registration, distinct from supportEmail (the address shown to customers). If you omit it, AWS App Monetization uses supportEmail.

  • support_email (Optional[Email], default: None ) –

    Your support email address, displayed in the invoice footer.

  • display_name (Optional[SellerDisplayName], default: None ) –

    Customer-facing name (doing-business-as) shown to buyers on invoices, distinct from legalName.

  • support_phone (Optional[SupportPhone], default: None ) –

    Customer-facing support phone number shown to buyers on invoices.

  • invoice_logo (Optional[InvoiceLogo], default: None ) –

    Logo printed on the seller's invoices: raw PNG or JPEG bytes, up to 100 KiB. The image type is detected from the bytes. Write-only: the logo is not returned by GetAppPaymentRegistration.

  • tax_registrations (Optional[TaxRegistrationList], default: None ) –

    The jurisdictions where the seller is registered to collect tax.

  • return_url (Url) –

    The URL the seller's browser is redirected to after completing hosted registration.

  • refresh_url (Url) –

    The URL the seller's browser is redirected to if the hosted registration session expires.

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

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time.

  • scope (RequestScope) –

    Required. The environment: live or sandbox.

Raises:

Source code in docs_src/capo_appmonetization/_services/async_app_monetization.py
async def create_app_payment_registration(
    self,
    app_id: "capo_appmonetization.types.app_id.AppId",
    return_url: "capo_appmonetization.types.url.Url",
    refresh_url: "capo_appmonetization.types.url.Url",
    scope: "capo_appmonetization.types.request_scope.RequestScope",
    *,
    config_overrides: Optional[AsyncAppMonetizationClientConfig] = None,
    legal_name: Optional["capo_appmonetization.types.legal_name.LegalName"] = None,
    developer_address: Optional[
        "capo_appmonetization.types.developer_address.DeveloperAddress"
    ] = None,
    tax_registration_number: Optional[
        "capo_appmonetization.types.tax_registration_number.TaxRegistrationNumber"
    ] = None,
    business_type: Optional[
        "capo_appmonetization.types.business_type.BusinessType"
    ] = None,
    email: Optional["capo_appmonetization.types.email.Email"] = None,
    support_email: Optional["capo_appmonetization.types.email.Email"] = None,
    display_name: Optional[
        "capo_appmonetization.types.seller_display_name.SellerDisplayName"
    ] = None,
    support_phone: Optional[
        "capo_appmonetization.types.support_phone.SupportPhone"
    ] = None,
    invoice_logo: Optional[
        "capo_appmonetization.types.invoice_logo.InvoiceLogo"
    ] = None,
    tax_registrations: Optional[
        "capo_appmonetization.types.tax_registration_list.TaxRegistrationList"
    ] = None,
    client_token: Optional[
        "capo_appmonetization.types.client_token.ClientToken"
    ] = None,
) -> "capo_appmonetization.types.create_app_payment_registration_response.CreateAppPaymentRegistrationResponse":
    """Creates a hosted URL that an app owner uses to register payment and tax details.

    Args:
        app_id: The ID of the app being registered for payment.
        legal_name: Your registered legal name.
        developer_address: Your business address.
        tax_registration_number: Your tax registration number (for example, VAT, GST, or EIN).
        business_type: Whether the seller is an individual or a registered business.
        email: Your primary contact email for this registration, distinct from supportEmail (the address shown to customers). If you omit it, AWS App Monetization uses supportEmail.
        support_email: Your support email address, displayed in the invoice footer.
        display_name: Customer-facing name (doing-business-as) shown to buyers on invoices, distinct from legalName.
        support_phone: Customer-facing support phone number shown to buyers on invoices.
        invoice_logo: Logo printed on the seller's invoices: raw PNG or JPEG bytes, up to 100 KiB. The image type is detected from the bytes. Write-only: the logo is not returned by GetAppPaymentRegistration.
        tax_registrations: The jurisdictions where the seller is registered to collect tax.
        return_url: The URL the seller's browser is redirected to after completing hosted registration.
        refresh_url: The URL the seller's browser is redirected to if the hosted registration session expires.
        client_token: A unique, case-sensitive identifier to ensure that the operation completes no more than one time.
        scope: Required. The environment: live or sandbox.

    Raises:
        capo_appmonetization.errors.access_denied_exception.AccessDeniedException: The caller does not have sufficient permission to perform this action.
        capo_appmonetization.errors.conflict_exception.ConflictException: The request conflicts with the current state of the resource, such as a duplicate identifier or a version mismatch. Retrieve the current state of the resource and retry the request.
        capo_appmonetization.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_appmonetization.errors.resource_not_found_exception.ResourceNotFoundException: The referenced resource does not exist.
        capo_appmonetization.errors.throttling_exception.ThrottlingException: The request was denied due to request throttling.
        capo_appmonetization.errors.validation_exception.ValidationException: The request failed input validation.
        capo_appmonetization.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appmonetization.types.create_app_payment_registration_request.CreateAppPaymentRegistrationRequest]",
    ) -> AsyncOperationResponse[
        "capo_appmonetization.types.create_app_payment_registration_response.CreateAppPaymentRegistrationResponse"
    ]:
        import capo_appmonetization._operations.aws_monetization_ai_front_end.create_app_payment_registration

        (
            output,
            http_response,
        ) = await capo_appmonetization._operations.aws_monetization_ai_front_end.create_app_payment_registration.async_create_app_payment_registration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_appmonetization.types.create_app_payment_registration_request.CreateAppPaymentRegistrationRequest",
    ) -> dict[str, Any]:
        import capo_appmonetization.types.create_app_payment_registration_request

        return capo_appmonetization.types.create_app_payment_registration_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateAppPaymentRegistration", redact_input=_redact_input
        ),
    )
    input_: capo_appmonetization.types.create_app_payment_registration_request.CreateAppPaymentRegistrationRequest = {
        "app_id": app_id,
        "return_url": return_url,
        "refresh_url": refresh_url,
        "scope": scope,
    }
    if legal_name is not None:
        input_["legal_name"] = legal_name
    if developer_address is not None:
        input_["developer_address"] = developer_address
    if tax_registration_number is not None:
        input_["tax_registration_number"] = tax_registration_number
    if business_type is not None:
        input_["business_type"] = business_type
    if email is not None:
        input_["email"] = email
    if support_email is not None:
        input_["support_email"] = support_email
    if display_name is not None:
        input_["display_name"] = display_name
    if support_phone is not None:
        input_["support_phone"] = support_phone
    if invoice_logo is not None:
        input_["invoice_logo"] = invoice_logo
    if tax_registrations is not None:
        input_["tax_registrations"] = tax_registrations
    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