Custom attributes

Custom attributes define the metadata keys Repejo accepts and persists on checkout-derived entities. They are configured per tenant and shape the metadata objects exposed in payer, subscription, receivable, and transaction payloads.

Custom attributes are defined via the Settings page

Definition fields

  • label is the human-facing name shown in the admin UI.
  • value is the programmatic key used inside metadata maps and webhook payloads.
  • public controls whether the key may be set from embedded checkout components.

Rules

  • value is the programmatic key used inside metadata maps.
  • value is trimmed, lowercased, unique, and can only contain a-z, 0-9, and _.
  • A custom attribute definition keeps its value after creation. It is treated as immutable.
  • Metadata values may not be longer than 1000 characters.
  • Incoming metadata keeps only defined keys and non-empty string values. Blank keys and blank values are removed during normalization.
  • Frontend-provided metadata keeps only keys whose definitions are marked public. Unknown, private, and oversized values are ignored.

Public attributes in embedded checkout

Public attributes can be passed into embedded checkout components as one HTML attribute per metadata key. The attribute name must use the metadata- prefix.


        <repejo-checkout
          short_code="my_checkout"
          host="https://app.repejo.se"
          metadata-member_id="12345"
        ></repejo-checkout>

        <repejo-checkout-button
          short_code="my_checkout"
          host="https://app.repejo.se"
          metadata-member_id="12345"
        ></repejo-checkout-button>

        <repejo-sticky-checkout
          short_code="my_checkout"
          host="https://app.repejo.se"
          metadata-member_id="12345"
        ></repejo-sticky-checkout>
      
  • Repejo reads those attributes when the checkout session is created.
  • Accepted public values are stored on the user session and merged into the metadata used to create downstream entities.
  • If a runtime value uses the same key as checkout.metadata, the runtime value wins for that session.
  • Non-public keys are ignored and logged server-side.

Metadata lifecycle

  • checkout.metadata acts as the default source for downstream metadata.
  • In the checkout settings UI, definitions marked public are shown as readonly values.
  • payer.metadata, subscription.metadata, receivable.metadata, and transaction.metadata are snapshots captured at creation time.
  • Those downstream metadata fields are readonly after creation and should be treated as historical context.
  • Repejo propagates metadata from checkout to payer and subscription creation, then forward to receivables and transactions created from those flows.

Completed event

The repejo:completed event now includes a metadata object in its detail payload.


        type RepejoCompletedEventDetail = {
          checkout_short_code: string;
          type: "recurring" | "onetime" | "gift_card";
          payer: {
            name: string | null;
            phone_number: string | null;
            email: string | null;
          };
          metadata: Record<string, string>;
        };
      
  • Only public attributes are included in detail.metadata.
  • Private attributes remain persisted on downstream entities but are never exposed through this browser event.
  • The event payload reflects the backend-filtered state, not the raw HTML attributes from the page.