marketplace-doc
    • Data Ingestion
    • Errors
    • Introduction
    • Loan API & Deduction Lifecycle
    • Getting Started
    • OAuth
    • Webhooks
    • Embedded Journey
    • OpenSylo Marketplace Integration API
      • OAuth 2.0
        • Start OAuth authorization
        • Exchange authorization code or refresh token
        • Revoke a token
        • Discover OAuth capabilities
      • Data Ingestion
        • Submit single merchant data
        • Submit bulk merchant data
        • Poll batch processing status
        • Get merchant credit score
        • Data ingestion health check
      • Sales & Events
        • Submit a sales event
        • Submit a repayment event
        • Submit an account flag
      • Loan API
        • Get active loans for a merchant
        • Get loan status
        • Validate deduction amounts
        • Bulk loan status
      • Inbound Webhooks
        • Repayment events
        • Settlement events
      • Outbound Webhooks
        • loan.approved
        • loan.disbursed
        • loan.repayment_updated
        • loan.nearly_complete
        • loan.completed
        • loan.defaulted
        • merchant.created
        • kyc.submitted
        • kyc.approved
        • kyc.rejected
        • funding_request.created
        • funding_request.fulfilled
        • funding_request.rejected
      • Embedded Journey (Marketplace API)
        • Create (or fetch) a merchant
        • Get merchant status (KYC, credit score, funding requests)
        • Update business KYC information
        • Add directors (bulk)
        • Attach a KYC document
        • Submit KYC for review
        • Submit sales data for credit scoring
        • Create a funding request
        • Mint an embed token for the hosted journey
      • Schemas
        • TokenRequest
        • TokenResponse
        • OAuthError
        • ClientMetadataResponse
        • MerchantIdentity
        • SalesPerformance
        • RevenueConsistency
        • FulfillmentMetrics
        • PayoutCashFlow
        • PlatformDependency
        • HistoricalCredit
        • BehavioralRisk
        • MonthlyHistoryEntry
        • MerchantDataRequest
        • CreditScore
        • LoanEligibilityResult
        • MerchantDataResponse
        • BulkMerchantDataRequest
        • AsyncBulkProcessingResponse
        • BatchStatusResponse
        • SalesEventRequest
        • RepaymentEventRequest
        • AccountFlagRequest
        • MerchantInfo
        • LenderInfo
        • RepaymentInfo
        • LoanTermsInfo
        • ActiveLoan
        • ActiveLoansSummary
        • ActiveLoansResponse
        • LoanStatusRepayment
        • LoanStatusResponse
        • ValidateDeductionsRequest
        • DeductionItem
        • DeductionSummary
        • ValidateDeductionsResponse
        • BulkLoanStatusRequest
        • BulkLoanStatusItem
        • BulkStatusSummary
        • BulkLoanStatusResponse
        • WebhookMarketplace
        • WebhookMerchant
        • WebhookLoan
        • DeductionDetails
        • SourceTransaction
        • LoanBalance
        • RepaymentDeductedWebhook
        • FailureDetails
        • RepaymentFailedWebhook
        • ReversalDetails
        • RepaymentReversedWebhook
        • SettlementDetails
        • SettlementSummaryByStatus
        • SettlementSummary
        • SettlementLoanIncluded
        • BankTransferDetails
        • SettlementCreatedWebhook
        • SettlementTransferredWebhook
        • TransferDetails
        • WebhookAckResponse
        • OutboundLoan
        • OutboundMerchant
        • OutboundLender
        • LoanTerms
        • RepaymentTerms
        • ScheduleInstallment
        • LoanApprovedPayload
        • DisbursementDetails
        • DisbursedRepayment
        • LoanDisbursedPayload
        • ChangeDetail
        • LoanRepaymentUpdatedPayload
        • RepaymentStatus
        • NearlyCompleteRecommendation
        • LoanNearlyCompletePayload
        • CompletionSummary
        • LoanCompletedPayload
        • DefaultDetails
        • CollectionInstructions
        • LoanDefaultedPayload
        • ApiError
        • RateLimitError
        • EmbedCreateMerchantRequest
        • EmbedCreateMerchantResponse
        • EmbedBusinessKyc
        • EmbedDirectorInfo
        • EmbedBulkDirectors
        • EmbedDirectorListItem
        • EmbedDocumentUpload
        • EmbedSalesDataAccepted
        • EmbedCreateFundingRequest
        • EmbedFundingRequestIntent
        • EmbedMerchantStatusResponse
        • EmbedTokenResponse
        • MarketplaceMerchantRef
        • MerchantCreatedPayload
        • KycStatusPayload
        • FundingRequestEventPayload
    • OpenSylo Marketplace API
      • OAuth 2.0
        • Start OAuth authorization
        • Exchange code or refresh token
        • Revoke a token
        • OAuth discovery / client metadata
      • Data Ingestion
        • Submit single merchant data
        • Submit bulk merchant data
        • Get merchant credit score
        • Integration health check
      • Loan API
        • Get active loans for a merchant
        • Get loan status
        • Validate deduction amounts
        • Bulk loan status check
      • Inbound Webhooks
        • Send repayment webhook
        • Send settlement webhook
      • Schemas
        • 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
        • OAuthError
        • ApiError

    OAuth

    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": [
        "data.share.sales", "data.share.fulfillment", "data.share.payouts",
        "data.share.risk", "data.share.profile", "credit.score.read", "repayment.report",
        "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
    Legacy scopes (for backward compatibility):
    ScopeDescription
    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-04-08 18:18:53
    Previous
    Getting Started
    Next
    Webhooks
    Built with