Reference

Build on the Lucra API.

Drag a sticker to move it, or use the arrow keys while focused.

Sandbox

Test an integration with simulated ad platforms and no payments.

The sandbox is a separate copy of Lucra for building and testing an integration. It runs the same API as live. Ad platforms and the brand's card are simulated, so nothing spends real money and no payout is sent.

LiveSandbox
Apphttps://www.onlucra.comhttps://sandbox.onlucra.com
APIhttps://api.onlucra.com/v1https://api-sandbox.onlucra.com/v1
Keyslucra_live_…lucra_sandbox_…

Get started

  1. Sign up at sandbox.onlucra.com. Choose Brand, or Agency or Developer to test as a partner.
  2. Create a key in Settings → Developers → API, and set its webhook URL there or with PATCH /v1/keys/current.
  3. Point your client at the sandbox API. With the SDK, pass baseUrl: "https://api-sandbox.onlucra.com" with your sandbox key.

Sandbox accounts, keys and data are separate from live: a live key doesn't work in the sandbox, and a sandbox key doesn't work on live. When you're ready, create a live key and switch the base URL. Nothing carries over.

What works as on live

Everything that stays inside Lucra behaves exactly as on live, with the same requests, responses, errors and webhooks:

  • Partner accounts and the brands and creators they manage (/v1/brands, /v1/creators)
  • Programs, applications, agreements and submissions, including uploading videos with /v1/files
  • Campaigns, ad sets, ads and their changes, against the simulated platforms below
  • Analytics, ad authorizations, messages, embeds and the Lucra Pixel

Emails and invites are sent for real, so use addresses you control.

Simulated ad platforms

Connecting. POST /v1/connections for Meta, TikTok, Google or Snapchat opens a simulated sign-in page instead of the platform's. Choose Allow (or Cancel to test a refusal) and the connection finishes as on live. Then pick its ad account, and its page, pixel or identity, from GET /v1/connections/:id/setup, and save them with PATCH /v1/connections/:id.

Campaigns. A campaign is set up on the simulated platform as soon as it's created, and launching, pausing, budget changes and archiving apply right away. Each ad gets a platform ID, as on live.

Results. Every running ad reports simulated daily results from the day it was created: spend, impressions, clicks, conversions, revenue and paid views. The same ad and day always read the same numbers, so your tests can assert on them. They reach GET /v1/analytics on the same 30-minute sync as live, and usage fees are charged to the simulated card (or credit) as on live, so they show in usageFees too.

Ads Lucra didn't launch. Each simulated ad account also holds three ads of its own, so GET /v1/ads?source=external and source=external analytics have data to test with.

Test values

To testUse
Paid adsAny simulated ad account: one per platform, in USD
A brand's cardPOST /v1/connections with card: saves a simulated Visa ending 4242 at once. Usage fees charged to it always succeed.
A TikTok Spark code (boosting a post)SANDBOX-VALID is accepted. SANDBOX-VALID-<post id> is accepted for that post, to match a link you also send. SANDBOX-EXPIRED, SANDBOX-INVALID and SANDBOX-WRONG-ACCOUNT are refused with 422 spark_code_refused, as TikTok refuses them.
A post linkAny full TikTok post link. It waits for a code, which you send from its requestUrl

Not in the sandbox

These reach outside Lucra, so they return 403 feature_unavailable in the sandbox:

  • Payouts and withdrawals
  • Stripe pages, such as payout setup and card checkout
  • Shopify stores and samples
  • Creators connecting their own Instagram or TikTok
  • Slack