api_keyinstance_idgranted_permissions
Choose the right Cloud API
Custom Apps usually use these Cloud APIs.
All requests use the Cloud base URL:
X-blnk-key header:
instance_id in the URL:
instance_id in the JSON body.
Quick reference
- Using the Proxy API
- Using the Data Lake API
- Other Cloud features
Use the proxy when your app wants to call Core through Cloud. The format is:Use the same HTTP method and path you would call on Core. GET, POST, PUT, DELETE, and other Core routes all go through becomes:A complete request via the Cloud Proxy looks like:
/proxy. For historical reporting, use the Data Lake API.For example, creating a transaction on Core:Using the proxy
Core routes and request shapes.
Example application
Let’s apply this to build the Stripe Sync workflow we mapped earlier.1
Fetch pay-ins from Stripe
First, we’ll list pay-ins from Stripe and keep only the ones that have actually settled (Filtering on
status === "succeeded"):fetchStripePayIns.ts
status === "succeeded" ensures we only import pay-ins that have actually settled into your Stripe balance - anything still pending, requiring action, or canceled is skipped.2
Send the pay-in to Blnk
Next, we’ll mirror the Stripe pay-in as a transaction in the selected Blnk Cloud instance through the Proxy API:We’ll use the Stripe payment intent ID directly as the
sendPayInToBlnk.ts
reference in Blnk. Re-syncing the same payment intent will not create a duplicate transaction in Blnk because Blnk handles idempotency internally.3
Save the sync details in your app
Finally, we’ll record the sync run in the app’s local database so we know when the sync ran, how many pay-ins it processed, and whether it succeeded:Call this once per sync run (after Step 2 completes for the whole batch) so each row represents one end-to-end sync, not each individual pay-in. The link back to specific Blnk transactions is already preserved by the
saveSyncRecord.ts
meta_data.stripe_payment_intent_id written in Step 2.Run the example Stripe Sync app
Reference Stripe sync implementation.