---
title: "Store"
icon : "cart-shopping"
description: "Sell keys straight from a hosted storefront: branding, payment gateways, products, and promo codes."
---

# Store

The Store is a hosted checkout page for your account. A buyer picks a tier, pays through your own payment gateway, and the key is minted and handed over the moment the payment clears. Nothing goes through a ticket queue and you never whitelist by hand.

Your storefront lives at a stable URL tied to your account:

```text
https://envyauth.my.id/store/<your_account_uuid>
```

Everything below is configured under **Marketplace** in the dashboard sidebar. A first-time setup takes about ten minutes, and you can walk your own checkout before a single buyer sees the page.

## How a sale works

1. The buyer opens your storefront and sees your active tiers with real prices.
2. They optionally enter a promo code. A free code mints instantly; a percent or flat code reduces the amount they actually pay.
3. They pick a payment method and get redirected to that gateway's hosted checkout.
4. The gateway calls our webhook when the payment clears. We mint the key, mark the order completed, and hand back a claim link.
5. The buyer lands on the claim page and copies their key.

The key is minted server-side against the script you attached to the product, so it lands in the right project with the right expiry without any action from you.

<Info title="Money never touches EnvyAuth">
  Checkouts are built with **your** gateway credentials, so the buyer pays you directly. We only build the charge, listen for the webhook, and mint the key.
</Info>

## Set your store up

Work through these in order. Each step is a separate page under **Marketplace → Storefront** in the sidebar, except the last two which live on their own top-level pages.

