PayPal.Api.WebProfile.Create C# (CSharp) Method

Create() public method

Creates a web experience profile. Pass the profile name and details in the JSON request body.
public Create ( APIContext apiContext ) : PayPal.Api.CreateProfileResponse
apiContext APIContext APIContext used for the API call.
return PayPal.Api.CreateProfileResponse
        public CreateProfileResponse Create(APIContext apiContext)
        {
            return WebProfile.Create(apiContext, this);
        }

Same methods

WebProfile::Create ( APIContext apiContext, WebProfile webProfile ) : PayPal.Api.CreateProfileResponse

Usage Example

        protected override void RunSample()
        {
            // ### Api Context
            // Pass in a `APIContext` object to authenticate
            // the call and to send a unique request id
            // (that ensures idempotency). The SDK generates
            // a request id if you do not pass one explicitly.
            // See [Configuration.cs](/Source/Configuration.html) to know more about APIContext.
            var apiContext = Configuration.GetAPIContext();

            // Setup the profile we want to create
            var profile = new WebProfile()
            {
                name = Guid.NewGuid().ToString(),
                presentation = new Presentation()
                {
                    brand_name = "Sample brand",
                    locale_code = "US",
                    logo_image = "https://www.paypal.com/",
                    note_to_seller_label = "Thx",
                    return_url_label = "Retreat!"
                },
                input_fields = new InputFields()
                {
                    address_override = 1,
                    allow_note = true,
                    no_shipping = 0
                },
                flow_config = new FlowConfig()
                {
                    bank_txn_pending_url = "https://www.paypal.com/",
                    landing_page_type = "billing",
                    user_action = "commit",
                    return_uri_http_method = "GET"
                },
                temporary = true
            };

            #region Track Workflow
            //--------------------
            this.flow.AddNewRequest("Create profile", profile);
            //--------------------
            #endregion

            // Create the profile
            var response = profile.Create(apiContext);

            #region Track Workflow
            //--------------------
            this.flow.RecordResponse(response);
            //--------------------
            #endregion

            #region Cleanup
            // Cleanup by deleting the newly-created profile
            var retrievedProfile = WebProfile.Get(apiContext, response.id);
            retrievedProfile.Delete(apiContext);
            #endregion
        }
All Usage Examples Of PayPal.Api.WebProfile::Create