PubliraGitHub

This page describes v0.6, which is not the newest release. See the documentation for v0.7.

Selling episodes

Published Updated

Selling an episode on the site takes three things that have to agree: the episode's price in the tenant console, an account with a payment provider, and a webhook through which the provider tells the install that a reader has paid. The provider charges the reader, but only the webhook opens the episode, so a setup with any of the three wrong takes the reader's money and leaves the episode locked. This page walks through all three, in the order they are set up, and ends with a test purchase that proves they agree.

The tenant's app sells either through the same provider, or through the App Store's and Google Play's own payment, which needs no provider and is verified with the stores instead. Selling in the app covers that choice, and a tenant that sells only in its app through the stores can skip the provider sections.

Everything here under Payments › Payment methods and Payments › Promotion codes is for a Tenant admin; an Editor or an Auditor does not see those screens. Pricing an episode is done by whoever creates it.

How a reader buys an episode

Price and reading period

An episode's Price and Reading period are first entered on the form that creates it:

  • Price is entered in the tenant's currency, which the field names, with no more decimal places than the currency has: 500 for 500 yen, 4.99 for 4.99 US dollars. 0 makes the episode free; any other value makes it a paid episode.
  • Reading period is how many hours a purchase keeps the episode open. 0 keeps it open with no end.

The Price and Reading period fields of the Create episode form.

A paid episode can also be rented: sold for less than its Price, for a limited time. The two fields below Reading period set the rental, and an episode is rented only while Rental price holds an amount:

  • Rental price is entered in the tenant's currency, as Price is, and has to be lower than it, so a free episode cannot be rented. Leave it empty not to rent the episode.
  • Rental period is how many hours a rental keeps the episode open, at least 1. It is not used while Rental price is empty.

The Rental price and Rental period fields of the Create episode form.

The form refuses a rental priced at or above Price, and one with a Rental price but no Rental period, and says which field to correct. A rental does not take the place of the permanent copy: a reader who rented the episode can still buy it.

A paid episode can also open its first pages before it is bought. Preview pages, below the rental, is how many of them, counted from the first: 0, where it starts, opens none. The field is offered only while Price is above 0, since a free episode opens all its pages. Preview pages describes it.

All five can be changed later under Price and reading period on the episode's edit screen, as Episodes describes. To sell an episode for less for a limited time without changing its price, schedule a campaign price on it. A change applies to purchases made after it is saved; a purchase or a rental already made keeps the price it was paid and the time it expires. A new episode's Reading period starts at the series' Reading period, and its Rental period at the series' Rental period, so setting them on the series once gives every episode created afterwards the same periods unless they are changed on the form. Changing the series' periods does not reach the episodes already created.

Buying and reading

On a paid episode the site shows the price and Buy this episode. On a rented one it offers both sales instead, each with what it costs: Buy for the price, and Rent for the rental period at the rental price. A reader who is signed in and chooses one is sent to the payment provider's checkout page, pays there, and comes back to the episode, which tells them their payment is being confirmed. The episode opens when the provider's notification of the payment reaches the install, usually within seconds. Coming back from the checkout page opens nothing by itself.

On a paid episode with preview pages, a reader who cannot open it yet, signed in or not, reads those pages first, on the site and in the app alike, in the same reader as the rest of the episode: in its reading direction, and paired into spreads as its layout pairs them. The page counter and the progress slider count the preview pages alone, such as Page 3 of 3 on the site and 3 / 3 in the app. Turning past the last of them brings up The preview ends here, with the purchase and the other ways in the episode offers. A paid episode without preview pages shows the same offers in place of its pages, over a blurred view of its opening pages. Neither how far the reader got in a preview nor reaching its end is recorded, so once bought, the episode opens on its first page.

Once bought, the episode:

  • Stays open for its reading period, or a rental for its rental period, counted from the moment the purchase is recorded.
  • Is listed under Purchases on the reader's account, marked as a purchase or a rental, with the time a rental has left, and after its period ends, under Purchase history.
  • Opens on the site and in the tenant's app alike, for the same account, wherever it was bought.
  • Cannot be bought again while it is open. Once its reading period has ended, it can. A reader holding a rental can still buy the permanent copy, but not rent it again until the rental ends.

Download as CSV on Purchases saves every purchase listed there, across all its pages and refunded ones included, as one CSV file. In the tenant's app, Export as CSV on Purchases writes the same file and hands it to the device's share sheet, from which the reader saves or sends it.

A pack of the tenant's coins the reader bought on the site is listed under Purchase history, named by the coins it granted in the tenant's word for them, such as 1,100 Points (including 100 bonus), with what they paid and whether it was refunded. It opens nothing and has no reading period: the coins expire on their own. The CSV writes it with coin_pack in its item column and the coins it granted, the bonus among them, in coins and bonus_coins.

Paying with coins

Where the tenant sells coins of its own — the platform allows tenants to issue them, and the tenant has turned its coins on, as Coins describes — a paid episode is also priced in them: its price, or its campaign price while one is open, divided by what one coin is worth and rounded up, and its rental the same way. On the site, the episode tells a signed-in reader how many coins they hold, in the tenant's word for them, and when those cover the price, offers a button that spends them, such as Pay 300 Points. It opens the episode at once, without a payment page.

