wrangle.win
wrangle.win

Authentication

Learn how wrangle.win API authentication works, how merchant API tokens are issued and stored, and how to securely configure Market and Resolution Callback URLs.

API В· Authentication

Authenticate your wrangle.win integration.

Each merchant account can use API credentials to identify requests made to wrangle.win services.

Delivery works in the opposite direction: wrangle.win sends server-to-server POST requests to the Market URL and Callback URL configured for your merchant account.

Your Requests

Merchant в†’ wrangle.win

When your backend accesses a protected wrangle.win API endpoint, your API token identifies the merchant making the request.

Credential
API Token
Delivery Events

wrangle.win в†’ Merchant

wrangle.win sends market delivery and lifecycle events directly to the HTTPS endpoints configured by your merchant account.

Market URL
Callback URL
API Tokens

Merchant credentials

API tokens are associated with a specific merchant account. Treat them as confidential server-side credentials.

Merchant API Token
YOUR_WRANGLE_API_TOKEN

Use the API token issued for your merchant account. The token value and format may vary; treat the credential as an opaque secret and do not derive application logic from its format. Never publish or share a real merchant token in documentation, screenshots, frontend code or public repositories.

Secret Credential

Never expose an API token in frontend code.

Your wrangle.win API token should only be stored and used by trusted server-side infrastructure.

Safe
  • Backend environment variables
  • Secret management services
  • Encrypted deployment secrets
  • Protected server configuration
Never expose it in
  • Browser JavaScript
  • Public Git repositories
  • HTML source code
  • Public screenshots or support messages
Server Configuration

Store the token outside your application code.

.env
WRANGLE_API_TOKEN=your_merchant_api_token

Do not commit your production .env file or API credentials to source control.

Laravel

Example server-side configuration

config/services.php
'wrangle' => [
    'token' => env('WRANGLE_API_TOKEN'),
],
Application Code
$token = config('services.wrangle.token');
Market Delivery

Configure your receiving endpoints.

To receive content from wrangle.win, your merchant account needs endpoints that can receive server-to-server POST requests.

Market URL
https://merchant.example.com/api/markets

wrangle.win sends market.published events to this endpoint.

Callback URL
https://merchant.example.com/api/market-resolutions

wrangle.win sends lifecycle callbacks to this endpoint: market.resolving, market.resolved and market.cancelled.

Event Routing
market.published в†’ Market URL
market.resolving / market.resolved / market.cancelled в†’ Callback URL
HTTPS

Use HTTPS endpoints in production.

Production Market and Callback URLs should use HTTPS so data is encrypted while travelling between wrangle.win and your infrastructure.

https://merchant.example.com/api/markets
Environment Separation

Keep production credentials private.

If your organization maintains separate development, staging and production environments, keep credentials and endpoint configuration isolated between them.

Development

Local or internal integration testing.

Staging

Pre-production integration verification.

Production

Live merchant infrastructure and credentials.

Compromised Credentials

Replace exposed credentials immediately.

If an API token is accidentally exposed, do not continue using it as a trusted production credential.

Disable the affected token and create a replacement credential before continuing normal API operations.

Integration Architecture

Keep the integration server-to-server.

Your Backend
↕
wrangle.win
Content delivery and market lifecycle infrastructure
↓
Your Internal Market System
Publication, users, balances, cancellation handling and settlement remain on your platform
Next

Handle delivery failures safely.

Your receiving endpoints should be prepared for network failures, non-successful responses and repeated delivery attempts.

Errors & Retries в†’