Starpay Merchant Disbursement API
    • 1. Revision History
    • 2. Signature
      • 2.1 API connection check
      • 2.2 Signing a message
      • 2.3 Use the SHA256WithRSA algorithm to calculate the To-Be-Signed String
      • 2.4 Sample
      • 2.5 Method of Signature
    • 3. Procedure Diagram
    • 4. API List
    • 5. Disbursement
      • 5.1 Fund Disbursement List
        POST
      • 5.2 Fund Disbursement
        POST
      • 5.3 Fund Disbursement (Starpay to Starpay Fund Transfer)
        POST
      • 5.4 Fund Disbursement Query
        POST
      • 5.5 Disbursement State Notification
        POST
      • 5.6 Disbursement Balance Query
        POST
      • 5.7 Scan QR
        POST
      • 5.8 Fund Disbursement (Pay P2M QR)
        POST
      • 5.9 Fund Disbursement (Pay P2P QR)
        POST
    • 6. Repayment
      • 6.1 Repayment
        POST
      • 6.2 Repayment State Query
        POST
      • 6.3 Repayment State Notification
        POST
      • 6.4 Repayment Static Qr Generate
        POST
      • 6.5 Repayment Static Qr Order Notify
        POST
      • 6.6 Repayment Balance Query
        POST
      • 6.7 Edit Repayment Static QR Status
        POST
      • 6.8 Repayment transaction Query through RefNo
        POST
      • 6.9 Repayment Cancel
        POST
    • 7. WebPay
      • 7.1 WebPay
      • 7.2 WebPay Query
      • 7.3 WebPay Notification
    • 8. Error code list
    • 9. 3rd Party Error Code List
    • 10. Instapay Error Code List
    • 11. Secure Integration Guide
    • 12. Appendix
      • 12.1 Test demo
    • Schemas
      • Sample Schemas
        • Pet
        • Category
        • Tag

    11.Secure Integration Guide

    The Repayment and Disbursement APIs involve financial transactions. Before integrating with the production environment, merchants must complete the following security configurations.

    1. Secure Transmission#

    Required:
    All API requests and asynchronous notification URLs must use HTTPS.
    TLS 1.2 or higher must be used.
    Callback URLs must use a valid certificate issued by a trusted Certification Authority (CA).
    HTTP plaintext URLs and self-signed certificates are not allowed.

    2. Request Signing and Notification Signature Verification#

    Required:
    API requests must use RSA2 (SHA256withRSA) for signature generation.
    The signing content must be encoded using TF-8, and the signature result must use standard Base64 encoding.
    The signature must be computed over the exact raw JSON text of the "request" field in the outer request envelope. The "signature" field must not be included in the signing content.
    Do not reorder fields, remove empty fields, or convert the formats of null, empty strings, or numeric values.
    Upon receiving an asynchronous notification from the platform, the merchant must first verify the signature and complete the idempotency check before processing the order status. Once an order reaches a final status, it may only be handled manually.
    If signature verification fails, the merchant must not perform any business processing or update the order status, and must record the event in security logs.
    For the specific message format, please refer to the "Signature" section of the corresponding API.

    3. Key Security#

    Required:
    Private keys must not be hard-coded in source code, plaintext configuration files, or version control repositories.
    Private keys, tokens, and passwords must not be written to logs.
    Access to private keys must be restricted to authorized business service accounts only.
    Recommended:
    Store keys using KMS, HSM, Vault, or an encrypted configuration center.
    Rotate keys regularly.
    If a key is suspected to have been compromised, immediately stop the relevant API calls and contact the platform technical support team to replace the key.

    4. Network Access Control#

    Required:
    Register the fixed production outbound IP address(es) according to the integration requirements.
    If the outbound IP address changes, request a whitelist update before switching to the new IP address.
    Production APIs must not be called directly from personal computers or unauthorized networks.
    Recommended:
    The merchant's callback server should only allow access from the platform's notification IP addresses.
    Configure firewalls, WAF, and API request rate limits.

    5. Sensitive Data Protection#

    Required:
    Sensitive data such as bank card numbers and ID numbers must be encrypted at rest.
    Logs must not contain complete bank card numbers, ID numbers, passwords, CVVs, private keys, or tokens.
    If sensitive fields must be logged, they must be masked first.
    Strictly restrict access to production data, transaction logs, and cryptographic keys.

    6. Idempotency and Exception Handling#

    Required:
    Each request must use a unique msgId to prevent duplicate submissions.
    Asynchronous notifications may be sent multiple times. Merchants must implement idempotent processing based on the order number and order status.
    A network timeout does not necessarily mean that the transaction has failed. The Query API must be used to confirm the final transaction status. A transaction may be determined as failed only if the status query is performed more than 60 seconds after transaction initiation and within one month of transaction initiation.
    Signature verification failures or response parsing failures must not trigger business processing or cause an order to be directly marked as failed.

    7. Production Go-Live Checklist#

    Before integrating with the production environment, please confirm the following:
    API and callback URLs use HTTPS, with TLS ≥ 1.2.
    Request signature verification has passed.
    Platform asynchronous notification signature verification has passed.
    Idempotency controls have been implemented for callback processing.
    The merchant's production outbound IP address has been registered.
    Private keys have not been hard-coded or committed to the version control repository.
    Logs do not contain keys or complete sensitive information.
    Emergency contacts have been prepared for key compromise and abnormal transactions.
    Previous
    10. Instapay Error Code List
    Next
    12. Appendix