A reader who holds too few is offered, beside the purchase, the smallest pack on sale that makes up the difference, with what it costs, how many days its coins can be spent, and the tenant's disclosures. Buying it sends them to the payment provider's checkout and back to the episode, where they pay with the coins once the provider's notification has granted them. Where no pack on sale is large enough, the episode links to the reader's coins page instead. An episode sold in the app alone is not paid for with coins on the site.

An episode paid for with coins is a purchase like any other: it stays open for its reading period, or a rental for its rental period, and is listed under Purchases with the coins it took in place of a price. The CSV writes its price as 0 and those coins in coins_spent.

My Page shows a section headed by the tenant's word for its coins, with the reader's balance and when the first of it expires, and a link to the reader's coins page. That page lists the packs on sale, each with its price and how many days its coins can be spent, with the tenant's disclosures under them, and every coin added, spent, taken back, or expired, a page at a time. A pack bought there sends the reader back to it. None of this appears while the platform or the tenant has coins off.

The rest of a series

A reader can also buy, in one checkout, every paid episode of a series they do not own yet. Above the episode list, the series page offers Buy remaining episodes with how many episodes that is and what they cost together, and the series screen of the tenant's app does the same. The purchase opens each of those episodes as buying it alone would, for its own reading period.

What they cost together is the sum of their prices less the series' Bundle discount, where an episode under a campaign price counts at that price while its campaign is open, set on the series' form as Series describes: a whole percent up to 99, or 0, where a new series starts, to sell them at that sum. With a discount, the offer says how much it takes off what the episodes cost one by one, and the checkout page lists the discount beside the episodes. The discounted price is rounded down to the currency's smallest unit, and a discount that would leave nothing to pay offers no checkout. A change to the discount applies from the next checkout: a reader who opened the payment provider's checkout page before it pays what that page shows.

Free reading periods and Free if you wait

A price is what a reader pays when nothing else opens the episode. Two other things can, and while either has the episode open to a reader, the site offers that reader no purchase:

  • Free reading periods, set on an episode, open it to everyone, signed in or not, between two dates. The price applies again when the period ends. A reader who bought the episode earlier keeps their purchase, and its reading period keeps running through the free period. A series' Free after publication rule adds such a period to each of its paid episodes a set number of days after the episode is published.
  • Free if you wait, set on a series, gives each signed-in reader a free ticket that opens one paid episode of the series for Hours an episode stays open, and a new ticket Hours until the next ticket after they use one. Newest episodes a ticket cannot open keeps the latest episodes for buyers. A ticket cannot be used on an episode in a free reading period, or on one the reader already has.

An access ticket, issued by staff under Access tickets, opens an episode the same way, without payment. An Author credited on an episode reads it free and is not offered a purchase. A member of the tenant's staff, in any of the three roles, reads every published episode free while signed in to the site or the app with the account that holds the role.

Tax included in prices

Every price is tax-inclusive: what a reader pays is the price as it is entered, and nothing is added at the checkout. Once a Tenant admin sets a Tax rate (%) under Settings › Tax and invoices, each purchase records the rate in effect when it was made and the tax its price includes: the price less the price without tax, which is rounded down to the smallest unit of the currency. A ¥1,100 purchase at 10% includes ¥100, and a ¥500 one ¥46. A purchase keeps what it recorded when the rate changes later, and a purchase made while no rate is set records none.

  • An episode paid with coins records tax on what its coins were paid for, the amount a royalty statement credits, as Royalties describes.
  • A pack of coins records none: its coins are paid in advance, and the tax is recorded on the purchases they pay for.
  • A purchase in the app through the App Store or Google Play records tax as any other does. The store charges the reader and issues their receipt.
  • A subscription payment records tax at the rate in effect when Stripe was paid it.

The receipt the tenant sends for a purchase on the site states the tax and the rate, such as "Tax included (10%): ¥100", and, once they are entered, the tenant's Legal name and Registration number, as Email describes.

While a rate is set, every price the site offers says it includes tax, such as ¥1,100 incl. tax: an episode's price and its campaign price, the price on the buttons that buy or rent it, a volume's price, the price of the rest of a series, and a subscription plan's price. A pack of coins says nothing of tax. Under Purchases on the reader's account, a purchase that recorded tax shows it as Tax included with its rate, such as ¥100 (10%), and, once they are entered, the tenant's Legal name as Issued by and its Registration number. A purchase made through the App Store or Google Play shows its tax alone, because the store issued its receipt. The file Download as CSV saves gains a tax_rate_percent and a tax_amount column when a purchase in it recorded tax.

The app says the same beside the prices it names itself: an episode's price, the price on the buttons that buy or rent it, a volume's price, and the price of the rest of a series. A price the store writes, such as a subscription plan's or a tip's on the store's own payment sheet, says nothing of tax: the store sets what it charges in the reader's country. Under Purchases in the app, a purchase that recorded tax states it, such as Tax included ¥100 (10%), and, once they are entered, the tenant's Legal name and Registration number. A purchase made through the App Store or Google Play shows its tax alone and says which of the two issued its receipt. The file Export as CSV creates gains the same two columns as the site's.