<Steps>

  <Step
    title     ="Turn the store on"
  >
    Open **Marketplace → Storefront**. The store ships switched off, and a disabled store returns an empty page to visitors rather than an error — nothing leaks about your account.

    - **Store live** — master switch. Off means the storefront, checkout, and promo redemption are all closed.
    - **Require Discord** — buyers connect Discord before paying, and the minted key is bound to their Discord ID automatically.

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a01-store-live.png"
      alt   ="Storefront page with an arrow pointing at the Store live switch"
      width ={1280}
      height={1200}
      caption="The master switch sits at the top of the Storefront page."
    />

    Turn **Require Discord** on if your product is Discord-gated. It saves you the redeem step later, because the key already knows who owns it.

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a02-require-discord.png"
      alt   ="Storefront page with an arrow pointing at the Require Discord switch"
      width ={1280}
      height={1200}
      caption="The second switch on the same card binds every minted key to the buyer's Discord account."
    />

    You do not have to flip **Store live** on yet. The preview link in step 7 opens your storefront while it is still switched off.
  </Step>

  <Step
    title     ="Brand the checkout page"
  >
    **Storefront → Branding** controls the lockup shown at the top of your checkout page: your store name, the product line underneath it, and your logo.

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a19-branding.png"
      alt   ="Branding page with an arrow pointing at the Upload logo button"
      width ={1280}
      height={1200}
      caption="Upload logo sits at the top of the Branding page, above the name fields."
    />

    Logo uploads are checked by reading the file's actual bytes, not the filename or the declared type. PNG, JPEG, WebP, and GIF are accepted up to 512 KB. SVG is rejected on purpose — it can carry scripts.

    Set a name but no logo and the page falls back to a neutral gradient avatar. Leave both blank and the checkout renders with the EnvyAuth lockup instead.
  </Step>

  <Step
    title     ="Write your terms and privacy copy"
  >
    **Storefront → Legal** is where you write your own Terms of Service and Privacy Policy. Buyers open them as a slide-out panel from the checkout page.

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a20-legal.png"
      alt   ="Legal page with an arrow pointing at the Terms of Service text area"
      width ={1280}
      height={1200}
      caption="Terms of Service comes first, with Privacy Policy in the same layout below it."
    />

    The copy is stored and rendered as plain text. Links and markup are never rendered, which keeps your checkout page from becoming a phishing vector if an account is ever compromised.

    Each field shows **Empty — uses the EnvyAuth document** while it is blank, and the storefront links to the platform document instead. Buyers are told the seller has not published their own.
  </Step>

  <Step
    title     ="Connect a payment gateway"
  >
    **Storefront → Payments** lists every supported gateway. Connect as many as you like — each enabled one becomes a payment option at checkout.

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a06-connect-button.png"
      alt   ="Payment methods list with an arrow pointing at the Connect button on the Xendit row"
      width ={1280}
      height={1200}
      caption="Each gateway you have not set up yet carries its own Connect button."
    />

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a05-gateway-status.png"
      alt   ="Payment methods list with an arrow pointing at the Connected Sandbox badge under PayPal"
      width ={1280}
      height={1200}
      caption="A connected gateway carries a badge naming the environment it is actually running in."
    />

    The green badge tells you the environment the gateway is actually running in, read from the credentials themselves. An `sk_test_` key reads as **Sandbox** no matter which way you set the switch, and a mismatch is called out next to the badge.
  </Step>

  <Step
    title     ="Paste the credentials"
  >
    Click **Connect** — or **Edit** on a gateway you already use — and paste the keys from that provider's dashboard. Keys are encrypted at rest and never shown back to you in full.

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a07-connect-modal.png"
      alt   ="Connect Xendit dialog with an arrow pointing at the Secret API key field"
      width ={1280}
      height={1200}
      caption="The dialog opens over the payments list, with the secret key field first."
    />

    Leave **Live mode** off for your first pass. Off means sandbox or test, which is exactly what you want until you have watched one purchase run end to end.

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a08-live-mode.png"
      alt   ="Connect Xendit dialog with an arrow pointing at the Live mode switch"
      width ={1280}
      height={1200}
      caption="Live mode sits at the bottom of the same dialog. Off is sandbox, and that is where you start."
    />

    Webhooks are registered for you on save. There is nothing to copy into the gateway dashboard except the Xendit verification token, which that provider only shows on its own Settings → Webhooks page.
  </Step>

  <Step
    title     ="Create your tiers"
  >
    **Marketplace → Products**, then **Add tier**. A tier is one script plus one price plus one duration.

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a09-add-tier-button.png"
      alt   ="Products page with an arrow pointing at the Add tier button"
      width ={1280}
      height={1200}
      caption="Add tier sits above the table, on the Products page."
    />

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a10-tier-duration.png"
      alt   ="Add tier dialog with an arrow pointing at the Duration field"
      width ={1280}
      height={1200}
      caption="Duration is measured in days. Leave it empty and the key never expires."
    />

    Leave **Duration** blank for a permanent key. Set the currency to something at least one connected gateway supports — a mismatch is rejected at checkout with `GATEWAY_CURRENCY` rather than failing on the payment page.

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a11-tier-price.png"
      alt   ="Add tier dialog with an arrow pointing at the Price field and its currency selector"
      width ={1280}
      height={1200}
      caption="Price is entered in minor units, with the currency picked right beside it."
    />

    Repeat until every plan you sell has a row.
  </Step>

  <Step
    title     ="Walk your own checkout first"
  >
    Back on **Storefront**, the **Test mode** card is the rehearsal room. Click **Create preview link** and you get a private URL that opens your storefront even while **Store live** is still off.

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a03-preview-link.png"
      alt   ="Storefront page with an arrow pointing at the Create preview link button"
      width ={1280}
      height={1200}
      caption="The Test mode card sits below the payment methods list."
    />

    Buy one of your own tiers through it with a sandbox gateway. You want to see the key land in the right project with the right expiry before a real buyer does.

    The card also warns you when your store is live but every enabled gateway is still in sandbox — that combination takes real buyers to a checkout that moves no money.
  </Step>

  <Step
    title     ="Share the link"
  >
    The **Store page** card at the bottom holds your public URL. Copy it and put it wherever your buyers are.

    <Screenshot
      src   ="/assets/docs/_usermanual/store/a04-store-url.png"
      alt   ="Storefront page with an arrow pointing at the public store page URL field"
      width ={1280}
      height={1200}
      caption="Copy the URL straight from the last card on the Storefront page."
    />

    Switch each gateway to live mode first, and buy one real key yourself before you post the link anywhere public.
  </Step>

