docs: add new endpoints

This commit is contained in:
Sebastian Rindom committed 2021-03-11 08:39:44 +01:00
1 parent 0601b34765
commit ca74226d4a
7 files changed
+1456 -1146

No files matched your search

+365 -365
View File
@@ -71,14 +71,14 @@
} }
], ],
"paths": { "paths": {
"/auth": { "/customers": {
"post": { "post": {
"operationId": "PostAuth", "operationId": "PostCustomers",
"summary": "Authenticate a User", "summary": "Create a Customer",
"description": "Logs a User in and authorizes them to manage Store settings.", "description": "Creates a Customer.",
"parameters": [], "parameters": [],
"tags": [ "tags": [
"Auth" "Customer"
], ],
"responses": { "responses": {
"200": { "200": {
@@ -88,7 +88,7 @@
"schema": { "schema": {
"properties": { "properties": {
"customer": { "customer": {
"$ref": "#/components/schemas/user" "$ref": "#/components/schemas/customer"
} }
} }
} }
@@ -103,16 +103,25 @@
"type": "object", "type": "object",
"required": [ "required": [
"email", "email",
"password" "first_name",
"last_name"
], ],
"properties": { "properties": {
"email": { "email": {
"type": "string", "type": "string",
"description": "The User's email." "description": "The Customer's email address."
}, },
"password": { "first_name": {
"type": "string", "type": "string",
"description": "The User's password." "description": "The Customer's first name."
},
"last_name": {
"type": "string",
"description": "The Customer's last name."
},
"phone": {
"type": "string",
"description": "The Customer's phone number."
} }
} }
} }
@@ -121,11 +130,11 @@
} }
}, },
"get": { "get": {
"operationId": "GetAuth", "operationId": "GetCustomers",
"summary": "Get Session", "summary": "List Customers",
"description": "Gets the currently logged in User.", "description": "Retrieves a list of Customers.",
"tags": [ "tags": [
"Auth" "Customer"
], ],
"responses": { "responses": {
"200": { "200": {
@@ -135,7 +144,101 @@
"schema": { "schema": {
"properties": { "properties": {
"customer": { "customer": {
"$ref": "#/components/schemas/user" "$ref": "#/components/schemas/customer"
}
}
}
}
}
}
}
}
},
"/customers/{id}": {
"get": {
"operationId": "GetCustomersCustomer",
"summary": "Retrieve a Customer",
"description": "Retrieves a Customer.",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "The id of the Customer.",
"schema": {
"type": "string"
}
}
],
"tags": [
"Customer"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"customer": {
"$ref": "#/components/schemas/customer"
}
}
}
}
}
}
}
},
"post": {
"operationId": "PostCustomersCustomer",
"summary": "Update a Customer",
"description": "Updates a Customer.",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "The id of the Customer.",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"first_name": {
"type": "string",
"description": "The Customer's first name."
},
"last_name": {
"type": "string",
"description": "The Customer's last name."
},
"phone": {
"description": "The Customer's phone number.",
"type": "object"
}
}
}
}
}
},
"tags": [
"Customer"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"customer": {
"$ref": "#/components/schemas/customer"
} }
} }
} }
@@ -357,14 +460,14 @@
} }
} }
}, },
"/customers": { "/auth": {
"post": { "post": {
"operationId": "PostCustomers", "operationId": "PostAuth",
"summary": "Create a Customer", "summary": "Authenticate a User",
"description": "Creates a Customer.", "description": "Logs a User in and authorizes them to manage Store settings.",
"parameters": [], "parameters": [],
"tags": [ "tags": [
"Customer" "Auth"
], ],
"responses": { "responses": {
"200": { "200": {
@@ -374,7 +477,7 @@
"schema": { "schema": {
"properties": { "properties": {
"customer": { "customer": {
"$ref": "#/components/schemas/customer" "$ref": "#/components/schemas/user"
} }
} }
} }
@@ -389,25 +492,16 @@
"type": "object", "type": "object",
"required": [ "required": [
"email", "email",
"first_name", "password"
"last_name"
], ],
"properties": { "properties": {
"email": { "email": {
"type": "string", "type": "string",
"description": "The Customer's email address." "description": "The User's email."
}, },
"first_name": { "password": {
"type": "string", "type": "string",
"description": "The Customer's first name." "description": "The User's password."
},
"last_name": {
"type": "string",
"description": "The Customer's last name."
},
"phone": {
"type": "string",
"description": "The Customer's phone number."
} }
} }
} }
@@ -416,11 +510,11 @@
} }
}, },
"get": { "get": {
"operationId": "GetCustomers", "operationId": "GetAuth",
"summary": "List Customers", "summary": "Get Session",
"description": "Retrieves a list of Customers.", "description": "Gets the currently logged in User.",
"tags": [ "tags": [
"Customer" "Auth"
], ],
"responses": { "responses": {
"200": { "200": {
@@ -430,7 +524,7 @@
"schema": { "schema": {
"properties": { "properties": {
"customer": { "customer": {
"$ref": "#/components/schemas/customer" "$ref": "#/components/schemas/user"
} }
} }
} }
@@ -440,24 +534,47 @@
} }
} }
}, },
"/customers/{id}": { "/gift-cards": {
"get": { "post": {
"operationId": "GetCustomersCustomer", "operationId": "PostGiftCards",
"summary": "Retrieve a Customer", "summary": "Create a Gift Card",
"description": "Retrieves a Customer.", "description": "Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region.",
"parameters": [ "requestBody": {
{ "content": {
"in": "path", "application/json": {
"name": "id", "schema": {
"required": true, "properties": {
"description": "The id of the Customer.", "value": {
"schema": { "type": "integer",
"type": "string" "description": "The value (excluding VAT) that the Gift Card should represent."
},
"is_disabled": {
"type": "boolean",
"description": "Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers."
},
"ends_at": {
"type": "string",
"format": "date-time",
"description": "The time at which the Gift Card should no longer be available."
},
"region_id": {
"description": "The id of the Region in which the Gift Card can be used.",
"type": "array",
"items": {
"type": "string"
}
},
"metadata": {
"description": "An optional set of key-value pairs to hold additional information.",
"type": "object"
}
}
}
} }
} }
], },
"tags": [ "tags": [
"Customer" "Gift Card"
], ],
"responses": { "responses": {
"200": { "200": {
@@ -466,8 +583,115 @@
"application/json": { "application/json": {
"schema": { "schema": {
"properties": { "properties": {
"customer": { "gift_card": {
"$ref": "#/components/schemas/customer" "$ref": "#/components/schemas/gift_card"
}
}
}
}
}
}
}
},
"get": {
"operationId": "GetGiftCards",
"summary": "List Gift Cards",
"description": "Retrieves a list of Gift Cards.",
"tags": [
"Gift Card"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"gift_cards": {
"type": "array",
"items": {
"$ref": "#/components/schemas/gift_card"
}
}
}
}
}
}
}
}
}
},
"/gift-cards/{id}": {
"delete": {
"operationId": "DeleteGiftCardsGiftCard",
"summary": "Delete a Gift Card",
"description": "Deletes a Gift Card",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "The id of the Gift Card to delete.",
"schema": {
"type": "string"
}
}
],
"tags": [
"Gift Card"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"id": {
"type": "string",
"description": "The id of the deleted Gift Card"
},
"object": {
"type": "string",
"description": "The type of the object that was deleted."
},
"deleted": {
"type": "boolean"
}
}
}
}
}
}
}
},
"get": {
"operationId": "GetGiftCardsGiftCard",
"summary": "Retrieve a Gift Card",
"description": "Retrieves a Gift Card.",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "The id of the Gift Card.",
"schema": {
"type": "string"
}
}
],
"tags": [
"Gift Card"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"gift_card": {
"$ref": "#/components/schemas/gift_card"
} }
} }
} }
@@ -477,15 +701,15 @@
} }
}, },
"post": { "post": {
"operationId": "PostCustomersCustomer", "operationId": "PostGiftCardsGiftCard",
"summary": "Update a Customer", "summary": "Create a Gift Card",
"description": "Updates a Customer.", "description": "Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region.",
"parameters": [ "parameters": [
{ {
"in": "path", "in": "path",
"name": "id", "name": "id",
"required": true, "required": true,
"description": "The id of the Customer.", "description": "The id of the Gift Card.",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -496,16 +720,28 @@
"application/json": { "application/json": {
"schema": { "schema": {
"properties": { "properties": {
"first_name": { "balance": {
"type": "string", "type": "integer",
"description": "The Customer's first name." "description": "The value (excluding VAT) that the Gift Card should represent."
}, },
"last_name": { "is_disabled": {
"type": "string", "type": "boolean",
"description": "The Customer's last name." "description": "Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers."
}, },
"phone": { "ends_at": {
"description": "The Customer's phone number.", "type": "string",
"format": "date-time",
"description": "The time at which the Gift Card should no longer be available."
},
"region_id": {
"description": "The id of the Region in which the Gift Card can be used.",
"type": "array",
"items": {
"type": "string"
}
},
"metadata": {
"description": "An optional set of key-value pairs to hold additional information.",
"type": "object" "type": "object"
} }
} }
@@ -514,7 +750,7 @@
} }
}, },
"tags": [ "tags": [
"Customer" "Gift Card"
], ],
"responses": { "responses": {
"200": { "200": {
@@ -523,8 +759,8 @@
"application/json": { "application/json": {
"schema": { "schema": {
"properties": { "properties": {
"customer": { "gift_card": {
"$ref": "#/components/schemas/customer" "$ref": "#/components/schemas/gift_card"
} }
} }
} }
@@ -1038,242 +1274,6 @@
} }
} }
}, },
"/gift-cards": {
"post": {
"operationId": "PostGiftCards",
"summary": "Create a Gift Card",
"description": "Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region.",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"value": {
"type": "integer",
"description": "The value (excluding VAT) that the Gift Card should represent."
},
"is_disabled": {
"type": "boolean",
"description": "Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers."
},
"ends_at": {
"type": "string",
"format": "date-time",
"description": "The time at which the Gift Card should no longer be available."
},
"region_id": {
"description": "The id of the Region in which the Gift Card can be used.",
"type": "array",
"items": {
"type": "string"
}
},
"metadata": {
"description": "An optional set of key-value pairs to hold additional information.",
"type": "object"
}
}
}
}
}
},
"tags": [
"Gift Card"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"gift_card": {
"$ref": "#/components/schemas/gift_card"
}
}
}
}
}
}
}
},
"get": {
"operationId": "GetGiftCards",
"summary": "List Gift Cards",
"description": "Retrieves a list of Gift Cards.",
"tags": [
"Gift Card"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"gift_cards": {
"type": "array",
"items": {
"$ref": "#/components/schemas/gift_card"
}
}
}
}
}
}
}
}
}
},
"/gift-cards/{id}": {
"delete": {
"operationId": "DeleteGiftCardsGiftCard",
"summary": "Delete a Gift Card",
"description": "Deletes a Gift Card",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "The id of the Gift Card to delete.",
"schema": {
"type": "string"
}
}
],
"tags": [
"Gift Card"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"id": {
"type": "string",
"description": "The id of the deleted Gift Card"
},
"object": {
"type": "string",
"description": "The type of the object that was deleted."
},
"deleted": {
"type": "boolean"
}
}
}
}
}
}
}
},
"get": {
"operationId": "GetGiftCardsGiftCard",
"summary": "Retrieve a Gift Card",
"description": "Retrieves a Gift Card.",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "The id of the Gift Card.",
"schema": {
"type": "string"
}
}
],
"tags": [
"Gift Card"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"gift_card": {
"$ref": "#/components/schemas/gift_card"
}
}
}
}
}
}
}
},
"post": {
"operationId": "PostGiftCardsGiftCard",
"summary": "Create a Gift Card",
"description": "Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region.",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "The id of the Gift Card.",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"balance": {
"type": "integer",
"description": "The value (excluding VAT) that the Gift Card should represent."
},
"is_disabled": {
"type": "boolean",
"description": "Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers."
},
"ends_at": {
"type": "string",
"format": "date-time",
"description": "The time at which the Gift Card should no longer be available."
},
"region_id": {
"description": "The id of the Region in which the Gift Card can be used.",
"type": "array",
"items": {
"type": "string"
}
},
"metadata": {
"description": "An optional set of key-value pairs to hold additional information.",
"type": "object"
}
}
}
}
}
},
"tags": [
"Gift Card"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"gift_card": {
"$ref": "#/components/schemas/gift_card"
}
}
}
}
}
}
}
}
},
"/notifications": { "/notifications": {
"get": { "get": {
"operationId": "GetNotifications", "operationId": "GetNotifications",
@@ -3915,6 +3915,35 @@
} }
} }
}, },
"/returns": {
"get": {
"operationId": "GetReturns",
"summary": "List Returns",
"description": "Retrieves a list of Returns",
"tags": [
"Return"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"returns": {
"type": "array",
"items": {
"$ref": "#/components/schemas/return"
}
}
}
}
}
}
}
}
}
},
"/regions/{id}/countries": { "/regions/{id}/countries": {
"post": { "post": {
"operationId": "PostRegionsRegionCountries", "operationId": "PostRegionsRegionCountries",
@@ -4554,35 +4583,6 @@
} }
} }
}, },
"/returns": {
"get": {
"operationId": "GetReturns",
"summary": "List Returns",
"description": "Retrieves a list of Returns",
"tags": [
"Return"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"returns": {
"type": "array",
"items": {
"$ref": "#/components/schemas/return"
}
}
}
}
}
}
}
}
}
},
"/shipping-options": { "/shipping-options": {
"post": { "post": {
"operationId": "PostShippingOptions", "operationId": "PostShippingOptions",
@@ -5051,6 +5051,35 @@
} }
} }
}, },
"/swaps": {
"get": {
"operationId": "GetSwaps",
"summary": "List Swaps",
"description": "Retrieves a list of Swaps.",
"tags": [
"Swap"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"swaps": {
"type": "array",
"items": {
"$ref": "#/components/schemas/swap"
}
}
}
}
}
}
}
}
}
},
"/store/currencies/{code}": { "/store/currencies/{code}": {
"post": { "post": {
"operationId": "PostStoreCurrenciesCode", "operationId": "PostStoreCurrenciesCode",
@@ -5224,35 +5253,6 @@
} }
} }
}, },
"/swaps": {
"get": {
"operationId": "GetSwaps",
"summary": "List Swaps",
"description": "Retrieves a list of Swaps.",
"tags": [
"Swap"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"swaps": {
"type": "array",
"items": {
"$ref": "#/components/schemas/swap"
}
}
}
}
}
}
}
}
}
},
"/variants": { "/variants": {
"get": { "get": {
"operationId": "GetVariants", "operationId": "GetVariants",
+172 -172
View File
@@ -695,178 +695,6 @@ paths:
properties: properties:
discount: discount:
$ref: '#/components/schemas/discount' $ref: '#/components/schemas/discount'
/gift-cards:
post:
operationId: PostGiftCards
summary: Create a Gift Card
description: >-
Creates a Gift Card that can redeemed by its unique code. The Gift Card
is only valid within 1 region.
requestBody:
content:
application/json:
schema:
properties:
value:
type: integer
description: >-
The value (excluding VAT) that the Gift Card should
represent.
is_disabled:
type: boolean
description: >-
Whether the Gift Card is disabled on creation. You will have
to enable it later to make it available to Customers.
ends_at:
type: string
format: date-time
description: >-
The time at which the Gift Card should no longer be
available.
region_id:
description: The id of the Region in which the Gift Card can be used.
type: array
items:
type: string
metadata:
description: >-
An optional set of key-value pairs to hold additional
information.
type: object
tags:
- Gift Card
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
gift_card:
$ref: '#/components/schemas/gift_card'
get:
operationId: GetGiftCards
summary: List Gift Cards
description: Retrieves a list of Gift Cards.
tags:
- Gift Card
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
gift_cards:
type: array
items:
$ref: '#/components/schemas/gift_card'
'/gift-cards/{id}':
delete:
operationId: DeleteGiftCardsGiftCard
summary: Delete a Gift Card
description: Deletes a Gift Card
parameters:
- in: path
name: id
required: true
description: The id of the Gift Card to delete.
schema:
type: string
tags:
- Gift Card
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
id:
type: string
description: The id of the deleted Gift Card
object:
type: string
description: The type of the object that was deleted.
deleted:
type: boolean
get:
operationId: GetGiftCardsGiftCard
summary: Retrieve a Gift Card
description: Retrieves a Gift Card.
parameters:
- in: path
name: id
required: true
description: The id of the Gift Card.
schema:
type: string
tags:
- Gift Card
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
gift_card:
$ref: '#/components/schemas/gift_card'
post:
operationId: PostGiftCardsGiftCard
summary: Create a Gift Card
description: >-
Creates a Gift Card that can redeemed by its unique code. The Gift Card
is only valid within 1 region.
parameters:
- in: path
name: id
required: true
description: The id of the Gift Card.
schema:
type: string
requestBody:
content:
application/json:
schema:
properties:
balance:
type: integer
description: >-
The value (excluding VAT) that the Gift Card should
represent.
is_disabled:
type: boolean
description: >-
Whether the Gift Card is disabled on creation. You will have
to enable it later to make it available to Customers.
ends_at:
type: string
format: date-time
description: >-
The time at which the Gift Card should no longer be
available.
region_id:
description: The id of the Region in which the Gift Card can be used.
type: array
items:
type: string
metadata:
description: >-
An optional set of key-value pairs to hold additional
information.
type: object
tags:
- Gift Card
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
gift_card:
$ref: '#/components/schemas/gift_card'
/notifications: /notifications:
get: get:
operationId: GetNotifications operationId: GetNotifications
@@ -1834,6 +1662,178 @@ paths:
properties: properties:
order: order:
$ref: '#/components/schemas/order' $ref: '#/components/schemas/order'
/gift-cards:
post:
operationId: PostGiftCards
summary: Create a Gift Card
description: >-
Creates a Gift Card that can redeemed by its unique code. The Gift Card
is only valid within 1 region.
requestBody:
content:
application/json:
schema:
properties:
value:
type: integer
description: >-
The value (excluding VAT) that the Gift Card should
represent.
is_disabled:
type: boolean
description: >-
Whether the Gift Card is disabled on creation. You will have
to enable it later to make it available to Customers.
ends_at:
type: string
format: date-time
description: >-
The time at which the Gift Card should no longer be
available.
region_id:
description: The id of the Region in which the Gift Card can be used.
type: array
items:
type: string
metadata:
description: >-
An optional set of key-value pairs to hold additional
information.
type: object
tags:
- Gift Card
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
gift_card:
$ref: '#/components/schemas/gift_card'
get:
operationId: GetGiftCards
summary: List Gift Cards
description: Retrieves a list of Gift Cards.
tags:
- Gift Card
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
gift_cards:
type: array
items:
$ref: '#/components/schemas/gift_card'
'/gift-cards/{id}':
delete:
operationId: DeleteGiftCardsGiftCard
summary: Delete a Gift Card
description: Deletes a Gift Card
parameters:
- in: path
name: id
required: true
description: The id of the Gift Card to delete.
schema:
type: string
tags:
- Gift Card
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
id:
type: string
description: The id of the deleted Gift Card
object:
type: string
description: The type of the object that was deleted.
deleted:
type: boolean
get:
operationId: GetGiftCardsGiftCard
summary: Retrieve a Gift Card
description: Retrieves a Gift Card.
parameters:
- in: path
name: id
required: true
description: The id of the Gift Card.
schema:
type: string
tags:
- Gift Card
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
gift_card:
$ref: '#/components/schemas/gift_card'
post:
operationId: PostGiftCardsGiftCard
summary: Create a Gift Card
description: >-
Creates a Gift Card that can redeemed by its unique code. The Gift Card
is only valid within 1 region.
parameters:
- in: path
name: id
required: true
description: The id of the Gift Card.
schema:
type: string
requestBody:
content:
application/json:
schema:
properties:
balance:
type: integer
description: >-
The value (excluding VAT) that the Gift Card should
represent.
is_disabled:
type: boolean
description: >-
Whether the Gift Card is disabled on creation. You will have
to enable it later to make it available to Customers.
ends_at:
type: string
format: date-time
description: >-
The time at which the Gift Card should no longer be
available.
region_id:
description: The id of the Region in which the Gift Card can be used.
type: array
items:
type: string
metadata:
description: >-
An optional set of key-value pairs to hold additional
information.
type: object
tags:
- Gift Card
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
gift_card:
$ref: '#/components/schemas/gift_card'
'/products/{id}/options': '/products/{id}/options':
post: post:
operationId: PostProductsProductOptions operationId: PostProductsProductOptions
+706 -559
View File
File diff suppressed because it is too large. Load diff
+149 -48
View File
@@ -645,6 +645,28 @@ paths:
data: data:
type: object type: object
description: The data to update the payment session with. description: The data to update the payment session with.
'/gift-cards/{code}':
get:
operationId: GetGiftCardsCode
summary: Retrieve Gift Card by Code
description: Retrieves a Gift Card by its associated unqiue code.
tags:
- Gift Card
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
id:
description: The id of the Gift Card
code:
description: The code of the Gift Card
value:
description: The original value of the Gift Card.
balance:
description: The current balanace of the Gift Card
'/customers/{id}/addresses': '/customers/{id}/addresses':
post: post:
operationId: PostCustomersCustomerAddresses operationId: PostCustomersCustomerAddresses
@@ -977,54 +999,6 @@ paths:
password: password:
type: string type: string
description: The new password to set for the Customer. description: The new password to set for the Customer.
'/orders/cart/{cart_id}':
get:
operationId: GetOrdersOrderCartId
summary: Retrieves Order by Cart id
description: >-
Retrieves an Order by the id of the Cart that was used to create the
Order.
parameters:
- in: path
name: cart_id
required: true
description: The id of Cart.
schema:
type: string
tags:
- Order
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
order:
$ref: '#/components/schemas/order'
'/orders/{id}':
get:
operationId: GetOrdersOrder
summary: Retrieves an Order
description: Retrieves an Order
parameters:
- in: path
name: id
required: true
description: The id of the Order.
schema:
type: string
tags:
- Order
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
'/products/{id}': '/products/{id}':
get: get:
operationId: GetProductsProduct operationId: GetProductsProduct
@@ -1075,6 +1049,133 @@ paths:
type: array type: array
items: items:
$ref: '#/components/schemas/product' $ref: '#/components/schemas/product'
'/orders/cart/{cart_id}':
get:
operationId: GetOrdersOrderCartId
summary: Retrieves Order by Cart id
description: >-
Retrieves an Order by the id of the Cart that was used to create the
Order.
parameters:
- in: path
name: cart_id
required: true
description: The id of Cart.
schema:
type: string
tags:
- Order
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
order:
$ref: '#/components/schemas/order'
'/orders/{id}':
get:
operationId: GetOrdersOrder
summary: Retrieves an Order
description: Retrieves an Order
parameters:
- in: path
name: id
required: true
description: The id of the Order.
schema:
type: string
tags:
- Order
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
/orders:
get:
operationId: GetOrders
summary: Look Up an Order
description: >-
Looks for an Order with a given `display_id`, `email` pair. The
`display_id`, `email` pair must match in order for the Order to be
returned.
parameters:
- in: query
name: display_id
required: true
description: The display id given to the Order.
schema:
type: number
- in: query
name: email
required: true
description: The email of the Order with the given display_id.
schema:
type: string
tags:
- Order
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
order:
$ref: '#/components/schemas/order'
/returns:
post:
operationId: PostReturns
summary: Create Return
description: Creates a Return for an Order.
requestBody:
content:
application/json:
schema:
properties:
order_id:
type: string
description: The id of the Order to create the Return from.
items:
description: The items to include in the Return.
type: array
items:
properties:
item_id:
description: The id of the Line Item from the Order.
type: string
quantity:
description: The quantity to return.
type: integer
return_shipping:
description: >-
If the Return is to be handled by the store operator the
Customer can choose a Return Shipping Method. Alternatvely
the Customer can handle the Return themselves.
type: object
properties:
option_id:
type: string
description: >-
The id of the Shipping Option to create the Shipping
Method from.
tags:
- Return
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
return:
$ref: '#/components/schemas/return'
'/regions/{id}': '/regions/{id}':
get: get:
operationId: GetRegionsRegion operationId: GetRegionsRegion
@@ -6,7 +6,7 @@ import { defaultRelations, defaultFields } from "./"
* summary: "Retrieve Gift Card by Code" * summary: "Retrieve Gift Card by Code"
* description: "Retrieves a Gift Card by its associated unqiue code." * description: "Retrieves a Gift Card by its associated unqiue code."
* tags: * tags:
* - Region * - Gift Card
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
@@ -1,6 +1,26 @@
import { Validator, MedusaError } from "medusa-core-utils" import { Validator, MedusaError } from "medusa-core-utils"
import { defaultRelations, defaultFields } from "./index" import { defaultRelations, defaultFields } from "./index"
/**
* @oas [get] /orders
* operationId: "GetOrders"
* summary: "Look Up an Order"
* description: "Looks for an Order with a given `display_id`, `email` pair. The `display_id`, `email` pair must match in order for the Order to be returned."
* parameters:
* - (query) display_id=* {number} The display id given to the Order.
* - (query) email=* {string} The email of the Order with the given display_id.
* tags:
* - Order
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* properties:
* order:
* $ref: "#/components/schemas/order"
*/
export default async (req, res) => { export default async (req, res) => {
const schema = Validator.object().keys({ const schema = Validator.object().keys({
display_id: Validator.number().required(), display_id: Validator.number().required(),
@@ -1,6 +1,48 @@
import { MedusaError, Validator } from "medusa-core-utils" import { MedusaError, Validator } from "medusa-core-utils"
import { defaultRelations, defaultFields } from "./"
/**
* @oas [post] /returns
* operationId: "PostReturns"
* summary: "Create Return"
* description: "Creates a Return for an Order."
* requestBody:
* content:
* application/json:
* schema:
* properties:
* order_id:
* type: string
* description: The id of the Order to create the Return from.
* items:
* description: "The items to include in the Return."
* type: array
* items:
* properties:
* item_id:
* description: The id of the Line Item from the Order.
* type: string
* quantity:
* description: The quantity to return.
* type: integer
* return_shipping:
* description: If the Return is to be handled by the store operator the Customer can choose a Return Shipping Method. Alternatvely the Customer can handle the Return themselves.
* type: object
* properties:
* option_id:
* type: string
* description: The id of the Shipping Option to create the Shipping Method from.
* tags:
* - Return
* responses:
* 200:
* description: OK
* content:
* application/json:
* schema:
* properties:
* return:
* $ref: "#/components/schemas/return"
*/
export default async (req, res) => { export default async (req, res) => {
const schema = Validator.object().keys({ const schema = Validator.object().keys({
order_id: Validator.string().required(), order_id: Validator.string().required(),