Choosing a payment provider

A tenant takes payment on the site through one provider at a time, chosen under Payment settings on Payments › Payment methods:

ProviderWhat a reader can pay with
StripeThe payment methods turned on for your account in the Stripe Dashboard, such as cards and konbini. An episode bought with a method that is paid later, such as konbini, opens once the payment arrives.
PAY.JPCards, with 3-D Secure authentication on every payment.

Payments are taken in the tenant's currency, chosen under Currency in the same form: every price is entered and shown in it, on the site and in the app as in the console. Currency offers the currencies the chosen provider charges in — PAY.JP charges in yen only — and starts on the platform's default currency, which the install's operators set, until the settings are saved. Choose it before the first sale: once the tenant has a purchase, every price and every sale is an amount in that currency, so Currency can no longer be changed.

The status beside the form says where the setup stands:

  • Not set: no provider has been chosen.
  • Incomplete: payments are on, but a credential the provider needs is missing, so nothing is charged.
  • Disabled: the credentials are stored, but Enable payments is off.
  • Ready: readers can buy.

Until it is Ready, a paid episode shows its price with no way to buy it, and tells readers that the site cannot take purchases at the moment. Choosing another provider and saving deletes the credentials stored for the previous one.

Do the setup below with the provider's test keys first, as Testing before going live describes, and replace them with live keys once a test purchase has gone through.

Stripe

In the Stripe Dashboard:

  1. Copy the secret key from the API keys page. A test key starts with sk_test_, a live key with sk_live_.
  2. Add a webhook endpoint. Its URL is the Webhook URL the console shows under Payment settings once Stripe is chosen, https://<tenant-domain>/api/v1/webhook/payment/stripe on the tenant's own site domain. Select these events, and the ones Subscription plans lists as well if the tenant sells subscription plans:
    • checkout.session.completed
    • checkout.session.async_payment_succeeded
    • checkout.session.expired
    • charge.refunded
    • refund.updated
    • charge.dispute.created
    • charge.dispute.closed
  3. Open the endpoint and copy its signing secret, which starts with whsec_.

Then in the console, under Payment settings:

  1. Choose Stripe as the Payment provider.
  2. Enter the Secret key and the Webhook signing secret.
  3. Under Enable payments, check Enable, and choose Save.

Payment settings with Stripe chosen and nothing saved yet: the Not set status, Payment provider, Enable payments, Secret key, Webhook signing secret, the Webhook URL to register with Stripe, and Save.

Stripe keeps test-mode and live-mode webhook endpoints apart, each with its own signing secret. When you move to live keys, add the endpoint again in live mode, and enter its signing secret together with the live secret key.

Stripe promotion codes

A reader can also enter a promotion code on Stripe's checkout page. These codes are created in the Stripe Dashboard, under the coupons of the same account and mode as the secret key, and nothing is set in the console: every checkout of an episode or a volume takes them. A checkout of the rest of a series sold at a discount does not, and neither does a checkout started with one of the tenant's own promotion codes, since Stripe applies one discount to a checkout, never two.

The purchase records what the reader paid once the code's discount is taken off, which is the amount shown in their Purchase history and the amount a full refund returns, and the price before the code beside it, which is the sale the episode's Authors are paid royalties on: the tenant offered the promotion, so the tenant bears it. A code that takes off the whole price opens the episode with no payment, so there is nothing of it to refund. PAY.JP's checkout page takes no code of its own; the tenant's own codes work with it as with Stripe.

PAY.JP

In the PAY.JP dashboard:

  1. Copy the secret key from the API settings page. A test key starts with sk_test_, a live key with sk_live_, and a test key takes test payments only.
  2. Copy the webhook token, which starts with whook_, from the account settings.
  3. Register the Webhook URL the console shows under Payment settings once PAY.JP is chosen, https://<tenant-domain>/api/v1/webhook/payment/payjp, as the URL PAY.JP sends its notifications to. Register it for live mode as well before going live.

Then in the console, under Payment settings:

  1. Choose PAY.JP as the Payment provider.
  2. Enter the Secret key and the Webhook token.
  3. Under Enable payments, check Enable, and choose Save.

Payment settings with PAY.JP chosen and nothing saved yet: the Not set status, Payment provider, Enable payments, Secret key, Webhook token, the Webhook URL to register with PAY.JP, and Save.

PAY.JP signs nothing: the install trusts a notification because it carries the webhook token, and refuses one that does not, so keep the token as secret as the secret key.

When a payment does not open the episode

The provider's dashboard lists each delivery to the webhook with the status the install answered. Each status points to one cause:

StatusCauseWhat to do
2xxAccepted. Not every accepted notification opens an episode: Stripe sends checkout.session.completed for a konbini payment before the reader pays, and the episode opens only with the checkout.session.async_payment_succeeded that follows the paymentCheck the event type and the payment's status in the dashboard. If the payment is complete and the episode is still locked, the reader may have bought it on another account.
400The signing secret or webhook token in the console does not match the provider'sEnter the value from the endpoint the provider is sending from.
404The path does not name a providerRegister the URL exactly as the console shows it.
503Payments are not Ready, or the URL names a provider other than the one chosenFinish the setup above. The provider retries the delivery.
No deliveryThe webhook is not registered, or is registered for the other modeRegister it in the mode the keys belong to.