</Steps>

## Test mode

Test mode is not a separate switch you flip. Two things put an order into it, and either one is enough:

- The buyer arrived through your **preview link**.
- The gateway they paid with is running on **sandbox credentials**.

Buyers are never left guessing. A sandbox checkout carries a banner naming the gateway, and it updates as they switch payment methods.

<Screenshot
  src   ="/assets/docs/_usermanual/store/a17-buyer-banner.png"
  alt   ="Public storefront with an arrow pointing at the test mode banner above the tier list"
  width ={1280}
  height={1200}
  caption="The same banner appears on the claim page, so a test key is never mistaken for a sold one."
/>

A test order behaves like any other order — the key is really minted, the webhook is really verified — with one difference: it is excluded from your revenue total and from the Paid, Pending, and Issues counters. It carries a **Test** badge in Sales, and the key note gets a `[test]` suffix so it is obvious in your key list too.

<Warning title="A preview link is a real URL">
  Anyone holding the link can open your storefront while it is switched off. Treat it like a password, and click **Revoke** on the Test mode card when you are done rehearsing. **Regenerate** replaces the old link with a new one.
</Warning>

## Payment gateway reference

| Gateway | Currencies | Webhook setup |
|---|---|---|
| Stripe | Multi-currency | Endpoint and signing secret are created automatically when you connect. |
| PayPal | Multi-currency | Webhook is created or reused automatically, per environment. |
| Midtrans | IDR only | Nothing to configure — each transaction carries its own notification override. |
| Xendit | Multi-currency | Callback URL registers automatically; paste the verification token from your Xendit dashboard. |
| Tebex | Multi-currency | Endpoint validation handshake is answered automatically on connect. |

Each gateway has a **Live mode** switch: off is sandbox or test, on is real money. Run at least one sandbox purchase end to end before you turn it on.

The switch is a label, not the truth. What decides the real environment is the key you pasted — `sk_test_`, `xnd_development_`, and `SB-Mid-server-` are sandbox credentials whatever the switch says, and the payments list tells you when the two disagree.

<Warning title="Currency has to match">
  A product priced in a currency the gateway doesn't support is rejected at checkout with `GATEWAY_CURRENCY` rather than failing at the payment page. Midtrans is the common trip-up: it only handles IDR, and it will not take a price with decimals.
</Warning>

## Products

**Marketplace → Products** holds the tiers buyers can choose from. A product is a script plus a price plus a duration.

<Screenshot
  src   ="/assets/docs/_usermanual/store/a21-products-table.png"
  alt   ="Products page with an arrow pointing at the tier table"
  width ={1280}
  height={1200}
  caption="Every row here becomes one selectable option on your storefront."
/>

| Field | Meaning |
|---|---|
| **Script** | Which script the minted key unlocks. The owning project is snapshotted onto the order at purchase time. |
| **Label** | What the buyer sees, up to 80 characters. Also becomes the key note. |
| **Duration** | Days the key stays valid, 1–3650. Leave it empty for a permanent key. |
| **Price** | Amount in minor units (cents, rupiah, and so on) up to 100,000,000. |
| **Currency** | Three to eight characters. Must be supported by at least one connected gateway. |
| **Active** | Inactive products disappear from the storefront but keep their sales history. |
| **Sort order** | Lower numbers show first. |

Deactivate rather than delete when you retire a tier — past orders stay readable that way.

## Discounts

**Marketplace → Discounts** holds promo codes. There are three kinds, and the kind decides which checkout path the code takes.

<Screenshot
  src   ="/assets/docs/_usermanual/store/a12-new-code-button.png"
  alt   ="Discounts page with an arrow pointing at the New code button"
  width ={1280}
  height={1200}
  caption="Every promo code starts here, on the Discounts page."
