Idempotency
An API call is idempotent if the action is performed only once no matter how many times the API call is retried.
Idempotency helps to avoid unwanted duplication in case of failures and retries. For example, idempotency can guarantee that the payment is charged only once if the same API payment call is retried multiple times in the case of a timeout error.
In Alipay+, API idempotency is enabled by an idempotency parameter. Idempotency parameters stay unique without a time limit.
Idempotency parameters
The following tables list the APIs that need idempotency control, the idempotency parameters of APIs, and key parameters that are checked for consistency in idempotency control. For detailed information, see the specific API chapter.
Direction: ACQP > Alipay+
For APIs that are used by the ACQP to call Alipay+, Alipay+ decides the idempotency parameters and key parameters that are checked for consistency. The following table lists the APIs that need idempotency control, idempotency parameters of APIs, and key parameters that need to be checked for consistency in idempotency control:
API | Idempotency parameter | Key parameter to check consistency |
refundRequestId | refundAmount and paymentRequestId, or refundAmount and paymentId | |
registrationRequestId | N/A |
Direction: Alipay+ > ACQP
For APIs that are used by Alipay+ to call the Acquiring Service Provider (ACQP), the ACQP decides the idempotency parameters and key parameters that are checked for consistency. The following table lists the APIs that need idempotency control, the idempotency parameters of APIs, and recommended key parameters that need to be checked for consistency in idempotency control:
API | Idempotency parameter | Key parameter to check consistency |
paymentId | paymentRequestId, paymentAmount, and settlementAmount |