{"method":"POST","path":"https://api.revcent.com/v2/customer_portals","summary":"Create A Customer Portal","description":"Create a Customer Portal, which will issue a unique Customer Portal ID. You will have the ability to embed the portal as an iFrame on your own website when properly configured with the same domain tracking domain associated.<br><br>Note: A SMTP Profile, tracking domain and ReCaptcha must have been previously set up before creating a customer portal. View markdown documentation at https://revcent.com/documentation/markdown/mcp/operation/CreateCustomerPortal.md for an in-depth overview of this operation.","operationId":"CreateCustomerPortal","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"name":{"type":"string","description":"The Customer Portal name. Must be unique from other Customer Portal names."},"description":{"type":"string","description":"The Customer Portal description."},"enabled":{"type":"boolean","description":"Whether the Customer Portal is enabled."},"tracking_domain":{"type":"string","description":"The 20 character tracking domain ID to use for the customer portal. This is required. Make sure the tracking domain is set up and has an active SSL certificate before using it in the portal. If you need to set up a tracking domain, please see the Create A Tracking Domain API endpoint.","minLength":20,"maxLength":20},"recaptcha":{"description":"The reCAPTCHA settings to prevent bots from registering for the portal. This is required. Get a free one here: https://www.google.com/recaptcha/admin.","type":"object","additionalProperties":false,"properties":{"site_key":{"description":"The reCAPTCHA v2 'Im Not A Robot' site key for the domain associated with the tracking domain. Required.","type":"string"},"secret_key":{"description":"The reCAPTCHA v2 'Im Not A Robot' secret key for the domain associated with the tracking domain. Required.","type":"string"}},"required":["site_key","secret_key"]},"display_name":{"description":"The customer portal display name. This is what will be displayed to customers using the portal. If blank, portal name will be used.","type":"string"},"footer_html":{"description":"The customer portal footer HTML. This is where you can add custom text, links, and more to the footer of the customer portal.","type":"string"},"smtp_profile":{"type":"string","description":"The 20 character SMTP profile ID to use for the customer portal. This is required.","minLength":20,"maxLength":20},"customer_emails":{"type":"object","additionalProperties":false,"description":"Customize the portal emails for both registration confirmation and password reset. Each email type has its own options and template HTML. RevCent will send the emails to the customers' email address in question upon registration or password reset. Make sure to place the {{email_code}} shortcode in both templates, as the customer will require them for both methods.","properties":{"customer_account_confirm_email":{"type":"object","additionalProperties":false,"description":"The customer account confirmation email settings.","properties":{"to_cc":{"type":"array","description":"An array of email addresses to CC on the customer account confirmation email.","items":{"type":"string","description":"The email address to CC."}},"to_bcc":{"type":"array","description":"An array of email addresses to BCC on the customer account confirmation email.","items":{"type":"string","description":"The email address to BCC."}},"from":{"type":"string","description":"The email address to use as the sender. Should match email used in SMTP profile to avoid errors"},"from_name":{"type":"string","description":"The name to use as the sender."},"subject":{"type":"string","description":"The subject of the customer account confirmation email."},"html":{"description":"The customer account confirmation email template HTML. Make sure to place the {{email_code}} shortcode in your template HTML below. The customer will need the code to confirm their registration in the portal.","type":"string"}},"required":["from"]},"customer_account_password_reset":{"type":"object","additionalProperties":false,"description":"The customer account password reset email settings.","properties":{"to_cc":{"type":"array","description":"An array of email addresses to CC on the customer account password reset email.","items":{"type":"string","description":"The email address to CC."}},"to_bcc":{"type":"array","description":"An array of email addresses to BCC on the customer account password reset email.","items":{"type":"string","description":"The email address to BCC."}},"from":{"type":"string","description":"The email address to use as the sender. Should match email used in SMTP profile to avoid errors."},"from_name":{"type":"string","description":"The name to use as the sender."},"subject":{"type":"string","description":"The subject of the customer account password reset email."},"html":{"description":"The customer account password reset email template HTML. Important: Make sure to place the {{email_code}} shortcode in your template HTML. The customer will need the code to reset their password.","type":"string"}},"required":["from"]}},"required":["customer_account_confirm_email","customer_account_password_reset"]},"customer_filters":{"type":"object","additionalProperties":false,"description":"The customer filters are used to determine which customers are able to access the customer portal. If no filters are set, all customers will be able to access the portal.","properties":{"campaign":{"type":"array","description":"An array of campaigns, used to allow customers associated with at least one of the campaign(s) to access the portal. Leave empty to not require campaign association.","items":{"type":"string","title":"Campaign ID","description":"A 20 character campaign ID.","minLength":20,"maxLength":20}},"third_party_shop":{"type":"array","description":"An array of third party shops, used to allow customers associated with at least one of the third party shops to access the portal. Leave empty to not require third party shop association.","items":{"type":"string","description":"A 20 character user shop ID.","minLength":20,"maxLength":20}}}},"customer_permissions":{"type":"object","additionalProperties":false,"description":"The customer permissions are used to determine what customers can do in the customer portal. Only enable the permissions for the actions you want customers to be able to perform in the portal. For example, if you don't want customers to be able to cancel their subscriptions in the portal, then make sure the subscription_cancel permission is set to false.","properties":{"contact_modify":{"type":"boolean","description":"Whether customers can modify their contact information in the portal."},"credit_card_add":{"type":"boolean","description":"Whether customers can add credit cards in the portal."},"credit_card_remove":{"type":"boolean","description":"Whether customers can remove credit cards in the portal."},"credit_card_set_default":{"type":"boolean","description":"Whether customers can set a default credit card in the portal."},"shipping_modify_ship_to":{"type":"boolean","description":"Whether customers can modify their shipping information in the portal."},"subscription_renew":{"type":"boolean","description":"Whether customers can renew their subscriptions in the portal."},"subscription_activate":{"type":"boolean","description":"Whether customers can re-activate their subscriptions in the portal."},"subscription_suspend":{"type":"boolean","description":"Whether customers can suspend their subscriptions in the portal."},"subscription_cancel":{"type":"boolean","description":"Whether customers can cancel their subscriptions in the portal."},"trial_expire":{"type":"boolean","description":"Whether customers can expire their trials in the portal."},"trial_cancel":{"type":"boolean","description":"Whether customers can cancel their trials in the portal."},"salvage_transaction_process":{"type":"boolean","description":"Whether customers can manually process salvage transactions in the portal."}}},"create_non_existing_customer":{"description":"Whether to allow a non-existing customer to register for the portal. Recommended set to false.","type":"boolean"},"create_non_existing_customer_campaign":{"description":"The campaign ID to use for non-existing customers who register through the customer portal when create_non_existing_customer is true.","type":"string","minLength":20,"maxLength":20}},"required":["name","tracking_domain","recaptcha","smtp_profile","customer_emails"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"API call response code.","type":"integer","format":"int32","enum":[1]},"customer_portal_id":{"type":"string","description":"A 20 character customer portal ID.","minLength":20,"maxLength":20},"result":{"type":"string"}},"type":"object","additionalProperties":false}}},"description":"Successful response."},"default":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"This value indicates that there is an error. Will always be 0.","type":"integer","enum":[0]},"error_code":{"description":"The specific error code.","type":"string"},"message":{"description":"A human readable description of the error.","type":"string"},"result":{"description":"A description of the API call result.","type":"string"}},"title":"APIStandardErrors","type":"object","additionalProperties":false}}},"description":"Error response."}}}