Skip to content
Console
On this page

Store purchases

A Store Purchase is one store transaction Money verified with the store and bound to one subject.

A Store Purchase is one store transaction Money verified with the store and bound to one subject. Re-verifying it returns the same record and grant.

Service Sylphx Money · Resource type money.sylphx.com/StorePurchase · Name pattern orgs/{org}/projects/{project}/envs/{env}/store_purchases/{store_purchase} · Shape record

Fields

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/store_purchases/{store_purchase}.
uidstringspu_<cell><ulid>; never reused. Output only.
metaResourceMetaResource metadata.
subjectSubjectWho it belongs to. Output only.
storestringapp_store or google_play. Output only.
product_idstringThe store product id. Output only.
productstringThe catalog product it sells, when the catalog maps the store product. Output only.
bundle_or_packagestringThe bundle id or package name. Output only.
transaction_idstringThe store's transaction id (App Store transaction id, Play order id). Output only.
original_transaction_idstringThe first transaction of a subscription or restored purchase. Output only.
quantityint32Units bought. Output only.
environmentstringproduction or sandbox. Output only.
statestringpurchased, pending, or revoked. Output only.
purchase_timetimestampWhen the store says it was bought. Output only.
revoke_timetimestampWhen the store refunded or revoked it. Output only.
pricestringThe price the store charged, in minor units of currency, when the store reports it. Output only.
currency_codestringISO 4217 currency of price. Output only.
customer_subscriptionstringThe subscription it belongs to, for a subscription purchase. Output only.
region_codestringISO 3166-1 alpha-2 country of the buyer's storefront, upper case; empty when the store did not report one. Output only.
original_purchase_timetimestampWhen the store says the first purchase of this subscription or restored purchase was made; unset when it did not report one. Output only.
claw_backboolRevoked after it was delivered, and its goods come back: its entitlements ended, and the app takes back the assets its grant credited, up to what the subject still holds. False while it stands, and for a refund the catalog's refund_claw_back lets the subject keep. Output only.

Methods

Every method of the collection, in the registry's order, with the scope it needs. The full request, response and examples are one link away.

MethodCallWhat it does
POSTverifyVerifies a store purchase with the store, binds it to the subject, and returns its record and a signed grant. Re-verifying returns the same record and grant. Called from the app's server with a secret key that holds billing:write; a publishable key cannot call it.
POSTclient_verifyVerifies a store purchase for an app with no server: called with the environment's publishable key (billing:client), the subject is an install id (inst_ and a UUID), and Money completes the purchase with the store (acknowledges or consumes it) so the app never calls the store's server API. Works only on store connections that set client_verify. Re-calling returns the same record and grant.
GETgetGets a store purchase.
GETlistLists store purchases, newest first.
POSTreport_usageReports verified delivery and usage facts for an App Store purchase in answer to an observed CONSUMPTION_REQUEST. Strictly fails closed (0 outbound Apple calls) unless Money's append-only buyer-authenticated consent ledger holds an unwithdrawn granted decision for this purchase or app.

verify

Verifies a store purchase with the store, binds it to the subject, and returns its record and a signed grant. Re-verifying returns the same record and grant. Called from the app's server with a secret key that holds billing:write; a publishable key cannot call it.

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/store_purchases:verify · scope billing:write · effect write · validate_only · Request, response and examples

client_verify

Verifies a store purchase for an app with no server: called with the environment's publishable key (billing:client), the subject is an install id (inst_ and a UUID), and Money completes the purchase with the store (acknowledges or consumes it) so the app never calls the store's server API. Works only on store connections that set client_verify. Re-calling returns the same record and grant.

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/store_purchases:clientVerify · scope billing:client · effect write · callable with a publishable key · Request, response and examples

get

Gets a store purchase.

GET https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/store_purchases/store-purchase · scope billing:read · effect read · Request, response and examples

list

Lists store purchases, newest first.

GET https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/store_purchases · scope billing:read · effect read · paginated · Request, response and examples

report_usage

Reports verified delivery and usage facts for an App Store purchase in answer to an observed CONSUMPTION_REQUEST. Strictly fails closed (0 outbound Apple calls) unless Money's append-only buyer-authenticated consent ledger holds an unwithdrawn granted decision for this purchase or app.

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/store_purchases/store-purchase:reportUsage · scope billing:write · effect write · Request, response and examples