Idempotency
Create-checkout is idempotent so enrolment wizards can safely retry.
Key selection
- Prefer the
Idempotency-Keyheader - Otherwise StudentPay uses
{provider_code}:{provider_order_id}
Example:
POST /v1/provider-checkouts
Idempotency-Key: ONFIT-ENROLMENT-12345
Authorization: Bearer ...
Behaviour
If an Opportunity already exists for the same provider and provider order ID (or checkout ID), StudentPay returns the existing checkout with:
{
"success": true,
"idempotent_replay": true,
"idempotency_key": "ONFIT-ENROLMENT-12345"
}
No additional Contact / Opportunity / DDA / Agreement records are created.
Confirm
Confirmation already short-circuits when the Opportunity checkout status is already confirmed and reuses an existing accepted Payment Plan Agreement where present.