/>

<Screenshot
  src   ="/assets/docs/_usermanual/store/a13-discount-type.png"
  alt   ="New code dialog with an arrow pointing at the Type selector"
  width ={1280}
  height={1200}
  caption={<>Blank <code>Max uses</code> means unlimited, and a blank expiry means the code never lapses.</>}
/>

| Kind | Effect |
|---|---|
| `free` | Buyer gets the key without paying. Redeemed directly, no gateway hop. |
| `percent` | Cuts the price by a percentage, 0–100. |
| `flat` | Subtracts a fixed amount in minor units. |

Every code also supports:

- **Bonus days** — added on top of the product duration, up to 3650. Works with all three kinds.
- **Max redemptions** — hard cap, 1–1,000,000. Leave empty for unlimited.
- **Expiry** — a date after which the code stops validating.
- **Active** — turn a code off without deleting it.

<Screenshot
  src   ="/assets/docs/_usermanual/store/a14-bonus-days.png"
  alt   ="New code dialog with an arrow pointing at the Bonus days field"
  width ={1280}
  height={1200}
  caption="Bonus days stack on top of whatever duration the tier already carries."
/>

Codes accept letters, numbers, `-`, and `_`, up to 64 characters.

A percent code that lands on zero behaves like a free code: the key is minted immediately instead of sending the buyer to a payment page they'd pay nothing on.

<Hint title="Capacity is checked before the code is burned">
  If your plan's key limit is full, checkout refuses before the redemption counter moves. A limited code can't be silently eaten by a store that couldn't have issued the key anyway.
</Hint>

## Sales

**Marketplace → Sales** lists every order with its status.

<Screenshot
  src   ="/assets/docs/_usermanual/store/a15-sales-kpi.png"
  alt   ="Sales page with an arrow pointing at the Revenue counter card"
  width ={1280}
  height={1200}
  caption="The counters and the revenue figure count real orders only. Use the Test chip to see the rehearsals."
/>

| Status | Meaning |
|---|---|
| `pending` | Checkout started, waiting on the gateway webhook. |
| `completed` | Paid and the key was minted. |
| `pending_capacity` | Payment cleared but your plan's key limit was full. Raise the limit and the key gets issued. |
| `refunded` | Reversed after completion. |
| `failed` | The gateway reported a failure. |

Orders also carry a **source**: `checkout` for a normal purchase and `promo` for a free-code redemption.

<Screenshot
  src   ="/assets/docs/_usermanual/store/a16-order-status.png"
  alt   ="Sales page with an arrow pointing at the status cell of a paid order row"
  width ={1280}
  height={1200}
  caption="Each row carries its own status, so a stuck order is easy to spot."
/>

A `pending_capacity` row means a buyer paid and is waiting. Treat it as urgent — upgrade the plan or free up keys, and the pending order settles.

## What buyers see

This is your storefront as a buyer meets it: your tiers with real prices, a promo field, and one tab per connected gateway.

<Screenshot
  src   ="/assets/docs/_usermanual/store/a18-promo-field.png"
  alt   ="Public storefront with an arrow pointing at the promo code field below the tier list"
  width ={1280}
  height={1200}
  caption="Tiers appear in sort order. The banner is only there because these gateways are in sandbox."
/>

After payment clears, the buyer lands on a claim page holding the minted key. Nothing else is required from you.

## Going live checklist

1. Enable the store and decide whether Discord is required.
2. Set your brand name, product name, and logo.
3. Write your Terms and Privacy copy.
4. Connect at least one gateway, leaving **Live mode** off.
5. Create your tiers with a currency the gateway supports.
6. Open the preview link and buy one of your own tiers end to end.
7. Confirm the order shows as **Test** in Sales and the key landed in the right project.
8. Turn **Live mode** on, revoke the preview link, and buy one real key yourself before you share the URL.
