Skip to content
Console
Menu

Getting Started

Authentication

KV Store

Sync a price catalog

Pushes the catalog to the merchant account's processor now: products and prices by lookup key; an amount change makes a new price.

Pushes the catalog to the merchant account's processor now: products and prices by lookup key; an amount change makes a new price.

  • Path POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/price_catalogs/price-catalog:sync
  • Scope billing:write
  • Effect write — a successful call changes state.
  • Collection price_catalogs

#Request

FieldTypeWhat it is
namestringThe catalog to push. Required.

#Response

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/price_catalogs/default.
uidstringcat_<cell><ulid>; never reused. Output only.
metaResourceMetaResource metadata.
specCatalogSpecDesired state. Required.
statusCatalogStatusObserved state. Output only.

#ResourceMeta

FieldTypeWhat it is
generationint64Increases by one on every change to spec. Output only.
etagstringStrong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as If-Match or etag to make Update and Delete conditional; a mismatch fails with ABORTED / 409 ETAG_MISMATCH. Output only.
create_timetimestampWhen the Resource was created. Output only.
update_timetimestampWhen the Resource last changed. Output only.
delete_timetimestampSet while the Resource is being deleted. Output only.
labelsmap<string, string>Caller-writable, indexed labels (AIP-122 label rules).
annotationsmap<string, string>Caller-writable, unindexed annotations.
display_namestringCaller-writable human-readable name.
creatorstringThe principal that created the Resource. Output only.

#CatalogSpec

FieldTypeWhat it is
featuresFeature[]What an entitlement can grant.
productsProduct[]What is sold.
client_grant_ttldurationHow long a signed store-purchase grant is valid, from the moment it is issued; a client re-verifies to renew it. Default 7 days, 1 hour to 30 days.
refund_claw_backboolWhether a delivered one-time purchase whose money the store or processor takes back (a refund, a void, a chargeback) gives back its goods: its entitlements end, and the refund event asks the app to take back the assets it granted, up to what the subject still holds. Applies once the project is enabled for take-backs, to refunds dated from then on; unset then means on.

#CatalogStatus

FieldTypeWhat it is
observed_generationint64The generation this status was computed from. Output only.
conditionsCondition[]Synced, Reconciling, Stalled. Output only.
sync_timetimestampWhen the processor last matched the spec. Output only.
processor_price_idsmap<string, string>The processor object behind each price, by lookup key. Output only.

#Feature

FieldTypeWhat it is
keystringThe key the app checks; ^[a-z][a-z0-9_.]{0,63}$. Required.
kindFeatureKindboolean (on or off) or limit (a numeric allowance). One of boolean, limit.
display_namestringShown to people.

#Product

FieldTypeWhat it is
keystringThe product key; ^[a-z][a-z0-9_]{0,63}$. Required.
display_namestringShown on checkout and invoices. Required.
descriptionstringShown on checkout.
featuresmap<string, string>Feature grants: a feature key and, for a limit feature, the allowance as a decimal string; true for a boolean feature.
pricesPrice[]The product's prices.
store_product_idsmap<string, string>Store product ids that sell this product, by store (app_store, google_play).
consumableboolWhether one purchase is used up (a pack of game currency) rather than kept (an unlock or a subscription).
grantsmap<string, string>What one unit grants in the app's own assets, by asset code, as decimal strings, for example {"GEMS": "650"}. Carried in the signed grant so the app's server credits exactly this.
licenceLicencePolicyThe offline licence a paid one-time purchase carries; refused on a consumable product and on a product with a recurring price.

#Condition

FieldTypeWhat it is
typestringThe condition type, for example Ready.
statusConditionStatusWhether the condition holds. One of true, false, unknown.
observed_generationint64The generation this observation was made against.
reasonstringA machine-readable UpperCamelCase reason.
messagestringA customer-safe human-readable message.
severitySeverityHow severe a FALSE condition is. One of info, warning, error.
transition_timetimestampWhen status last changed.

#Price

FieldTypeWhat it is
keystringThe lookup key the app uses; ^[a-z][a-z0-9_]{0,63}$, unique in the catalog. Required.
recurring_intervalstringUnset for a one-time price; day, week, month, or year.
recurring_interval_countint32Intervals per period; default 1.
unit_amountsmap<string, string>Unit amount per ISO 4217 currency code in upper case, as a decimal string of minor units, for example {"USD": "499", "GBP": "399"}. The processor's base currency is default_currency when set, else the first currency in code order. Required.
tax_behaviorstringinclusive (the amount includes tax) or exclusive.
trial_daysint32Free trial days for a recurring price.
archivedboolWhether checkout may sell this price.
default_currencystringThe processor's base currency: an upper-case ISO 4217 code that is a key of unit_amounts. Unset uses the first currency in code order. Changing it creates a new processor price under the same lookup key, because the base currency is immutable there.

#LicencePolicy

FieldTypeWhat it is
schemestringThe token scheme; sylphx-offline-ed25519-v1. Required.
planstringThe plan the token carries. Required.
token_productstringThe product the token carries (what the client checks it against). Required.
keystringThe id of the LicenceKey that signs new terms. Required.
termLicenceTermHow long one purchase lasts. Required.

#Errors

  • UNAUTHENTICATED — No valid key or token was presented.
  • PERMISSION_DENIED — The key lacks the method's permission.
  • RESOURCE_NOT_FOUND — The named Resource does not exist or is not visible.
  • INVALID_STATE — The Resource is in a state that forbids the call.
  • UNAVAILABLE — The Resource store, the owning service's backend, or the key verifier's snapshot is unavailable; retry after Retry-After.

Every error arrives in the body Errors describes.

#Examples

curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/price_catalogs/price-catalog:sync" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'