taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

commit 1d861d8bd13a2a757424ea979e7e5589afc49e7d
parent 088dc2bc33d1b26f692bc1665eba69e1afd753d2
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  5 Sep 2024 16:11:36 +0200

fix links

Diffstat:
Mcore/api-bank-conversion-info.rst | 2+-
Mcore/api-challenger.rst | 55+++++++++++++++++--------------------------------------
Mcore/api-donau.rst | 6+++---
Mcore/api-merchant.rst | 244++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------
4 files changed, 212 insertions(+), 95 deletions(-)

diff --git a/core/api-bank-conversion-info.rst b/core/api-bank-conversion-info.rst @@ -177,7 +177,7 @@ is used by wallets for withdrawals that involve a currency conversion. the exchange rate between the regional currency and the fiat currency of the banking system. - The conversion is calculated as follows: `(amount * ratio - fee) / tiny_amount` + The conversion is calculated as follows: ``(amount * ratio - fee) / tiny_amount`` **Request:** diff --git a/core/api-challenger.rst b/core/api-challenger.rst @@ -186,12 +186,6 @@ Login The NONCE is a unique value identifying the challenge, should be shown to the user so that they can recognize it when they receive the TAN code. - This endpoint typically also supports requests with the "Accept" header - requesting "text/html". In this case, an HTML response using the template - :ref:`enter-$ADDRESS_TYPE-form <challenger_enter-address_type-form>` is - returned. If the backend installation does not include the required HTML - templates, a 406 status code is returned. - **Request:** @@ -204,29 +198,23 @@ Login **Response:** :http:statuscode:`200 OK`: - If the request ask for application/json then the response is + The the response is a `ChallengeStatus`. Since protocol **v1**. - Otherwise, the body contains a form to be submitted by the user-agent - using the template :ref:`enter-$ADDRESS_TYPE-form <challenger_enter-address_type-form>`. - The form will ask the user to specify their address. :http:statuscode:`400 Bad Request`: The request does not follow the spec. - If the request ask for application/json the response will include error + The response will include error code, hint and detail. Since protocol **v1**. - Otherwise, the body contains information using the template :ref:`invalid-request <challenger_invalid-request>`. :http:statuscode:`404 Not found`: The service is unaware of a matching challenge. - If the request ask for application/json the response will include error + The response will include error code, hint and detail. Since protocol **v1**. - Otherwise, the body contains information using the template :ref:`validation-unknown <challenger_validation-unknown>`. :http:statuscode:`406 Not Acceptable`: The client ask for "text/html" and the backend installation does not include the required HTML templates. :http:statuscode:`500 Internal Server Error`: Server is not able to respond due to internal problems. - If the request ask for application/json the response will include error + The response will include error code, hint and detail. Since protocol **v1**. - Otherwise, the body contains information using the template :ref:`internal-error <challenger_internal-error>`. .. ts:def:: ChallengeStatus @@ -289,10 +277,7 @@ Challenge **Response:** :http:statuscode:`200 OK`: - If the request ask for application/json the response is `ChallengeResponse`. Since protocol **v2**. - Otherwise, the body contains a form asking for the answer to - the challenge to be entered by the user using the - template :ref:`enter-tan-form <challenger_enter-tan-form>`. + The response is `ChallengeResponse`. Since protocol **v2**. :http:statuscode:`302 Found`: Only possible if request didn't ask for application/json. Since protocol **v2**. The user is redirected to the redirect URI of the client to pass the @@ -302,14 +287,12 @@ Challenge ``state`` argument from the ``/authorize`` endpoint. :http:statuscode:`400 Bad Request`: The request does not follow the spec. - If the request ask for application/json the response will include error + The response will include error code, hint and detail. Since protocol **v1**. - Otherwise, the body contains information using the template :ref:`invalid-request <challenger_invalid-request>`. :http:statuscode:`404 Not Found`: The service is unaware of a matching challenge. - If the request ask for application/json the response will include error + The response will include error code, hint and detail. Since protocol **v1**. - Otherwise, the body contains information using the template :ref:`validation-unknown <challenger_validation-unknown>`. :http:statuscode:`406 Not Acceptable`: The client ask for "text/html" and the backend installation does not include the required HTML templates. @@ -318,13 +301,12 @@ Challenge transmissions for this $NONCE. The user-agent should wait and (eventually) request a fresh nonce to be set up by the client. - If the request ask for application/json the response will include error + The response will include error code, hint and detail. Since protocol **v2**. :http:statuscode:`500 Internal Server Error`: Server is not able to respond due to internal problems. - If the request ask for application/json the response will include error + The response will include error code, hint and detail. Since protocol **v1**. - Otherwise, the body contains information using the template :ref:`internal-error <challenger_internal-error>`. .. ts:def:: ChallengeResponse @@ -392,7 +374,8 @@ Solve **Response:** :http:statuscode:`200 OK`: - If the request ask for application/json the response is `ChallengeSolveResponse`. Since protocol **v2**. + If the request ask for application/json the response is + a `ChallengeSolveResponse`. Since protocol **v2**. :http:statuscode:`302 Found`: Only possible if request didn't ask for application/json. Since protocol **v2**. The user is redirected to the redirect URI of the client to pass the @@ -402,29 +385,25 @@ Solve ``state`` argument from the ``/authorize`` endpoint. :http:statuscode:`400 Bad Request`: The request does not follow the spec. - If the request ask for application/json the response will include error + The response will include error code, hint and detail. Since protocol **v1**. - Otherwise, the body contains information using the template :ref:`invalid-request <challenger_invalid-request>`. :http:statuscode:`403 Forbidden`: - If the request ask for application/json the response is `InvalidPinResponse`. Since protocol **v1**. - Otherwise, the body contains information using the template :ref:`invalid-pin <challenger_invalid-pin>`. + The response is `InvalidPinResponse`. Since protocol **v1**. :http:statuscode:`404 Not found`: The service is unaware of a matching challenge. - If the request ask for application/json the response will include error + The response will include error code, hint and detail. Since protocol **v1**. - Otherwise, the body contains information using the template :ref:`validation-unknown <challenger_validation-unknown>`. :http:statuscode:`429 Too Many Requests`: There have been too many attempts to solve the challenge for this address (and $NONCE). The user-agent should either try a different address (or wait and (eventually) request a fresh nonce to be set up by the client). - If the request ask for application/json the response will include error + The response will include error code, hint and detail. Since protocol **v2**. :http:statuscode:`500 Internal Server Error`: Server is not able to respond due to internal problems. - If the request ask for application/json the response will include error + The response will include error code, hint and detail. Since protocol **v1**. - Otherwise, the body contains information using the template :ref:`internal-error <challenger_internal-error>`. .. ts:def:: ChallengeSolveResponse @@ -559,7 +538,7 @@ Info // address_type. address: Object; - // Type of the address. + // Type of the address. address_type: string; // How long do we consider the address to be diff --git a/core/api-donau.rst b/core/api-donau.rst @@ -486,7 +486,7 @@ Donation statement operations are requested by a donor. **Response:** :http:statuscode:`201 Created`: - The request was successful, and the created `DonationStatement` is stored. + The request was successful, and a donation statement is now available. The response will be empty. :http:statuscode:`403 Forbidden`: One of the signatures is invalid. This response comes with a standard `ErrorDetail` response. :http:statuscode:`404 Not found`: @@ -507,10 +507,10 @@ Donation statement operations are requested by a donor. .. ts:def:: DonationReceipt - interface DonationReceipt{ + interface DonationReceipt { h_donation_unit_pub: HashCode; nonce: string; - donation_unit_sig: DonationReceiptSignature + donation_unit_sig: DonationReceiptSignature; } .. ts:def:: DonationReceiptSignature diff --git a/core/api-merchant.rst b/core/api-merchant.rst @@ -120,13 +120,15 @@ such as the implemented version of the protocol and the currency used. .. http:get:: /config Return the protocol version and currency supported by this merchant backend. - This specification corresponds to ``current`` protocol being version **v16**. + This specification corresponds to ``current`` protocol being version **v17**. **Response:** :http:statuscode:`200 OK`: The body is a `VersionResponse`. + **Details:** + .. ts:def:: VersionResponse interface VersionResponse { @@ -227,6 +229,18 @@ claim orders (say in a case where stocks are limited). The request must be a `ClaimRequest`. + **Response:** + + :http:statuscode:`200 OK`: + The client has successfully claimed the order. + The response contains the :ref:`contract terms <contract-terms>`. + :http:statuscode:`404 Not found`: + The backend is unaware of the instance or order. + :http:statuscode:`409 Conflict`: + Someone else has already claimed the same order ID with a different nonce. + + **Details:** + .. ts:def:: ClaimRequest interface ClaimRequest { @@ -239,16 +253,6 @@ claim orders (say in a case where stocks are limited). token?: ClaimToken; } - **Response:** - - :http:statuscode:`200 OK`: - The client has successfully claimed the order. - The response contains the :ref:`contract terms <contract-terms>`. - :http:statuscode:`404 Not found`: - The backend is unaware of the instance or order. - :http:statuscode:`409 Conflict`: - Someone else has already claimed the same order ID with a different nonce. - .. ts:def:: ClaimResponse interface ClaimResponse { @@ -313,6 +317,18 @@ Making the payment The given exchange is not acceptable for this merchant, as it is not in the list of accepted exchanges and not audited by an approved auditor. TODO: Status code may be changed to 409 in the future as 412 is technically wrong. + :http:statuscode:`451 Unavailable for Legal Reasons`: + The exchange has rejected the deposit by the merchant + for legal reasons. This is **not** exactly a client + failure (and possibly nobody's fault except for the + regulator). In any case, the wallet should refresh + the deposited coins of the affected exchange and + may try to pay with coins from another exchange if + possible (it has such coins and the merchant accepts + coins from another exchange). + The body is a `PaymentDeniedLegallyResponse` with + details about the failure. + Since protocol **v17**. :http:statuscode:`502 Bad gateway`: The merchant's interaction with the exchange failed in some way. The client might want to try again later. @@ -328,6 +344,8 @@ Making the payment the browser/wallet. If the payment was successful, the frontend MAY use this to trigger some business logic. + **Details:** + .. ts:def:: PaymentResponse interface PaymentResponse { @@ -512,6 +530,19 @@ Making the payment cs_blinded_c1: string; // Crockford `Base32` encoded } + .. ts:def:: PaymentDeniedLegallyResponse + + interface PaymentDeniedLegallyResponse { + + // Base URL of the exchanges that denied the payment. + // The wallet should refresh the coins from these + // exchanges, but may try to pay with coins from + // other exchanges. + exchange_base_urls: string[]; + + } + + Querying payment status ----------------------- @@ -568,6 +599,8 @@ Querying payment status :http:statuscode:`406 Not acceptable`: The merchant backend could not load the template required to generate a reply in the desired format. (Likely HTML templates were not properly installed.) + **Details:** + .. ts:def:: StatusPaidResponse interface StatusPaidResponse { @@ -755,6 +788,8 @@ are for incomplete payments for an order and never for established contracts. :ref:`refund <exchange_refund>` API. The frontend should pass the replies verbatim to the browser/wallet. + **Details:** + .. ts:def:: AbortRequest interface AbortRequest { @@ -869,6 +904,17 @@ the contract. Refunds must be approved by the merchant's business logic. The ``h_contract`` does not match the order. :http:statuscode:`404 Not found`: The merchant backend is unaware of the order. + :http:statuscode:`451 Unavailable for Legal Reasons`: + The refund could not be awarded because of legal + reasons (an exchange refused). The wallet should + show an error message and suggest to the user to + get in touch with the merchant to try to get the + refund in a different way. + The body is a `PaymentDeniedLegallyResponse` with + details about the exchange causing the failure. + Since protocol **v17**. + + **Details:** .. ts:def:: WalletRefundRequest @@ -1001,6 +1047,8 @@ Setting up instances would be if a deleted but not purged instance is known under this ID to the backend. + **Details:** + .. ts:def:: InstanceConfigurationMessage interface InstanceConfigurationMessage { @@ -1068,6 +1116,8 @@ Setting up instances :http:statuscode:`404 Not found`: This instance is unknown and thus cannot be reconfigured. + **Details:** + .. ts:def:: InstanceAuthConfigurationMessage interface InstanceAuthConfigurationMessage { @@ -1166,6 +1216,8 @@ Setting up instances :http:statuscode:`404 Not found`: This instance is unknown and thus cannot be reconfigured. + **Details:** + .. ts:def:: InstanceReconfigurationMessage interface InstanceReconfigurationMessage { @@ -1228,6 +1280,8 @@ Inspecting instances The backend has successfully returned the list of instances stored. Returns a `InstancesResponse`. + **Details:** + .. ts:def:: InstancesResponse interface InstancesResponse { @@ -1284,6 +1338,8 @@ Inspecting instances The backend has successfully returned the list of instances stored. Returns a `QueryInstancesResponse`. + **Details:** + .. ts:def:: QueryInstancesResponse interface QueryInstancesResponse { @@ -1377,10 +1433,7 @@ Deleting instances KYC status checks ----------------- - .. note:: - - This is a draft API that is not yet implemented. - +.. _merchantkycstatus: .. http:GET:: /management/instances/$INSTANCE/kyc .. http:GET:: /instances/$INSTANCE/private/kyc @@ -1448,7 +1501,8 @@ KYC status checks // proceed with the KYC process (as returned // by the exchange's ``/kyc-check/`` endpoint). // Optional, missing if the account is blocked - // due to AML and not due to KYC. + // due to the need for a KYC auth transfer. + // (See ``payto_kycauth`` in that case.) kyc_url?: string; // Array with limitations that currently apply to this @@ -1476,6 +1530,13 @@ KYC status checks // Our bank wire account this is about. payto_uri: string; + // Wire transfer instructions (including + // amount and subject) for a KYC auth wire + // transfer. Set only if this is required + // to get the given exchange working. + // Optional. Since protocol **v17**. + payto_kycauth?: string; + } .. ts:def:: ExchangeKycTimeout @@ -1526,6 +1587,8 @@ into any of the active bank accounts of an instance. Inactive accounts can be reactivated using this method even if the credit facade information differs from the previous state. + **Details:** + .. ts:def:: AccountAddDetails interface AccountAddDetails { @@ -1598,6 +1661,8 @@ into any of the active bank accounts of an instance. :http:statuscode:`404 Not found`: The template(ID) is unknown to the backend. + **Details:** + .. ts:def:: AccountPatchDetails interface AccountPatchDetails { @@ -1629,6 +1694,8 @@ into any of the active bank accounts of an instance. :http:statuscode:`404 Not found`: The backend has does not know about the instance. + **Details:** + .. ts:def:: AccountsSummaryResponse interface AccountsSummaryResponse { @@ -1665,6 +1732,8 @@ into any of the active bank accounts of an instance. :http:statuscode:`404 Not found`: The bank account or instance is unknown to the backend. + **Details:** + .. ts:def:: BankAccountDetail interface BankAccountDetail { @@ -2033,6 +2102,8 @@ Inspecting inventory :http:statuscode:`404 Not found`: The backend has does not know about the instance. + **Details:** + .. ts:def:: InventorySummaryResponse interface InventorySummaryResponse { @@ -2067,6 +2138,8 @@ Inspecting inventory :http:statuscode:`404 Not found`: The product (ID) is unknown to the backend. + **Details:** + .. ts:def:: ProductDetail interface ProductDetail { @@ -2136,6 +2209,8 @@ Inspecting inventory :http:statuscode:`404 Not found`: The backend has does not know about the instance. + **Details:** + .. ts:def:: FullInventoryDetailsResponse interface FullInventoryDetailsResponse { @@ -2244,6 +2319,8 @@ Reserving inventory :http:statuscode:`410 Gone`: The backend does not have enough of product in stock. + **Details:** + .. ts:def:: LockRequest interface LockRequest { @@ -2343,7 +2420,19 @@ Creating orders :http:statuscode:`410 Gone`: The order given used products from the inventory that are out of stock. The response is a :ts:type:`OutOfStockResponse`. + :http:statuscode:`451 Unavailable for Legal Reasons`: + The order could not be created because of legal + reasons, specifically no exchange would accept + a payment at this time because we have not yet + satisfied the respective legal requirements. + The :ref:`KYC status <merchantkycstatus>` API + can be used to determine details about how to + proceed with the KYC process. + The body is a `PaymentDeniedLegallyResponse` with + details about the exchange(s) causing the failure. + Since protocol **v17**. + **Details:** .. ts:def:: PostOrderRequest @@ -2518,11 +2607,11 @@ Creating orders } -The `OrderChoice` object describes a possible choice within an order. The -choice is done by the wallet and consists of in- and outputs. In the example -of buying an article, the merchant could present the customer with the choice -to use a valid subscription token or pay using a gift voucher. Available since -protocol **vSUBSCRIBE**. + The `OrderChoice` object describes a possible choice within an order. The + choice is done by the wallet and consists of in- and outputs. In the example + of buying an article, the merchant could present the customer with the + choice to use a valid subscription token or pay using a gift + voucher. Available since protocol **vSUBSCRIBE**. .. ts:def:: OrderChoice @@ -2620,49 +2709,48 @@ protocol **vSUBSCRIBE**. the ``amount`` of the ``order``, so the frontend must already have calculated the total price --- including the ``inventory_products``. -.. ts:def:: MinimalInventoryProduct + .. ts:def:: MinimalInventoryProduct - // Note that if the frontend does give details beyond these, - // it will override those details (including price or taxes) - // that the backend would otherwise fill in via the inventory. - interface MinimalInventoryProduct { - // Which product is requested (here mandatory!). - product_id: string; - - // How many units of the product are requested. - quantity: Integer; - } + // Note that if the frontend does give details beyond these, + // it will override those details (including price or taxes) + // that the backend would otherwise fill in via the inventory. + interface MinimalInventoryProduct { + // Which product is requested (here mandatory!). + product_id: string; -.. ts:def:: PostOrderResponse + // How many units of the product are requested. + quantity: Integer; + } - interface PostOrderResponse { - // Order ID of the response that was just created. - order_id: string; + .. ts:def:: PostOrderResponse - // Token that authorizes the wallet to claim the order. - // Provided only if "create_token" was set to 'true' - // in the request. - token?: ClaimToken; - } + interface PostOrderResponse { + // Order ID of the response that was just created. + order_id: string; + // Token that authorizes the wallet to claim the order. + // Provided only if "create_token" was set to 'true' + // in the request. + token?: ClaimToken; + } -.. ts:def:: OutOfStockResponse + .. ts:def:: OutOfStockResponse - interface OutOfStockResponse { + interface OutOfStockResponse { - // Product ID of an out-of-stock item. - product_id: string; + // Product ID of an out-of-stock item. + product_id: string; - // Requested quantity. - requested_quantity: Integer; + // Requested quantity. + requested_quantity: Integer; - // Available quantity (must be below ``requested_quantity``). - available_quantity: Integer; + // Available quantity (must be below ``requested_quantity``). + available_quantity: Integer; - // When do we expect the product to be again in stock? - // Optional, not given if unknown. - restock_expected?: Timestamp; - } + // When do we expect the product to be again in stock? + // Optional, not given if unknown. + restock_expected?: Timestamp; + } Inspecting orders @@ -2691,6 +2779,8 @@ Inspecting orders :http:statuscode:`200 OK`: The response is an `OrderHistory`. + **Details:** + .. ts:def:: OrderHistory interface OrderHistory { @@ -2757,6 +2847,8 @@ Inspecting orders The merchant's interaction with the exchange took too long. The client might want to try again later. + **Details:** + .. ts:def:: MerchantOrderStatusResponse type MerchantOrderStatusResponse = CheckPaymentPaidResponse | @@ -2982,6 +3074,8 @@ the contract!) to minimize risks from information leakage. The request includes a field that was not marked as forgettable, so the merchant cannot delete that field. + **Details:** + .. ts:def:: ForgetRequest interface ForgetRequest { @@ -3038,6 +3132,16 @@ Giving Refunds to the merchant. :http:statuscode:`409 Conflict`: The refund amount exceeds the amount originally paid. + :http:statuscode:`451 Unavailable for Legal Reasons`: + The refund could not be awarded because of legal + reasons (an exchange would refuse). The merchant + staff needs to find another way to give a refund + to the customer. + The body is a `PaymentDeniedLegallyResponse` with + details about the exchange causing the failure. + Since protocol **v17**. + + **Details:** .. ts:def:: RefundRequest @@ -3150,6 +3254,8 @@ Querying known wire transfers :http:statuscode:`200 OK`: The body of the response is a `TransferList`. + **Details:** + .. ts:def:: TransferList interface TransferList { @@ -3239,6 +3345,8 @@ to validate that a customer made a payment. :http:statuscode:`404 Not found`: The merchant instance is unknown or it is not in our data. + **Details:** + .. ts:def:: OtpDeviceAddDetails interface OtpDeviceAddDetails { @@ -3286,6 +3394,8 @@ to validate that a customer made a payment. The provided information is inconsistent with the current state of the template. Changes made is the same with another store. + **Details:** + .. ts:def:: OtpDevicePatchDetails interface OtpDevicePatchDetails { @@ -3319,6 +3429,8 @@ to validate that a customer made a payment. :http:statuscode:`404 Not found`: The backend has does not know about the instance. + **Details:** + .. ts:def:: OtpDeviceSummaryResponse interface OtpDeviceSummaryResponse { @@ -3362,6 +3474,8 @@ to validate that a customer made a payment. :http:statuscode:`404 Not found`: The OTP device or instance is unknown to the backend. + **Details:** + .. ts:def:: OtpDeviceDetails interface OtpDeviceDetails { @@ -3493,6 +3607,8 @@ Adding templates :http:statuscode:`404 Not found`: The merchant instance is unknown or it is not in our data. + **Details:** + .. ts:def:: TemplateAddDetails @@ -3571,6 +3687,8 @@ Editing templates The provided information is inconsistent with the current state of the template. Changes made is the same with another store. + **Details:** + .. ts:def:: TemplatePatchDetails @@ -3610,6 +3728,8 @@ Inspecting template :http:statuscode:`404 Not found`: The backend has does not know about the instance. + **Details:** + .. ts:def:: TemplateSummaryResponse interface TemplateSummaryResponse { @@ -3645,6 +3765,8 @@ Inspecting template :http:statuscode:`404 Not found`: The instance or template(ID) is unknown to the backend. + **Details:** + .. ts:def:: TemplateDetails @@ -3713,6 +3835,8 @@ Using template :http:statuscode:`404 Not found`: The instance or template(ID) is unknown to the backend. + **Details:** + .. ts:def:: WalletTemplateDetails interface WalletTemplateDetails { @@ -3797,6 +3921,8 @@ Adding webhooks :http:statuscode:`404 Not found`: The merchant instance is unknown or it not in our data. + **Details:** + .. ts:def:: WebhookAddDetails interface WebhookAddDetails { @@ -3842,6 +3968,8 @@ Editing webhooks :http:statuscode:`409 Conflict`: The provided information is inconsistent with the current state of the webhook. Changes made is the same with another store. + **Details:** + .. ts:def:: WebhookPatchDetails interface WebhookPatchDetails { @@ -3880,6 +4008,8 @@ Inspecting webhook :http:statuscode:`404 Not found`: The backend has does not know about the instance. + **Details:** + .. ts:def:: WebhookSummaryResponse interface WebhookSummaryResponse { @@ -3916,6 +4046,7 @@ Inspecting webhook :http:statuscode:`404 Not found`: The webhook(ID) is unknown to the backend. + **Details:** .. ts:def:: WebhookDetails @@ -3986,6 +4117,8 @@ Creating token families :http:statuscode:`404 Not found`: The merchant backend is unaware of the instance. + **Details:** + .. ts:def:: TokenFamilyCreateRequest interface TokenFamilyCreateRequest { @@ -4049,6 +4182,8 @@ Updating token families :http:statuscode:`404 Not found`: The merchant backend is unaware of the token family or instance. + **Details:** + .. ts:def:: TokenFamilyUpdateRequest interface TokenFamilyUpdateRequest { @@ -4091,6 +4226,8 @@ Inspecting token families :http:statuscode:`404 Not found`: The merchant backend is unaware of the instance. + **Details:** + .. ts:def:: TokenFamiliesList // TODO: Add pagination @@ -4136,6 +4273,7 @@ Inspecting token families :http:statuscode:`404 Not found`: The merchant backend is unaware of the token family or instance. + **Details:** The `TokenFamilyDetails` object describes a configured token family.