Sell from your app
Link out from your iOS, Android, or React Native app to checkout and back, with the stores' rules applied for you.
Sell from your app with the same catalog, checkout, entitlements, and reports as your website. Link-out sends customers from the app to checkout in the browser and back again, and the SDK applies the stores' rules, so you don't track them yourself.
How link-out works
A link-out purchase goes through these steps:
- Your server creates the session and receives a short-lived checkout URL. It carries no personal data, and your server can request a new one if it expires.
- The app opens the URL. Checkout opens in the system browser by default, and in Custom Tabs on Android.
- The customer pays, then taps Return to app.
- The payment webhook notifies your server that the customer paid. It's the proof of payment. Fulfill from it, not from the customer's return.
Create the session for a link-out
Your server creates a checkout session with return_url set to your app's return link, and client_state set to the value the SDK gave the app. The return link's domain must differ from the checkout's. Set duration, in minutes, to at least 30. Amounts are in the smallest currency unit, so 999 is $9.99 USD.
curl https://api.sandbox.pay.com/v1/checkout \
-u ':sk-pay-com-sandbox-…' \
-H "Content-Type: application/json" \
-H "idempotency-key: $(uuidgen)" \
-d '{
"mode": "payment",
"customer_reference_id": "cust-jane-doe-001",
"line_items": [{ "price": "prc_691180281980665856", "quantity": 1 }],
"return_url": "https://app.example.com/pay/return",
"client_state": "Xq7Lm2Nv9Rt4Kp8Wz3Bc5D",
"duration": 30
}'{
"id": "cs_691229731271139328",
"resource": "checkout_session",
"mode": "payment",
"status": "open",
"url": "https://checkout.pay.com/a/Nf4wB8xKs2Ve",
"amount": 999,
"currency": "usd",
"return_url": "https://app.example.com/pay/return",
"client_state": "Xq7Lm2Nv9Rt4Kp8Wz3Bc5D",
"expires_at": "2026-11-25T11:00:00.000Z"
}When the customer taps Return to app, the link carries session_id, outcome, and client_state. The outcome is a hint for the app's screen, not proof of payment. If the URL expires before the customer opens it, generate a new one for the same session with POST /v1/checkout/{checkout_session_id}/refresh, whose duration can be as short as 5 minutes. See Create a checkout session in the Commerce API reference for all fields.
In-app browsers
You can choose an in-app browser instead, for physical goods and services, and in the EU where it's allowed.
One core on every platform
Link-out is built once, into the iOS and Android SDKs, and the Unity and React Native packages use it underneath, so every platform links out the same way.
The total the customer saw
Before paying, the SDK checks the total again against the one the customer saw, and the API checks at payment that it's the same amount.
Native drop-ins and merchant of record
Pay.com acts as the merchant of record for digital goods, software, SaaS, and app subscriptions. In native drop-ins, Pay.com runs in-app as the merchant of record only where app-store policies, wallet rules, and local law permit alternative in-app billing, showing the seller line, tax-inclusive totals, consents, and wallet merchant identity. Where alternative in-app billing isn't permitted, digital goods sell through link-out to the hosted checkout.
Store rules and reporting
The SDK applies the stores' rules, and Pay.com can report your link-out sales to Apple and Google for you if you opt in. See Store rules and reporting to the stores.