palbaseDocs

Palbase IAP · API

PUT/iap/settings

Change the settings

Changes the settings given — whether a store's test purchases open entitlements, ending a deleted user's renewing web subscriptions, where the quotas' calendar windows begin, the charts' reporting currency, store commission and Stripe fee — and leaves the others as they are.

Called by your server, with the project's secret key.

Headers

Idempotency-Keystring · optionalMakes the write safe to send again (at most 255 characters). A retry with the same key and the same request gets the first answer back, marked `Idempotent-Replayed: true`, and changes nothing; the same key with a different request is refused with 422, and while the first request still runs a retry gets 409 with Retry-After. Answers are kept for 24 hours.

Request body

app_store_link_attribution_daysinteger · optionalFor how many days after the link a purchase owes the App Store its fee (7 unless set), 1 to 90: a subscription's renewals past them owe none.
app_store_link_fee_bpsinteger · optionalWhat the App Store takes of a web purchase bought through a link out of an iOS app in its United States storefront (a checkout whose source is ios, USA), which the charts' proceeds take off: its share in basis points of the price net of tax (0 unless set: it takes nothing today, Guideline 3.1.1(a); a court is deciding what it may), up to 3000.
reporting_currencystring · optionalThe currency the charts report money in: every amount converted at the European Central Bank's reference rate of the day it was paid (USD unless set). One the Bank published a rate of in the last ten days. The ledger keeps what was paid as it was paid: changing it changes every chart from its first day.
sandbox_access"everyone" | "allowlist" | "nobody" · optionalWhether a store's test purchases — Apple's sandbox (where App Review and TestFlight buy), Google Play's license testers, Stripe's test mode — open entitlements here: everyone, only the customers on sandbox_allowlist, or nobody.
sandbox_allowliststring[] · optionalThe customers whose test purchases open entitlements when sandbox_access is allowlist.
store_commission"standard" | "small_business" · optionalThe share the App Store and Google Play keep, which the charts' proceeds take off: standard (30%; 15% of a subscription's renewals after its first paid year in the App Store, and of every subscription on Google Play) or small_business (15%: the App Store Small Business Program, Google Play's first million). standard unless set.
time_zonestring · optionalWhere the quotas' calendar windows (a day, a month) begin: an IANA name such as Europe/Istanbul.
web_fee_bpsinteger · optionalStripe's fee of a payment, which the ledger does not hold, as the charts' proceeds take it off: its share in basis points (290 is 2.9%, unless set), up to 2000.
web_fee_fixed_currencystring · optionalThe currency of Stripe's fixed fee (USD unless set): one the European Central Bank published a rate of in the last ten days.
web_fee_fixed_microsinteger · optionalAnd its fixed part, in micro-units of stripe_fee_fixed_currency (300000 is 0.30, unless set).
web_tax"none" | "managed" · optionalHow the web's (Stripe Checkout's) sales are taxed: none (none unless set) — Checkout works out no tax — or managed — Stripe Managed Payments: Stripe is the merchant of record, works out, collects and files the tax, invoices the buyer and takes their refunds and disputes. The Stripe account turns Managed Payments on first (Dashboard › Settings › Managed Payments), and every web product needs an eligible tax code (the catalog's web channel's tax_code).
curl
curl -X PUT "https://<your-ref>.palbase.studio/iap/settings" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"app_store_link_attribution_days":1,"app_store_link_fee_bps":0,"reporting_currency":"string","sandbox_access":"everyone","sandbox_allowlist":["string"],"store_commission":"standard","time_zone":"string","web_fee_bps":0,"web_fee_fixed_currency":"string","web_fee_fixed_micros":0,"web_tax":"none"}'

Responses

200The settings

400A field is out of its bounds (`invalid_sandbox_access`, `allowlist_too_long`, `invalid_time_zone`, `invalid_store_commission`, `invalid_stripe_fee`, `invalid_app_store_link_fee`, `invalid_web_tax`), a currency is not one the European Central Bank publishes (`unsupported_currency`), or the body is not the request (a field it does not know)

401No key, not a key of this project, or a token that is not valid (the edge's answer)

403Not the project's secret key (`secret_key_required`)

409web_tax managed while a product sold on the web has no tax code (`tax_code_missing`, naming them), or a request with this Idempotency-Key is still running (`idempotency_key_in_use`, Retry-After)

413The request body is too large (`request_too_large`)

422The Idempotency-Key was sent with a different request (`idempotency_key_reused`)

429Over the project's request limit; Retry-After says when to try again

503Temporarily unavailable; retrying is safe after Retry-After

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation UpdateSettings of iap's contract.