ap2_request_checkout_approval
Asks the user to approve THIS checkout on the trusted approval page (AP2 Human Present, direct mode). Returns the URL the user must open: after the user approves and authenticates with the payment instrument, the signed closed checkout and payment mandates are returned by ap2_get_mandate_approval. WHEN TO CALL: - The checkout is ready_for_complete and the user is present to approve it - A payment under delegation came back requires_escalation with an approval: in that case the server already opened one (ap2.approval_id), do not call this Input: checkout_id (required), payment_instrument {id, type, description} (required — what the user will pay with), agent_key_kid (required, the key the mandates are bound to: present them with a Key Binding JWT, typ kb+jwt, with aud/nonce/sd_hash) After approval, send payment_mandate to ucp_issue_payment_credential (the credential is released only after the mandate is verified), then complete_checkout with both mandates. Output: approval_id, approval_url, expires_at The approved content is built by the server from the checkout it signed: the user approves what the merchant will charge, not a description from the agent. Updating the checkout afterwards invalidates the approval.
Each store has its own status page. To find more, search the directory.
Input schema
{
"type": "object",
"required": [
"checkout_id",
"payment_instrument",
"agent_key_kid"
],
"properties": {
"checkout_id": {
"type": "string",
"description": "The checkout to approve (must be ready_for_complete)"
},
"agent_key_kid": {
"type": "string",
"description": "kid of the agent key the mandates are bound to (cnf): they must be presented with a Key Binding JWT signed by it"
},
"payment_instrument": {
"type": "object",
"required": [
"id",
"type"
],
"properties": {
"id": {
"type": "string",
"description": "Instrument reference that will be charged"
},
"type": {
"type": "string",
"description": "Instrument type, e.g. card"
},
"description": {
"type": "string",
"description": "Human readable description shown on the approval page"
}
},
"description": "What the user pays with: id (e.g. the ucp_tokenize token), type (e.g. card), description shown to the user (e.g. 'Visa \u2022\u2022\u2022\u2022 4242')"
}
}
}
