Skip to Content
Paycose Docs
Billing portal

Billing portal

The billing_portal.configuration object

A billing portal configuration decides what customers can do in the hosted billing portal and which business details it shows. Each mode has at most one default configuration, used by portal sessions that do not name one.

Attributes

  • idstringRequired

    Unique identifier for the object.

  • objectstringRequired

    String naming the object's type.

  • livemodebooleanRequired

    true when the object exists in live mode, false in test mode.

  • createdtimestampRequired

    Time the object was created, in Unix seconds.

  • updatedtimestampRequired

    Time the object last changed, in Unix seconds.

  • namestring

    Name of the configuration, for your own reference. Up to 255 characters.

  • activebooleanRequired

    Whether new portal sessions may use this configuration. Creating a session that names an inactive configuration fails. Defaults to true.

  • is_defaultbooleanRequired

    Whether this is the default configuration for its mode. Sessions created without configuration use the active default; making a configuration the default removes the flag from the previous one. When no default exists, the first such session creates one named Default.

  • business_profileobjectRequired

    Business details shown in the portal and printed on documents the customer downloads from it. Empty fields fall back to your account's business profile.

    Show child attributes
    • business_profile.headlinestring

      Short text shown under the business name in the portal header. Up to 500 characters.

    • business_profile.privacy_policy_urlstring

      Link to your privacy policy, shown in the portal. https:// is added when no scheme is given; only http and https links are served.

    • business_profile.terms_of_service_urlstring

      Link to your terms of service, shown in the portal. https:// is added when no scheme is given; only http and https links are served.

    • business_profile.tax_idstring

      Tax ID of the business, printed on documents. Up to 64 characters.

    • business_profile.tax_branchstring

      Tax branch of the business, printed with tax_id on documents. Up to 32 characters.

    • business_profile.addressobjectNullable

      Postal address of the business, printed as the seller address on documents.

      Show child attributes
      • business_profile.address.line1string

        First address line, such as the street and building.

      • business_profile.address.line2string

        Second address line, such as the floor or unit.

      • business_profile.address.citystring

        City, district or town.

      • business_profile.address.statestring

        State or province.

      • business_profile.address.postal_codestring

        Postal code.

      • business_profile.address.countrystring

        Country, as you entered it.

    • business_profile.websitestring

      Website of the business, shown in the portal and on documents. https:// is added when no scheme is given; only http and https links are served.

    • business_profile.support_emailstring

      Support email address, shown in the portal and on documents.

    • business_profile.support_phonestring

      Support phone number, shown in the portal and on documents. Up to 64 characters.

    • business_profile.logo_file_idstring

      ID of the logo file. It must be a file uploaded with purpose branding.

    • business_profile.logo_urlstring

      Public URL of the logo, set by Paycose from logo_file_id. Documents include the logo only when it is an HTTPS PNG or JPEG image of at most 512 KB.

    • business_profile.bank_transferobjectNullable

      Bank account details for paying you by manual transfer.

      Show child attributes
      • business_profile.bank_transfer.bank_namestring

        Name of the bank.

      • business_profile.bank_transfer.account_namestring

        Name on the bank account.

      • business_profile.bank_transfer.account_numberstring

        Bank account number.

      • business_profile.bank_transfer.promptpay_idstring

        PromptPay ID payers can transfer to.

      • business_profile.bank_transfer.notestring

        Extra instructions for the payer.

    • business_profile.brandingobjectNullable

      Colors, font and corner style.

      Show child attributes
      • business_profile.branding.brand_colorstring

        Main brand color as a #rrggbb hex code, stored in lowercase.

      • business_profile.branding.accent_colorstring

        Accent color as a #rrggbb hex code, stored in lowercase.

      • business_profile.branding.fontstring

        Font family.

        • default

          The default font of Paycose's hosted pages.

        • ibm_plex_sans_thai

          IBM Plex Sans Thai.

        • system

          The font of the payer's device.

      • business_profile.branding.shapestring

        Corner style of buttons and fields.

        • sharp

          Square corners.

        • rounded

          Rounded corners.

        • pill

          Fully rounded, pill-shaped corners.

  • featuresobjectRequired

    The actions customers can take in portals opened with this configuration. Every action is checked against these settings on the server, not only hidden in the page.

    Show child attributes
    • features.customer_updateobjectRequired

      Lets the customer edit their own billing details.

      Show child attributes
      • features.customer_update.enabledbooleanRequired

        Whether customers can edit their details at all.

      • features.customer_update.allowed_updatesarray of strings

        The details the customer may change. A change to a detail not listed is refused rather than ignored.

        • name

          The customer's name.

        • email

          The customer's email address.

        • phone

          The customer's phone number.

        • address

          The customer's billing address.

        • shipping

          The customer's shipping details.

        • tax_id

          Adding and removing the customer's tax IDs.

    • features.invoice_historyobjectRequired

      Lets the customer see their invoices, receipts, credit notes and payments, download them as PDFs and pay open invoices.

      Show child attributes
      • features.invoice_history.enabledbooleanRequired

        Whether the feature is on.

    • features.payment_method_updateobjectRequired

      Lets the customer add payment methods, remove them and choose their default.

      Show child attributes
      • features.payment_method_update.enabledbooleanRequired

        Whether the feature is on.

    • features.subscription_cancelobjectRequired

      Lets the customer cancel their subscriptions.

      Show child attributes
      • features.subscription_cancel.enabledbooleanRequired

        Whether customers can cancel subscriptions, and undo a scheduled cancellation, from the portal.

      • features.subscription_cancel.modestring

        When a cancellation takes effect: at_period_end (also used when empty) or immediately. You decide this, not the customer.

        • immediately

          The subscription is canceled as soon as the customer confirms.

        • at_period_end

          The subscription stays active until the end of the current period, then ends.

      • features.subscription_cancel.proration_behaviorstring

        How an immediate cancellation should be prorated: create_prorations, none or always_invoice. Stored with the configuration; cancellations made in the portal do not currently use it.

        • create_prorations

          Credit or charge the prorated difference for the rest of the current period on the next invoice.

        • none

          Do not prorate.

        • always_invoice

          Prorate and invoice the difference right away.

      • features.subscription_cancel.cancellation_reasonobjectRequired

        Whether the portal asks why the customer is canceling, and which reasons it offers.

        Show child attributes
        • features.subscription_cancel.cancellation_reason.enabledbooleanRequired

          Whether the portal asks for a reason. When false, a reason sent from the portal is refused.

        • features.subscription_cancel.cancellation_reason.optionsarray of strings

          The reasons offered. The reason the customer picks is saved as the cancellation feedback of the subscription; a reason not in this list is refused.

          • customer_service

            Unhappy with customer service.

          • low_quality

            Quality was too low.

          • missing_features

            Missing features the customer needs.

          • other

            Another reason.

          • switched_service

            Switched to a different service.

          • too_complex

            Too hard to use.

          • too_expensive

            Too expensive.

          • unused

            Not used enough.

      • features.subscription_cancel.retention_couponstring

        Coupon offered in a step shown before the customer confirms the cancellation. A customer who accepts the offer keeps the subscription and the coupon is applied to it. When empty, the step is skipped.

    • features.subscription_updateobjectRequired

      Lets the customer change the plan of their subscriptions.

      Show child attributes
      • features.subscription_update.enabledbooleanRequired

        Whether customers can change their subscriptions from the portal.

      • features.subscription_update.default_allowed_updatesarray of strings

        What the customer may change on a subscription.

        • price

          Switch to another allowed price.

        • quantity

          Change the quantity.

        • promotion_code

          Apply a promotion code to the subscription.

      • features.subscription_update.proration_behaviorstring

        How plan changes are prorated: create_prorations (also used when empty), none or always_invoice.

        • create_prorations

          Credit or charge the prorated difference for the rest of the current period on the next invoice.

        • none

          Do not prorate.

        • always_invoice

          Prorate and invoice the difference right away.

      • features.subscription_update.productsarray of objects

        The products, and optionally their prices, customers may switch to; up to 10. Only active prices are offered. With no products listed, no plan can be chosen.

        Show child attributes
        • features.subscription_update.products.productstringRequired

          ID of the product.

        • features.subscription_update.products.pricesarray of strings

          IDs of the product's prices customers may choose. Empty means every active price of the product.

      • features.subscription_update.schedule_at_period_endboolean

        Whether downgrades should wait until the end of the current period. Stored with the configuration; plan changes made in the portal currently apply at once.

  • default_return_urlstring

    URL the portal's return link uses when a session sets no return_url.

  • login_pageobjectRequired

    Login page settings, stored as you set them. Paycose does not host a login page for the portal or generate its URL.

    Show child attributes
    • login_page.enabledbooleanRequired

      Whether the configuration has a shareable login page. false unless you set it.

    • login_page.urlstring

      URL of the login page, as you set it. Paycose does not generate it; customers reach the portal through session URLs.

  • metadataobject

    Key-value pairs you attach to the object for your own use. Paycose never reads or changes them.