Both providers retry a failed delivery for some time, and their dashboards can resend one. Once the setup is fixed, a payment whose notification arrives opens the episode it paid for.

Where episodes are sold

Where episodes are sold, on the same screen, decides where a reader can buy a paid episode. Sold on offers:

  • Web and app: on the site and in the tenant's app.
  • Web only: on the site. The app shows the episode as sold on the website, and opens it once it is bought there.
  • App only: in the app. The site shows the episode as sold in the app, opens it to a reader who bought it there, and links to the app's listing in each store under App Store address and Google Play address.

Where episodes are sold: Sold on, App Store address, Google Play address, and Save where episodes are sold.

A series or an episode can set its own Sold on, and one that sets nothing follows the series, or the tenant, including after either changes. An episode is sold only where it is also shown.

The choice exists because of the app stores. Apple and Google each set rules on how an app may sell digital content, decide in review whether an app follows them, and take a commission on what the app sells through them. A tenant whose app sells through the stores' own payment, as the next section describes, pays that commission on every episode bought in the app, and can keep a series on the site alone with Web only. A tenant with no app, or one that does not sell in its app, chooses Web only for every episode.

Selling in the app

The In-app purchase section decides how the tenant's app sells an episode it may sell, under How the app sells episodes:

  • Web checkout opens the site's checkout in the phone's browser, through the provider above, and brings the reader back to the episode once paid.
  • In-app purchase sells with the App Store's and Google Play's own payment sheet. The store charges the reader and keeps its commission, and the payment provider above is not involved.

The In-app purchase section: How the app sells episodes, then the App Store and Google Play, each with its status, its switch, its key, the app named under App links, and the URL its notifications are sent to, and Save the in-app purchase settings.

With In-app purchase, the app needs no payment provider from Choosing a payment provider: it buys through the store and the install verifies the purchase with the store.

On an episode sold App only, the site shows the episode as sold in the app and links to the stores only while the app can sell it: with Web checkout, while a payment provider is Ready; with In-app purchase, while a store is Ready, and then only to the listing of a store that is. Until then the site quotes the episode's price and tells readers it cannot take purchases. An episode sold Web and app is bought on the site while a payment provider is Ready; while none is and the app can sell it, the site treats it the same way as one sold App only.

In-app purchase can be chosen once at least one store is Ready: turned on with Use the App Store or Use Google Play, with its key entered, and with its app named under Integrations › App links.

The app buys each episode as the store product named after its price, such as episode_300 for a ¥300 episode, so a store sells only the prices it has a product for. While a campaign price is on sale, the price is the campaign's: an episode on sale from ¥500 to ¥300 is bought as episode_300 and recorded at ¥300. A promotion code works the same way: an episode of ¥500 bought with a code of 10% off is bought as episode_450. Store products, at the bottom of the screen, lists the product ID every price your app sells at needs, the price of every campaign that is scheduled or on sale included, and each of those prices less the discount of every code that applies to the episode and is neither paused, deleted, nor past its end, a code that has not started yet included. It counts an episode under each of its prices. Create each one in App Store Connect and in Play Console as a consumable product at that price, and add one whenever a new price appears in the list, which for a campaign is as soon as it is scheduled and for a code as soon as it is created, so its product is ready before it starts. A code that takes the whole price off needs no product, since such a purchase is recorded without the store. The app refuses a code whose discounted price is not on the list.

While tips are on, each tip amount is listed there too, below the prices, as tip_ followed by the amount, such as tip_300 for a tip of ¥300, and is created the same way, as a consumable at that amount.

Each pack of your coins on sale is listed there too, as coins_ followed by the pack's ID, with the coins and bonus coins it grants, and is created the same way, as a consumable at the pack's price. The stores show a product under the name you give it in App Store Connect and Play Console rather than one Publira sends, so name each pack's product with your word for your coins, in every language your app is listed in.

Below them, under Subscription plans, each subscription plan that names an App Store product ID or a Google Play product ID is listed with what it bills every period and the product ID of each store, or Not sold for a store it names none of. A plan is not a consumable: create it as an auto-renewable subscription in App Store Connect, inside a subscription group, and as a subscription with a base plan in Play Console, at the plan's price and billing period. The IDs are entered on the plan, and the list follows them.

Store products: the product ID each price needs, such as episode_500 at ¥500, with a button to copy it and the number of episodes at that price.

What each store needs, from the key the install verifies purchases with to testing with the stores' test buyers, is on In-app purchase and sign-in, with the app's own setup. A purchase from the App Store sandbox or a Play license tester opens the episode but is recorded as a test, and left out of royalty statements and the content statistics.

An episode a reader saved in the app keeps opening on that device without a network for up to seven days after the app last opened it online, so a refund closes a saved episode within that time rather than at once, as Offline reading describes. The next time the app opens it online, it is locked and deleted from the device.

Entering a code in the app

