summaryrefslogtreecommitdiff
path: root/core/api-merchant.rst
diff options
context:
space:
mode:
authorChristian Blättler <blatc2@bfh.ch>2024-03-11 20:47:09 +0100
committerChristian Blättler <blatc2@bfh.ch>2024-03-11 20:47:09 +0100
commit7af0b3eb8b07027bb8dc079a08abb0bb44662f99 (patch)
tree73f80ce1efb4a6c5727f451615ac2ddd901e9458 /core/api-merchant.rst
parent9b0678d5fb4b7ffafae92539797858a84680c656 (diff)
parentf3cf0a283c328ebc71cfdbcf2894429066014a96 (diff)
downloaddocs-7af0b3eb8b07027bb8dc079a08abb0bb44662f99.tar.gz
docs-7af0b3eb8b07027bb8dc079a08abb0bb44662f99.tar.bz2
docs-7af0b3eb8b07027bb8dc079a08abb0bb44662f99.zip
Merge branch 'master' into feature/tokensfeature/tokens
Diffstat (limited to 'core/api-merchant.rst')
-rw-r--r--core/api-merchant.rst36
1 files changed, 30 insertions, 6 deletions
diff --git a/core/api-merchant.rst b/core/api-merchant.rst
index 7ae29d68..c1bbf058 100644
--- a/core/api-merchant.rst
+++ b/core/api-merchant.rst
@@ -123,7 +123,7 @@ 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 **10**.
+ This specification corresponds to ``current`` protocol being version **11**.
**Response:**
@@ -288,17 +288,17 @@ Making the payment
Either the client request is malformed or some specific processing error
happened that may be the fault of the client as detailed in the JSON body
of the response.
+ This includes the case where the payment is insufficient (sum is below
+ the required total amount, for example because the wallet calculated the
+ fees wrong).
:http:statuscode:`402 Payment required`:
There used to be a sufficient payment, but due to refunds the amount effectively
paid is no longer sufficient. (If the amount is generally insufficient, we
- return "406 Not Acceptable", only if this is because of refunds we return 402.)
+ return "400 Bad Request", only if this is because of refunds we return 402.)
:http:statuscode:`403 Forbidden`:
One of the coin signatures was not valid.
:http:statuscode:`404 Not found`:
The merchant backend could not find the order or the instance and thus cannot process the payment.
- :http:statuscode:`406 Not acceptable`:
- The payment is insufficient (sum is below the required total amount).
- TODO: Should probably change to a different status code in the future as 406 is technically wrong.
:http:statuscode:`408 Request timeout`:
The backend took too long to process the request. Likely the merchant's connection
to the exchange timed out. Try again.
@@ -2789,7 +2789,7 @@ to validate that a customer made a payment.
// ``otp_algorithm`` and matching client query arguments.
//
// Available since protocol **v10**.
- otp_code?: String;
+ otp_code?: string;
}
@@ -3048,6 +3048,30 @@ Removing template
Using template
----------------
+.. http:get:: [/instances/$INSTANCE]/templates/$TEMPLATE_ID
+
+ This is used to obtain information about a specific template by wallets
+ before they ask the user to fill in details.
+ This endpoint is available since protocol **v11**.
+
+ **Response:**
+
+ :http:statuscode:`200 OK`:
+ The backend has successfully returned the detailed information about a specific template.
+ Returns a `WalletTemplateDetails`.
+ :http:statuscode:`404 Not found`:
+ The instance or template(ID) is unknown to the backend.
+
+ .. ts:def:: WalletTemplateDetails
+
+ interface WalletTemplateDetails {
+
+ // Hard-coded information about the contrac terms
+ // for this template.
+ template_contract: TemplateContractDetails;
+ }
+
+
.. http:post:: [/instances/$INSTANCES]/templates/$TEMPLATE_ID
This using template can be modified by everyone and will be used to create order.