For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomeGuidesAPI Reference
HomeGuidesAPI Reference
  • Online API
    • API Environments
    • Direct Payment Flow
    • REST
    • HTTPS
    • Request Headers
    • Dates
    • Pagination
    • Authentication
    • Idempotent Requests
    • Timeouts
    • API Simulator
    • JavaScript afterpay.js
    • Errors
LogoLogo
Online API

Idempotent Requests

The Clearpay API supports idempotency that allows the safe retry of requests, guaranteeing the operation is only performed once.

For example, if a Create Refund request fails with a network error, the request can be retried with the same requestId and merchantReference. This is especially important for partial refunds to ensure retry attempts are not processed as separate refunds.

Clearpay recommends that merchants generate UUIDs for use as request IDs. The resources that include a requestId may send back the same response for requests made with the same requestId for up to 24 hours.

Note

When performing an idempotent retry of an API request, an HTTP 409 response may be encountered. This generally indicates that the original request was received, but is still processing. Please try again in a few moments, and repeat with the same requestId until something other than a 409 response is received.

Was this page helpful?
Previous

Timeouts

Next
Built with