A reader enters a code in the app where they do on the site: on a locked episode, and once in the volumes section of a series, where it applies to every volume they can still buy. While the tenant holds a code that is neither paused, deleted, nor past its end, a signed-in reader finds Promotion code and Apply there. A guest sees them once they sign in. With In-app purchase the volumes section offers no field, since a store sells no volume, and the rest-of-series offer takes no code.

Each button the code applies to then names the discounted price, with the price before the code struck through beside it, and a button it does not apply to keeps its price. With Web checkout, the button opens the site's checkout in the phone's browser at that price. With In-app purchase, it opens the store's payment sheet for the product of that price, and a code that takes the whole price off opens no sheet. The app keeps a code while the screen is open, until a campaign price it was quoted against ends, and emptying the field and choosing Apply takes it off.

A code that does not work is refused under the field, as When a code is refused lists, and the button keeps its price. With In-app purchase, a code whose discounted price the store has no product for is refused too, and the app tells the reader to use it on the website, where it works.

Purchases in the app shows the price before the code struck through beside what the reader paid, and names the code.

Tips

A reader who has finished an episode can give its Authors one of the amounts the tenant offers, at the end of the episode, on the site and in the app. The Tips section, between In-app purchase and Store products, sets whether they can and what they can give:

  • Take tips for Authors offers the amounts at the end of every episode. Turned off, no tip is offered, and the amounts are kept for when it is turned on again.
  • Tip amounts are up to six amounts in the tenant's currency, each above 0, one per field. Add an amount adds a field, and the button beside a field removes it; pasting several lines into a field adds a field for each. Readers are offered the amounts in ascending order, which is the order Save tip settings stores them in.

The Tips section: Take tips for Authors turned on, Tip amounts of 100, 300, and 1000 with a button to remove each, Add an amount, and Save tip settings.

The form refuses a seventh amount, an amount entered twice, and 0, and turning tips on with no amount, and says what to correct under Tip amounts. Each save is recorded in Audit logs as Tip settings updated.

A tip opens nothing to read. It is split among the episode's credited Authors by their shares, as a sale of the episode is, and reaches their royalty statements on lines of its own, so tips are told apart from sales. Promotion codes do not apply to it.

A tip is paid the way the episode would be bought:

  • On the site, through the payment provider, so the site takes tips only while one is Ready, as Choosing a payment provider describes.
  • In the app, through the same provider in the phone's browser with Web checkout, and through the store with In-app purchase, as the product of its amount that Store products lists. The app tells a reader that an amount whose product the store does not have cannot be given in the app, so create each product in App Store Connect and in Play Console when you add its amount.

On the site, a reader who has turned past the last page of an episode finds Tip the Authors beside the reaction button. It opens a dialog naming the episode's Authors, with each of the tenant's amounts as a button, and pressing one takes the reader to the payment provider's checkout page. A reader who is not signed in is sent to sign in and back to the episode. Coming back from the checkout page, the episode thanks them, and the tip is recorded when the provider's notification reaches the install. A reader can tip the same episode again, whatever they hold of it. A reader the episode credits is offered no tip, and one they try to give is refused.

The page after an episode's last page: the reaction button with Tip the Authors beside it, above the offer of the next episode.

The Tip the Authors dialog: what a tip is, the Author it goes to, and a button for each of ¥100, ¥300, and ¥1,000.

Purchase history lists a tip under the episode it was given on, as Tip, with what was given and no reading period. Download as CSV writes it with tip in its item column and the columns of that episode filled.

Purchase history: a tip on an episode, of type Tip, with when it was given and the amount, and no expiry.

Payments › Purchases lists a tip under its episode, marked Tip, and it is refunded as a purchase is, as Refunding from the console describes. A refund takes it off the Authors' tips, as it takes a refunded sale off their sales.

A tip paid in the provider's test mode, from the App Store sandbox, or by a Play license tester is recorded as a test and left out of royalty statements, as a purchase is.

Promotion codes

A promotion code of the tenant's own is a word a reader enters when they buy an episode or a volume, for a discount on it. The install takes the discount off before the payment provider or the store is reached, so the provider or the store charges the discounted price without being told about the code: a code works with Stripe, PAY.JP, the App Store, and Google Play alike, and nothing is set up for it in any of them. The codes are issued under Payments › Promotion codes, which only a Tenant admin sees.

What a code holds

  • Code is what readers enter: 1 to 32 letters and digits, with no spaces. A reader can type it in any case, and the console shows it in capitals. Two codes of the tenant that are not deleted cannot be spelled the same, whatever their case.
  • The discount is Percent off, a whole percentage from 1 to 100 of the price, what it comes to rounded down to the smallest unit of the currency, or Amount off, an amount in the tenant's currency. It is taken off the price the episode or the volume sells at when the reader buys, a campaign price while one is on sale, and never takes it below zero: 100 percent, or an amount at or above the price, makes the purchase free.
  • Applies to is the Whole catalog, a label, a series, a volume, or an episode. A code applies to buying an episode, to renting one, and to buying a volume, and never to the rest of a series, a subscription plan, a pack of coins, or a tip. A code on a label or a series applies to its episodes and its volumes alike. A code on a volume applies to buying that volume, and not to its episodes bought one by one; a code on an episode applies to that episode, and not to a volume that holds it. A code whose label, series, volume, or episode is later removed applies to nothing.
  • Starts and Ends are when the code works, in the tenant's time zone. Leave either empty for no bound.
  • Total redemptions is how many purchases the code may discount in all, and Per reader how many one reader may make with it. Leave either empty for no limit.

