OpenSylo Marketplace API
    OpenSylo Marketplace API
    • Introduction
    • Getting Started
    • OAuth 2.0 Flow
    • Webhook Integration
    • Sandbox Testing
    • Error Reference
    • Marketplace Dashboard
      • Login to the marketplace dashboard
        POST
      • View OAuth credentials
        GET
      • Regenerate client secret
        POST
    • OAuth 2.0
      • Start OAuth authorization
        GET
      • Exchange code or refresh token
        POST
      • Revoke a token
        POST
      • OAuth discovery / client metadata
        GET
    • Data Ingestion
      • Submit single merchant data
        POST
      • Submit bulk merchant data
        POST
      • Get merchant credit score
        GET
      • Integration health check
        GET
    • Loan API
      • Get active loans for a merchant
        GET
      • Get loan status
        GET
      • Validate deduction amounts
        POST
      • Bulk loan status check
        POST
    • Inbound Webhooks
      • Send repayment webhook
        POST
      • Send settlement webhook
        POST
    • Sandbox
      • Sandbox environment info
        GET
      • Get sandbox test credentials
        GET
      • Get sandbox test merchants
        GET
    • Schemas
      • DashboardLoginRequest
      • DashboardLoginResponse
      • CredentialsResponse
      • RegenerateSecretResponse
      • TokenRequest
      • TokenResponse
      • RevokeRequest
      • ClientMetadataResponse
      • MerchantIdentity
      • SalesPerformance
      • RevenueConsistency
      • FulfillmentMetrics
      • PayoutCashFlow
      • PlatformDependency
      • HistoricalCredit
      • BehavioralRisk
      • MerchantDataRequest
      • ScoreBreakdown
      • CreditScore
      • MerchantDataResponse
      • BulkMerchantDataRequest
      • BulkMerchantDataResponse
      • CreditScoreResponse
      • HealthResponse
      • ActiveLoansResponse
      • LoanStatusResponse
      • ValidateDeductionsRequest
      • ValidateDeductionsResponse
      • BulkLoanStatusRequest
      • BulkLoanStatusResponse
      • RepaymentWebhookRequest
      • SettlementWebhookRequest
      • WebhookAckResponse
      • SandboxInfoResponse
      • SandboxCredentialsResponse
      • SandboxMerchantsResponse
      • OAuthError
      • ApiError

    OAuth 2.0 Flow

    OpenSylo uses the Authorization Code grant type (RFC 6749) with PKCE support (RFC 7636). This flow requires the merchant (the user on your platform) to explicitly grant consent for data sharing.

    Overview#

    Merchant Browser          Your Server           OpenSylo
         |                        |                      |
         |  1. Click "Connect"    |                      |
         |----------------------->|                      |
         |                        |  2. Generate PKCE    |
         |                        |     + state          |
         |  3. Redirect           |                      |
         |<-----------------------|                      |
         |                        |                      |
         |  4. Login + Consent    |                      |
         |----------------------------------------------->|
         |                        |                      |
         |  5. Redirect with code |                      |
         |<-----------------------------------------------|
         |                        |                      |
         |  6. Forward code       |                      |
         |----------------------->|                      |
         |                        |  7. Exchange code    |
         |                        |--------------------->|
         |                        |  8. Tokens returned  |
         |                        |<---------------------|
         |  9. Success            |                      |
         |<-----------------------|                      |

    Step 1 — Generate PKCE Values#

    PKCE (Proof Key for Code Exchange) is recommended for all clients and required for public clients.
    MethodDescription
    S256Recommended. SHA-256 hash of the verifier, base64url-encoded.
    plainVerifier sent as-is (only for development/testing).

    Step 2 — Redirect to Authorization#

    Redirect the merchant's browser to the OpenSylo authorization endpoint:
    GET /oauth/authorize
    ParameterRequiredDescription
    client_idYesYour marketplace client ID
    redirect_uriYesOne of your registered redirect URIs
    response_typeYesMust be code
    scopeYesSpace-separated list of requested scopes
    stateRecommendedOpaque CSRF token you generate; returned unchanged in the callback
    code_challengeRecommendedPKCE code challenge (S256 or plain)
    code_challenge_methodRecommendedS256 (recommended) or plain
    Example URL:
    https://api.opensylo.com/oauth/authorize
      ?client_id=yourmarketplace_client_a1b2c3d4
      &redirect_uri=https://yourmarketplace.com/oauth/callback
      &response_type=code
      &scope=data.share.sales data.share.profile credit.score.read
      &state=random_csrf_token_123
      &code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
      &code_challenge_method=S256

    Step 3 — Merchant Grants Consent#

    OpenSylo presents a login page (if the merchant is not already authenticated) followed by a consent screen listing the requested permissions. The merchant can Allow or Deny.
    On success, OpenSylo redirects to your redirect_uri:
    https://yourmarketplace.com/oauth/callback
      ?code=<authorization_code>
      &state=random_csrf_token_123
    On denial:
    https://yourmarketplace.com/oauth/callback
      ?error=access_denied
      &error_description=User+denied+authorization
      &state=random_csrf_token_123
    The authorization code expires in 5 minutes and can only be used once.
    Always verify the state parameter matches what you sent to prevent CSRF attacks.

    Step 4 — Exchange Code for Tokens#

    POST /oauth/token
    Response:
    {
      "access_token": "<opaque_token>",
      "token_type": "Bearer",
      "expires_in": 3600,
      "refresh_token": "<opaque_token>",
      "scope": "data.share.sales data.share.profile credit.score.read"
    }

    Token Lifetimes#

    TokenLifetimePurpose
    access_token1 hour (3600 seconds)Used in Authorization: Bearer header for API calls
    refresh_token30 daysUsed to obtain a new access token without re-prompting the merchant

    Step 5 — Refresh Tokens#

    When the access token expires, use the refresh token to get a new one:
    Response:
    {
      "access_token": "<new_access_token>",
      "token_type": "Bearer",
      "expires_in": 3600,
      "scope": "data.share.sales data.share.profile credit.score.read"
    }
    The refresh response does not include a new refresh token. Continue using the original refresh token until it expires (30 days).

    Step 6 — Revoke Tokens#

    POST /oauth/revoke
    Per the OAuth specification, this endpoint returns 200 OK even if the token is invalid or already revoked.

    Discovery — Client Metadata#

    GET /oauth/client-metadata?client_id=<your_client_id>
    Returns the OAuth capabilities supported by OpenSylo:
    {
      "grant_types_supported": ["authorization_code", "refresh_token"],
      "response_types_supported": ["code"],
      "scopes_supported": [
        "sales.read", "sales.write", "repayments.read", "repayments.write",
        "account.flags.read", "account.flags.write", "merchant.profile.read"
      ],
      "code_challenge_methods_supported": ["S256", "plain"],
      "token_endpoint_auth_methods_supported": ["client_secret_post"]
    }

    Available Scopes#

    ScopeDescription
    data.share.salesShare sales and GMV data with OpenSylo
    data.share.fulfillmentShare order fulfillment and delivery metrics
    data.share.payoutsShare payout and cash flow information
    data.share.riskShare account status and risk information
    data.share.profileShare merchant business profile information
    credit.score.readAccess credit scores calculated by OpenSylo
    repayment.reportReport loan repayments collected from merchant sales
    sales.readShare sales and transaction data
    sales.writeShare sales records with OpenSylo
    repayments.readAccess repayment information
    repayments.writeReport repayments on behalf of merchant
    account.flags.readShare account status and flags
    account.flags.writeUpdate account flags
    merchant.profile.readShare merchant profile information
    marketplace.writeShare merchant data for credit scoring
    marketplace.readAccess credit scores from OpenSylo
    Modified at 2026-01-29 23:23:16
    Previous
    Getting Started
    Next
    Webhook Integration
    Built with