Snippet configuration
Returns the account’s identification configuration. The snippet calls this endpoint when it loads, before the first event. You only need it if you write your own collector in the browser.
Endpoint
Section titled “Endpoint”https://api.rapidchargeback.com/api/v1/capture/{token}/configAuthentication
Section titled “Authentication”None. The publishable token in the URL identifies the merchant.
URL parameters
Section titled “URL parameters”| Field | Type | Description |
|---|---|---|
token | string | Merchant’s publishable token, generated in the dashboard |
Validations
Section titled “Validations”| Rule | Response |
|---|---|
| Unknown or inactive token, or token without a merchant | 404 NOT_FOUND |
The response comes with cache-control: public, max-age=300. Respect the cache: the configuration rarely changes and the snippet does not need to fetch it on every page.
Request example
Section titled “Request example”curl https://api.rapidchargeback.com/api/v1/capture/your_publishable_token/configResponse examples
Section titled “Response examples”Success (200), with Fingerprint active
Section titled “Success (200), with Fingerprint active”{ "data": { "fp_public_key": "pk_exemplo_123456", "fp_region": "us" }}| Field | Description |
|---|---|
fp_public_key | Fingerprint public key to use in the browser. null when identification is not active |
fp_region | Fingerprint region: us, eu or ap |
With the key, the collector loads the Fingerprint agent and gets two values: the visitor identifier and the request identifier. Send them in the checkout event as device_id and fp_request_id, and Rapid validates the pair on the server side. See The checkout event.
Success (200), without Fingerprint active
Section titled “Success (200), without Fingerprint active”{ "data": { "fp_public_key": null, "fp_region": "us" }}A null fp_public_key does not prevent capture. The event is still recorded, just without the validated device identification part.
Error: unknown token (404)
Section titled “Error: unknown token (404)”{ "error": { "code": "NOT_FOUND" } }