The code, its discount, and what it applies to are fixed once it is created. To change them, delete the code and create another, which can take the same name. Starts, Ends, and the two limits can be changed at any time.

Creating a code

  1. Open Payments › Promotion codes and choose Create promotion code.
  2. Enter the Code.
  3. Choose Percent off and enter the Percentage, or Amount off and enter the Amount.
  4. Under Applies to, choose what the code applies to. For a label or a series, pick it; for a volume or an episode, pick its series first, then the volume or the episode.
  5. Set Starts, Ends, Total redemptions, and Per reader if the code needs them, and choose Create promotion code.

The Create promotion code form: Code, the discount as Percent off or Amount off, Applies to, Starts and Ends, Total redemptions and Per reader, and Create promotion code.

The form refuses, and says so beside the field, a code spelled like another code of the tenant's, a code with anything but letters and digits, a percentage outside 1 to 100, an amount of zero, an Ends at or before Starts, and a label, series, volume, or episode that has been removed since the form was opened. Once created, the code opens beside the list.

Watching, pausing, and deleting a code

The list shows each code, newest first, with its discount, what it applies to, when it is valid, how many purchases it has discounted against its limit, and its status:

  • Active: readers can use it.
  • Scheduled: its Starts has not come yet.
  • Paused: it was paused, and is refused until it is resumed.
  • Ended: its Ends has passed, whether or not it is paused.

View opens a code beside the list with its terms, and under them Redemptions: every purchase it discounted, newest first, with the reader, what they bought, its Price before the code, what they Paid, and when. The title opens the purchase under Purchases, which shows the same Price and Paid and the Promotion code that was applied.

A promotion code beside the list: its status, discount, what it applies to, when it is valid, its redemptions against its limit and per reader, Edit, Pause, and Delete, and under them the redemption of a reader who paid ¥450 for a ¥500 episode.

  • Edit changes Starts, Ends, Total redemptions, and Per reader, and nothing else.
  • Pause refuses the code to every reader, as a code that does not exist is refused, until Resume opens it again. A paused code keeps its name.
  • Delete refuses the code from then on, once you confirm it, and frees its name for another code. The purchases it discounted and its redemptions keep its name. A deleted code cannot be restored.

Creating, editing, pausing, resuming, and deleting a code are each recorded in Audit logs.

Entering a code on the site

A reader enters a code on the page of the episode they are buying, or once in the volumes section of a series, where it applies to every volume listed. While the tenant holds a code that is neither paused, deleted, nor past its end, a signed-in reader finds Promotion code under the episode's purchase buttons and above the volumes. A guest sees it once they sign in, and a tenant with no such code shows no field. The rest-of-series offer takes no code.

The reader enters the code and chooses Apply. Each button the code applies to then names the discounted price, with the price before the code struck through beside it, and starts the checkout at that price: the payment page charges it and offers no code input of its own. A button the code does not apply to keeps its price. The code stays applied when the page is reloaded, and emptying the field and choosing Apply again takes it off.

Back from the payment page of an episode, the episode says what the reader paid, with the price before the code struck through beside it and the code named. Purchase history under Purchases shows the same for an episode or a volume.

When a code is refused

A code that does not work is refused before the reader pays, and the reader is told why under the field:

  • No code of the tenant is spelled that way, or the code is deleted, paused, or has not started.
  • The code has ended.
  • The code does not apply to what the reader is buying.
  • The code has reached its Total redemptions, or the reader has made as many purchases with it as Per reader allows.
  • The reader has entered codes too many times in a short while, and is asked to wait and try again.

When a code is redeemed

A code is redeemed when its purchase is recorded, not when the reader starts the checkout, so a checkout the reader abandons spends nothing. The limits are checked when a checkout starts, so checkouts already started when a code reaches a limit can still be completed, and the code can end up redeemed more times than its limit.

A code that takes the whole price off records the purchase at once, with no payment and no payment page: the episode or the volume opens as soon as the reader confirms, and the purchase shows No payment under Purchases. There is nothing of it to refund.

The episode's Authors are paid royalties on the price before the code, as Royalties describes: the tenant offered the promotion, so the tenant bears it. A purchase in the app with a code is a purchase like any other, and Selling in the app describes the store products its discounted price needs.

Refunds

A purchase on the site is refunded from the console, as Refunding from the console describes, or in the Stripe or PAY.JP dashboard. A purchase in the app is refunded by Apple or Google. Publira does not tell the reader either way.

  • A full refund closes the episode to the reader. The purchase stays in their Purchase history, marked Refunded, and they can buy the episode again.
  • A partial refund leaves the episode open until the refunds on the payment add up to what the reader paid. It still lowers the sales the episode's Authors are paid royalties on.

A purchase a promotion code discounted, one of the tenant's or one entered on Stripe's checkout page, is refunded at most what the reader paid. Its Authors are paid on the price before the code, so a refund of part of it takes the same share of that price off their sales: refunding half of what the reader paid takes off half of the price before the code. A purchase a code made free took no payment, so there is nothing to refund, and the console offers no refund for it.

