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
    • 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

    Errors

    HTTP Status Codes#

    CodeMeaningWhen It Occurs
    200OKSuccessful request
    201CreatedResource created (registration)
    400Bad RequestValidation error, missing parameters, invalid data
    401UnauthorizedMissing/invalid/expired token, invalid credentials, invalid webhook signature
    403ForbiddenInsufficient OAuth scopes, sandbox not enabled
    404Not FoundResource not found
    409ConflictDuplicate event (webhook idempotency), email already registered
    429Too Many RequestsRate limit exceeded
    500Internal Server ErrorUnexpected server error

    OAuth Errors (RFC 6749)#

    OAuth-related errors follow the RFC 6749 format:
    {
      "error": "invalid_grant",
      "error_description": "Authorization code expired"
    }

    Error Codes#

    Error CodeHTTP StatusDescriptionCommon Cause
    invalid_request400Missing or invalid parametersMissing client_id, redirect_uri, or grant_type
    invalid_grant401Invalid authorization code, expired code, or invalid refresh tokenCode used more than once, code expired (5-minute TTL), refresh token expired (30 days)
    invalid_client401Invalid client_id or client_secretWrong credentials, secret was regenerated
    access_denied403Merchant denied authorizationUser clicked "Deny" on the consent screen
    server_error500Internal server errorUnexpected server-side issue

    Handling OAuth Errors#

    Authorization callback errors -- If the merchant denies consent or an error occurs during authorization, your redirect_uri receives error parameters:
    https://yourmarketplace.com/oauth/callback
      ?error=access_denied
      &error_description=User+denied+authorization
      &state=random_csrf_token_123
    Token exchange errors -- Returned as JSON in the response body:
    {
      "error": "invalid_grant",
      "error_description": "Authorization code expired"
    }
    Token refresh errors -- When a refresh token has expired:
    {
      "error": "invalid_grant",
      "error_description": "Refresh token expired"
    }
    When you receive invalid_grant on a refresh attempt, the merchant must re-authorize through the OAuth flow.

    API Errors#

    API endpoints return structured error responses with a consistent format:

    Simple Error#

    {
      "statusCode": 400,
      "message": "Validation failed",
      "error": "Bad Request"
    }

    Validation Error with Field Details#

    {
      "statusCode": 400,
      "message": [
        "salesPerformance.gmv30Days must not be less than 0",
        "revenueConsistency.revenueConcentration must not be greater than 100"
      ],
      "error": "Bad Request"
    }
    The message field can be either a string or an array of strings. When it is an array, each entry describes a specific field-level validation failure.

    Common API Error Scenarios#

    ScenarioStatusErrorMessage
    Missing Authorization header401UnauthorizedMissing or invalid token
    Expired access token401UnauthorizedToken expired
    Insufficient scope403ForbiddenInsufficient scope for this operation
    Invalid merchant ID404Not FoundMerchant not found
    Invalid loan ID404Not FoundLoan not found or does not belong to this marketplace
    Missing required field400Bad RequestField-specific validation message
    Invalid field value400Bad RequestField-specific validation message
    Bulk batch too large400Bad RequestMaximum 1000 merchants per batch
    Data timestamp too old400Bad RequestdataTimestamp must be within the last 30 days

    Webhook Errors#

    Inbound Webhook Errors (Your Webhooks to OpenSylo)#

    ScenarioStatusDescription
    Missing X-Marketplace-Signature header401Signature header is required
    Invalid HMAC signature401Signature does not match
    Timestamp outside 5-minute window401Timestamp too old or too far in the future
    Missing X-Marketplace-Id header401Marketplace ID header is required
    Unknown marketplace ID401Marketplace not found
    Duplicate X-Marketplace-Event-Id409Event already processed (idempotency)

    Outbound Webhook Failures (OpenSylo Webhooks to You)#

    When OpenSylo sends webhooks to your endpoint and receives a non-2xx response, it retries with exponential backoff:
    AttemptDelay
    1Immediate
    21 minute
    35 minutes
    430 minutes
    52 hours
    624 hours
    After 6 failed attempts, the webhook is marked as failed. Ensure your webhook endpoint:
    Returns a 2xx status code to acknowledge receipt
    Responds within 30 seconds
    Handles duplicate deliveries idempotently (check event_id)

    Rate Limit Errors#

    ScenarioStatusDescription
    Webhook rate limit exceeded429Too many requests -- maximum 100 per 60 seconds per marketplace
    When rate-limited, the response includes a Retry-After header indicating seconds to wait before retrying.
    Response:
    {
      "statusCode": 429,
      "message": "Too many requests. Please retry after the specified time.",
      "error": "Too Many Requests"
    }

    Error Handling Best Practices#

    1.
    Always check HTTP status codes before parsing response bodies. A 2xx status means success; anything else is an error.
    2.
    Handle token expiry gracefully. When you receive a 401 on an API call, attempt a token refresh. If the refresh also fails with invalid_grant, the merchant needs to re-authorize.
    3.
    Implement exponential backoff for retries on 500 errors. Do not retry 4xx errors (except 429 if rate-limited).
    4.
    Log correlation IDs. When submitting merchant data, include a correlationId so you can trace issues across systems.
    5.
    Validate webhook signatures before processing any inbound webhook payload. Reject requests with invalid signatures immediately.
    6.
    Handle array messages. The message field in API errors can be a string or an array of strings. Your error handling should accommodate both formats.
    7.
    Respect rate limits. Implement client-side rate limiting for inbound webhooks to stay within the 100 requests per 60 seconds per marketplace threshold. Monitor for 429 responses and back off accordingly.
    Modified at 2026-04-08 18:18:52
    Previous
    Data Ingestion
    Next
    Introduction
    Built with