> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kyrenpay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get historical merchant services agreement

> Returns the agreement for an explicit version and effective date. Reading a historical document does not complete acceptance of the current agreement.



## OpenAPI

````yaml /openapi.yaml get /v1/config/legal/merchant-services-agreement/{version}
openapi: 3.1.0
info:
  title: Kyren Pay API
  description: >
    The Kyren Pay API enables merchants to accept payments from customers
    worldwide.

    Integrate checkout sessions, manage products, track orders, and handle
    webhooks.


    **Authentication**: Server-side merchant integrations use `x-api-key`.

    Public configuration operations have no authentication requirement.

    `/v1/merchant/**` dashboard operations use a merchant login JWT and are not
    part of this API reference.

    Epay compatibility operations use their documented `pid` and signature/key
    parameters.


    **Data types**: The API uses the following types for request/response data:

    - **string**: For text, identifiers, and **all amount/price fields** (e.g.
    `price`, `amount`, `platformFee`, `available`)
      to avoid floating-point precision issues. Use decimal format like `"9.99"`.
    - **integer**: For counts, pagination, and timestamps

    - **timestamp**: Unix timestamp in milliseconds (integer) for all time
    fields (e.g. `createdAt`, `paidAt`, `expiresAt`).
      Time parameters (e.g. `startDate`, `endDate`) also use Unix milliseconds.
    - **calendar date**: Agreement `effectiveDate` uses a `YYYY-MM-DD` string;
    it is a calendar date, not an event timestamp.
  version: 1.0.0
  contact:
    name: Kyren Pay Support
    email: support@kyrenpay.com
    url: https://kyrenpay.com
servers:
  - url: https://api.kyrenpay.com
    description: Production
  - url: https://staging-api.kyren.top
    description: Staging, available only with credentials issued by Kyren
security:
  - ApiKeyAuth: []
tags:
  - name: Config
    description: Retrieve platform configuration such as supported currencies.
  - name: Products
    description: Create and manage products that represent the goods or services you sell.
  - name: Checkouts
    description: Create checkout sessions to collect payments from your customers.
  - name: Orders
    description: View and manage orders created from completed checkout sessions.
  - name: Refunds
    description: Create and retrieve refunds for eligible paid Kyren API orders.
  - name: Balance
    description: View your account balance and transaction history.
  - name: Epay Compatibility
    description: >
      Compatibility endpoints for existing integrations built on 易支付 API
      conventions.

      These endpoints use form/query parameters with `pid + sign` verification
      (MD5), not `x-api-key` header auth.
paths:
  /v1/config/legal/merchant-services-agreement/{version}:
    get:
      tags:
        - Config
      summary: Get historical merchant services agreement
      description: >-
        Returns the agreement for an explicit version and effective date.
        Reading a historical document does not complete acceptance of the
        current agreement.
      operationId: getHistoricalMerchantServicesAgreement
      parameters:
        - name: version
          in: path
          required: true
          schema:
            type: string
          description: Agreement version to retrieve.
        - name: effectiveDate
          in: query
          required: true
          schema:
            type: string
            format: date
          description: >-
            Agreement effective calendar date in `YYYY-MM-DD` format, not an
            event timestamp.
      responses:
        '200':
          description: Historical merchant services agreement
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantAgreementDocumentResponseWrapper'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security: []
components:
  schemas:
    MerchantAgreementDocumentResponseWrapper:
      type: object
      properties:
        code:
          type: integer
          example: 0
        message:
          type: string
          example: success
        data:
          $ref: '#/components/schemas/MerchantAgreementDocument'
    MerchantAgreementDocument:
      type: object
      required:
        - agreementVersion
        - effectiveDate
        - effectiveDateDisplay
        - templateSha256
        - renderedDocumentSha256
        - markdownContent
        - acceptanceStatement
        - actionLabel
        - documentUrl
      properties:
        agreementVersion:
          type: string
          description: Version identifier, such as `1.0`.
        effectiveDate:
          type: string
          format: date
          description: >-
            Rendered document's effective calendar date (`YYYY-MM-DD`), distinct
            from a millisecond event timestamp.
        effectiveDateDisplay:
          type: string
        templateSha256:
          type: string
          description: SHA-256 digest of the agreement template.
        renderedDocumentSha256:
          type: string
          description: SHA-256 digest of the rendered agreement text.
        markdownContent:
          type: string
        acceptanceStatement:
          type: string
        actionLabel:
          type: string
        documentUrl:
          type: string
          format: uri
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: >-
            Kyren business error code, not the HTTP status. For example, HTTP
            400 may contain code 40001.
        message:
          type: string
        error:
          type: object
          properties:
            field:
              type: string
            reason:
              type: string
  responses:
    BadRequest:
      description: Bad request — invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 40001
            message: Validation failed
            error:
              field: productId
              reason: Product ID is required
    NotFound:
      description: Not found — the requested resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 40401
            message: Not Found
    TooManyRequests:
      description: >-
        Rate limit exceeded. Ordinary API requests default to 100 per minute per
        IP; checkout creation defaults to 60 per minute per merchant. Deployment
        settings may differ.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 42901
            message: Too many requests
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >
        Your API key. Public production API-key endpoints accept `kyren_live_*`
        keys. Staging credentials are environment-specific and must be used only
        with the staging environment for which Kyren issued them.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.