Each refund reaches the install the way its purchase did:

  • Stripe and PAY.JP report it through the webhook above, which is why Stripe's endpoint needs charge.refunded. A refund the provider accepted can still fail later, for example when the reader's card has been closed; the provider reports that too, through refund.updated on Stripe, and the episode opens to the reader again unless what stays refunded still adds up to what the reader paid.
  • The App Store reports it to the App Store Server Notifications URL the console shows in the App Store section, which is registered in App Store Connect as both the Production and the Sandbox Server URL.
  • Google Play reports it to the Google Play real-time developer notifications URL the console shows in the Google Play section, through the Pub/Sub push subscription In-app purchase and sign-in describes. The install also reads Google Play's voided purchases once an hour, for the last 30 days, which applies a refund whose notification never arrived; without the notifications, a refunded purchase can keep its episode open for up to an hour. That reading runs in publira worker, which the operator keeps running, as Overview describes.

A refund that arrives before the purchase it reverses is kept, and applied when the purchase is recorded.

Refunding from the console

Payments › Purchases lists the tenant's purchases, newest first, and narrows them by the reader's email address, the series, the episode, and the days they were made on, in the tenant's time zone. View opens a purchase beside the list with what the reader paid, where they paid it, and what has been refunded so far. A purchase that recorded tax shows it under its amount in the list, such as Includes ¥100 tax, and as Tax included, with its rate, beside the list. A rental is marked Rental under its episode, and a tip Tip. Only a tenant admin sees the screen.

A purchase of a pack of coins is listed there as the coins it granted, in the tenant's word for them in its default language, and with no series, so narrowing the list to a series or an episode leaves it out. It is refunded like any purchase, except that it is always refunded in full, so the dialog asks for no amount. Its coins stay with the reader until the provider reports the refund in full, or a dispute of the payment: then what the pack has left is taken back, and what of it the reader had already spent is recorded as owed, and taken out of the next pack they buy. The episodes those spent coins paid for stay open, and each of their purchases shows what the coins were worth as refunded.

A purchase of an episode paid with coins shows Paid with coins where the others name the provider, and as its price what the coins spent were worth, which is the sale its Authors are paid royalties on, as Royalties describes. The reader sees the coins they spent, and no price.

Refund asks the provider the reader paid through to give back the Amount to refund, in the tenant's currency, once you have written a reason; the reason is recorded in the audit log with the refund. The amount starts at all that is left to refund, and the dialog says, as you change it, whether the episode stays open to the reader or closes.

  • All that is left closes the episode to the reader at once, and the purchase shows Refund requested until the provider reports the refund through the webhook, when it shows Refunded. A refund the provider refuses, or one that fails after the provider accepted it, opens the episode to the reader again.
  • Less than that leaves the episode open to the reader. The purchase shows Refund requested, with the amount beside it, until the provider reports the refund, when it shows Partly refunded and the amount is added to what has been refunded. Until then the purchase can be refunded again only for that same amount, which is how you ask again when the request did not reach the provider. A refund the provider refuses takes the request back. Once the provider has reported it, refund the rest to close the episode, as above.

The console offers no refund for a purchase made in the app, one the reader disputed with their bank, or one paid through a provider the tenant no longer takes payments through: refund those where the reader paid. Nor does it offer one for a purchase paid with coins, which took no payment: the money is the pack's, and refunding the pack is what takes it back.

Disputes

When a reader disputes a Stripe payment with their bank, Stripe reports it through the same webhook, which is why its endpoint needs charge.dispute.created. The episode closes to the reader as soon as the dispute is opened, whichever way the bank later decides it, and the purchase stays in their Purchase history, marked Canceled. Respond to the dispute in the Stripe Dashboard; nothing is done in the console.

How the bank decides changes only the royalty statement, which learns of the decision through charge.dispute.closed:

  • A dispute decided for you leaves the payment with you, so the purchase stays a sale. The episode stays closed to the reader.
  • A dispute decided against you returns the payment to the reader, so the purchase stops being a sale, as a full refund does. When the month it was bought in is already closed, the next statement takes it back as an adjustment, as Royalties describes for a refund.

Abandoned checkouts

A reader who leaves the payment page without paying can start the purchase again at any time. Once Stripe reports the abandoned checkout expired, which is why its endpoint needs checkout.session.expired, the reader's next attempt opens a new payment page instead of the expired one.

Reconciling with the provider

Royalty statements and Revenue count the purchases the install recorded, and nothing else. A notification that never arrived, a refund that matched no purchase, or a store purchase the app never confirmed leaves those figures apart from what the provider or the store actually charged. A reconciliation compares the two sides over a period of your days, and lists every line that matches nothing on the other side. It reads the provider's and the stores' records with the credentials saved under Payments › Payment methods, and changes nothing in them or in the purchases: what to do about a line is yours to decide, in the provider's dashboard or in the console.

Payments › Reconciliation is where a reconciliation is started and read, and only a Tenant admin sees it. Choose the days with From and To, which start at the last whole month and end today at the latest, and select Reconcile.

