create_billing_portal_session
¶
create_billing_portal_session(
app_id: AppId,
user_id: UserId,
return_url: Url,
refresh_url: Url,
scope: RequestScope,
*,
config_overrides: Optional[AppMonetizationClientConfig] = None,
session_duration_seconds: Optional[SessionDurationSeconds] = None,
client_token: Optional[ClientToken] = None,
) -> CreateBillingPortalSessionResponse
Opens the AWS App Monetization hosted customer billing portal for a user. This operation returns the billing portal URL that your application redirects the user's browser to. No state is persisted.
Parameters:
-
app_id(AppId) –The ID of the app the portal is for.
-
user_id(UserId) –The ID of the end user the portal is for. Do not include personally identifiable or otherwise sensitive data in this value.
-
return_url(Url) –A URL in your app. A plan checkout started from the portal doesn't redirect here: after payment, the buyer returns to the portal's My subscription page. Bound into the session and reused for every checkout the buyer launches from the portal.
-
refresh_url(Url) –A URL in your app. A plan checkout started from the portal doesn't redirect here: if the buyer cancels, they return to the portal's plans page. Bound into the session alongside returnUrl.
-
session_duration_seconds(Optional[SessionDurationSeconds], default:None) –The lifetime of the hosted session, in seconds, counted from this call. Omit to use the service default. It does not set how long billingPortalUrl works; see expiresAt.
-
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
-
scope(RequestScope) –Required. The environment: live or sandbox.
Raises:
-
AccessDeniedException–The caller does not have sufficient permission to perform this action.
-
InternalServerException–An unexpected error occurred while processing the request.
-
ResourceNotFoundException–The referenced resource does not exist.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The request failed input validation.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_appmonetization/_services/app_monetization.py
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 | |