commit 522cc24d0493eea30352b69a95c97be0ef4a7491 parent 2f2b47c241d763c1ea0ee52ddbdf740bb5d29224 Author: Christian Grothoff <christian@grothoff.org> Date: Tue, 2 Jun 2026 20:40:23 +0200 spec new v31 endpoint Diffstat:
| A | core/merchant/post-private-accept-tos-early.rst | | | 54 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 54 insertions(+), 0 deletions(-)
diff --git a/core/merchant/post-private-accept-tos-early.rst b/core/merchant/post-private-accept-tos-early.rst @@ -0,0 +1,54 @@ +.. http:post:: [/instances/$INSTANCE]/private/accept-tos-early + + Record that the user has accepted a specific version of the + terms of service of an exchange ahead of the regular KYC flow. + The merchant backend persists this information so that + ``GET /private/kyc`` can report it back via the + ``tos_accepted_early`` field of `MerchantAccountKycRedirect`. + + This is intended for deployments where the exchange has set + ``kyc_swap_tos_acceptance`` in its ``/keys`` response, meaning + the frontend swaps the terms-of-service and KYC auth + authentication steps in the user experience. + + Introduced in **v31**. + + **Required permission:** ``accounts-write`` + + **Request:** + + The request body is a `TosAcceptedEarlyRequest`. + + **Response:** + + :http:statuscode:`204 No content`: + The acceptance has been recorded. + :http:statuscode:`400 Bad Request`: + The request body is malformed. + Returned with ``TALER_EC_GENERIC_PARAMETER_MALFORMED``. + :http:statuscode:`401 Unauthorized`: + The request is unauthorized. + Returned with ``TALER_EC_MERCHANT_GENERIC_UNAUTHORIZED``. + :http:statuscode:`404 Not found`: + The instance is unknown to the backend. + Returned with ``TALER_EC_MERCHANT_GENERIC_INSTANCE_UNKNOWN``. + :http:statuscode:`500 Internal Server Error`: + The server experienced an internal failure. + Returned with ``TALER_EC_GENERIC_DB_STORE_FAILED``. + + **Details:** + + .. ts:def:: TosAcceptedEarlyRequest + + interface TosAcceptedEarlyRequest { + + // Base URL of the exchange for which the user has + // accepted the terms of service. + exchange_url: string; + + // ``Taler-Terms-Version`` (see the exchange's + // ``/terms`` endpoint) of the terms of service + // that the user has accepted. + tos_version: string; + + }