A reconciliation of a period runs against every source the tenant has Ready: its payment provider, the App Store, and Google Play, each as a run of its own. The worker takes a run up within seconds and finishes it once it has read the source's records of the period, which for a long period of a busy tenant takes a while. Running the same period again replaces the last run of it, unless that one has not finished yet.

The list shows each run with its status, Waiting, Running, Finished, or Failed, and refreshes itself while a run is unfinished. A finished run counts the payments the source recorded in the period, the purchases recorded in it, how many of the two matched, and the findings left over. A failed run says why: the source's credentials are not saved or were refused, which is fixed under Payments › Payment methods before reconciling again, or the source could not be read, which a later run of the period may get past.

Each source is read where it keeps its records:

  • Stripe: the account's balance transactions, each matched by the payment intent the purchase records. A payment that paid a subscription plan's invoice is not a purchase, and is left out.
  • PAY.JP: the account's payment flows, and the refunds made on them.
  • The App Store: the transaction history of every customer the tenant has an App Store purchase from in the period. Apple keeps a history per customer and none for the whole app, so a purchase by a customer whose every purchase the app failed to record is one the reconciliation cannot see.
  • Google Play: each of the tenant's Google Play purchases of the period, with its order, and Google Play's voided purchases. Google Play lists no other purchases, and keeps the voided ones for 30 days, so a purchase the app failed to record shows up only once it is refunded within that time.

A run lists these lines as its findings:

  • Payment with no purchase: the source took the payment, and no purchase records it. This is what a payment whose notification never reached the install looks like. The line names the source's own ID of the payment, a payment intent on Stripe, a payment flow on PAY.JP, a transaction on the App Store, and a purchase token on Google Play, so it can be found in the source's dashboard.
  • Purchase with no payment: a purchase of the period that the source has no record of.
  • Amount differs: a purchase and its payment that disagree on the amount, on the currency, or on what has been refunded. A store charges the reader in their own currency, so for a store the amounts are compared only when it charged in the tenant's currency, and otherwise only whether the payment was refunded.
  • Held refund or Held dispute: a refund or a dispute that arrived for a payment no purchase named, and has been waiting for its purchase since before the period began. One that finds its purchase is applied then, as Refunds describes, so one still waiting points to a purchase that was never recorded.

A purchase is dated when the install recorded it, which follows the payment by however long its notification took, so each source is read from a day before the period to a day after it. A payment taken late on the last day of the period still meets the purchase recorded the next morning, and neither side's lines outside the period are listed.

Payments made in the provider's test mode or the stores' sandboxes are matched only with test purchases, and listed apart from the live ones. A held refund or dispute names no mode, and is listed with the live lines.

View on a run opens its findings beside the list, which can be narrowed to one kind and to Live or Test. Each finding shows the Payment ID at the source, the Purchase amount, and the Amount at the source, each with what of it has been refunded. A finding about a purchase has Open the purchase, which opens it under Purchases.

Downloading the purchases

Download CSV on Payments › Purchases saves the purchases of the period the From and To filters name as a CSV for your accounting: one row for each purchase made in the period, and one for each refund dated in it, each with the provider's and the store's IDs the purchase carries. A file covers at most 366 days, so without To it ends today, and without From it starts 366 days before its end. The reader, the series, and the episode filters are not applied to it. A refund in full is dated when it reached the install; a refund in part carries no date of its own, so it is listed with the period its purchase was made in. A purchase paid with coins, or granted without a payment, charged the reader nothing, and is not in the file. Each download is recorded in Audit logs.

Testing before going live

Test the whole setup with the provider's test keys before readers can pay: the webhook is the part that most often goes wrong, and only a purchase shows that it works.

A purchase made in the provider's test mode opens the episode but is recorded as a test, and left out of royalty statements and the content statistics. The reader still gets a receipt by mail, which says that the purchase was made in test mode and that no money was charged. The console cannot delete an episode, so keep the test in a series of its own, which you hide afterwards.

  1. Set up the provider with its test secret key, and register the webhook in test mode, as above. Check that Payment settings shows Ready.
  2. Create a series for the test, shown on Web and app or Web only and published now. In it, create an episode with a Price such as 100 and a Reading period such as 1, published now, and sold on the web.
  3. On the site, sign in with a reader account that holds no console role, open the episode, and choose Buy this episode.
  4. Pay with a test card. 4242 4242 4242 4242, with any future expiry date and any three-digit security code, works with both providers. PAY.JP then shows its test 3-D Secure screen, where you choose the outcome.
  5. Back on the episode, wait for it to open, then check that it is listed under Purchases. If it does not open within a minute, read the delivery in the provider's dashboard, as When a payment does not open the episode describes.
  6. Refund the purchase from Payments › Purchases, or the payment in full from the provider's dashboard, which proves that refunds reach the install too. Reload the episode: it is locked again, and Buy this episode is back.

When both pass, set the test series' Shown on to Not shown anywhere. Then replace the test secret key with the live one, register the webhook in live mode, enter its signing secret or token, and save.

To test in-app purchase, use the stores' own test buyers as Testing a purchase describes. Those purchases are recorded as tests as well.