summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorpriscilla <priscilla.huang@efrei.net>2022-11-15 04:44:28 -0500
committerpriscilla <priscilla.huang@efrei.net>2022-11-15 04:44:28 -0500
commit413eec8c76b83214270d40382bdb6f0863583e70 (patch)
tree803fd8d78efd9c831655e6ffde67fa9f94888dfb /core
parent63eaa4fad0060617513a0637bc493ec5b15f79dc (diff)
downloaddocs-413eec8c76b83214270d40382bdb6f0863583e70.tar.gz
docs-413eec8c76b83214270d40382bdb6f0863583e70.tar.bz2
docs-413eec8c76b83214270d40382bdb6f0863583e70.zip
Update
Diffstat (limited to 'core')
-rw-r--r--core/api-merchant.rst110
1 files changed, 101 insertions, 9 deletions
diff --git a/core/api-merchant.rst b/core/api-merchant.rst
index 8a935cc8..1276a3c4 100644
--- a/core/api-merchant.rst
+++ b/core/api-merchant.rst
@@ -3056,13 +3056,18 @@ Adding templates
This is used to create template.
+ **Request:**
+
+ The request must be a `TemplateAddDetail`.
+
+
**Response:**
- :http:statuscode:`200 Ok`:
+ :http:statuscode:`200 No content`:
The creation of the template is successfull.
:http:statuscode:`404 Not found`
- The merchant instance is unknown.This is used to edit the template.
+ The merchant instance is unknown or it is not in our data.
.. ts:def:: TemplateAddDetail
@@ -3072,12 +3077,12 @@ Adding templates
// Template ID to use.
tenplate_id: string;
+ // Name of the store.
+ name_store: string;
+
// Human-readable summary for the template.
summary: string;
- // Map from IETF BCP 47 language tags to localized descriptions.
- description_i18n?: { [lang_tag: string]: string };
-
// The price is imposed by the merchant and cannot be changed by the customer.
// This parametrer is optional.
price_imposed?: Amount;
@@ -3102,16 +3107,50 @@ Editing templates
This is used to update template.
+ **Request:**
+
+ The request must be a `TemplatePatchDetail`.
+
**Response:**
- :http:statuscode:`200 Ok`:
+ :http:statuscode:`200 No content`:
The templates has successfully modififed.
:http:statuscode:`404 Not found`:
The templates(ID) is unknown to the backend.
:http:statuscode:`409 Conflict`:
- The provided information is inconsistent with the current state of the template.
+ The provided information is inconsistent with the current state of the template. Changes made is the same with
+ another store.
+
+
+ .. ts:def:: TemplatePatchDetail
+
+ interface TemplatePatchDetail {
+
+ // Template ID to use.
+ tenplate_id: string;
+
+ // Name of the store.
+ name_store: string;
+
+ // Human-readable summary for the template.
+ summary: string;
+
+ // The price is imposed by the merchant and cannot be changed by the customer.
+ // This parametrer is optional.
+ price_imposed?: Amount;
+
+ // A base64-encoded image selected by the merchant.
+ image: ImageDataUrl;
+
+ // Identifies where the store is.
+ address_store: Location;
+
+ // Minimum age buyer must have (in years). Default is 0.
+ minimum_age: Integer;
+
+ }
@@ -3120,18 +3159,38 @@ Inspecting template
.. http:get:: [/instances/$INSTANCE]/private/templates
- This is used to return the list of all the template.
+ This is used to return the list of all the templates.
**Response:**
:http:statuscode:`200 OK`:
- The backend has successfully returned all the template.
+ The backend has successfully returned all the templates. Returns a `TemplateSummaryResponse`.
:http:statuscode:`404 Not found`:
The backend has does not know about the instance.
+ .. ts:def:: TemplateSummaryResponse
+
+ interface TemplateSummaryResponse {
+
+ // List of templates that are present in our backend.
+ templates: TemplateEntry[];
+
+ }
+
+
+ The `TemplatesEntry` object describes an template. It has the following structure:
+
+ .. ts:def:: TemplateEntry
+
+ interface TemplateEntry {
+
+ // Template identifier, as found in the template.
+ template_id: string;
+
+
.. http:get:: [/instances/$INSTANCE]/private/templates/$TEMPLATE_ID
@@ -3142,9 +3201,42 @@ Inspecting template
:http:statuscode:`200 OK`:
The backend has successfully returned the detailed information about a specific template.
+ Returns a TemplateDetail.
:http:statuscode:`404 Not found`:
The template(ID) is unknown to the backend.
+
+
+ .. ts:def:: TemplateDetail
+
+ interface TemplateDetail {
+
+ // Template ID to use.
+ tenplate_id: string;
+
+ // Name of the store.
+ name_store: string;
+
+ // Name of the owner.
+ name_owner: string;
+
+ // Human-readable summary for the template.
+ summary: string;
+
+ // The price is imposed by the merchant and cannot be changed by the customer.
+ // This parametrer is optional.
+ price_imposed: Amount;
+
+ // A base64-encoded image selected by the merchant.
+ image: ImageDataUrl;
+
+ // Identifies where the store is.
+ address_store: Location;
+
+ // Minimum age buyer must have (in years). Default is 0.
+ minimum_age: Integer;
+
+ }