From 3ea6aea5beb2a50d1a3345fa3833eadb32d0a346 Mon Sep 17 00:00:00 2001 From: Sebastian Rindom Date: Wed, 10 Nov 2021 09:18:16 +0100 Subject: [PATCH] fix: updates documentation and fixes script blockers (#765) --- docs/api/admin-spec3.json | 2255 +++++++++++------ docs/api/admin-spec3.yaml | 1351 ++++++---- docs/api/store-spec3.json | 1155 +++++---- docs/api/store-spec3.yaml | 1272 +++++----- .../api/routes/admin/orders/cancel-claim.js | 4 +- .../admin/orders/cancel-fulfillment-claim.js | 2 +- .../api/routes/admin/orders/cancel-swap.js | 2 +- .../api/routes/admin/orders/create-swap.js | 2 +- .../store/customers/get-payment-methods.js | 2 - .../api/routes/store/customers/list-orders.js | 2 - .../src/models/custom-shipping-option.ts | 24 +- packages/medusa/src/models/note.ts | 3 +- 12 files changed, 3688 insertions(+), 2386 deletions(-) diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index caa5b03d0a..9c76462bd2 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -145,6 +145,187 @@ } } }, + "/customers": { + "post": { + "operationId": "PostCustomers", + "summary": "Create a Customer", + "description": "Creates a Customer.", + "parameters": [], + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "email", + "first_name", + "last_name" + ], + "properties": { + "email": { + "type": "string", + "description": "The Customer's email address." + }, + "first_name": { + "type": "string", + "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." + } + } + } + } + } + } + }, + "get": { + "operationId": "GetCustomers", + "summary": "List Customers", + "description": "Retrieves a list of Customers.", + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$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": { + "email": { + "type": "string", + "description": "The Customer's email. Only providable if user not registered." + }, + "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" + } + } + } + } + } + } + } + } + }, "/collections": { "post": { "operationId": "PostCollections", @@ -357,703 +538,6 @@ } } }, - "/customers": { - "post": { - "operationId": "PostCustomers", - "summary": "Create a Customer", - "description": "Creates a Customer.", - "parameters": [], - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "email", - "first_name", - "last_name" - ], - "properties": { - "email": { - "type": "string", - "description": "The Customer's email address." - }, - "first_name": { - "type": "string", - "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." - } - } - } - } - } - } - }, - "get": { - "operationId": "GetCustomers", - "summary": "List Customers", - "description": "Retrieves a list of Customers.", - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$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" - } - } - } - } - } - } - } - } - }, - "/draft-orders": { - "post": { - "operationId": "PostDraftOrders", - "summary": "Create a Draft Order", - "description": "Creates a Draft Order", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "description": "The status of the draft order", - "type": "string" - }, - "email": { - "description": "The email of the customer of the draft order", - "type": "string" - }, - "billing_address": { - "description": "The Address to be used for billing purposes.", - "anyOf": [ - { - "$ref": "#/components/schemas/address" - } - ] - }, - "shipping_address": { - "description": "The Address to be used for shipping.", - "anyOf": [ - { - "$ref": "#/components/schemas/address" - } - ] - }, - "items": { - "description": "The Line Items that have been received.", - "type": "array", - "items": { - "properties": { - "variant_id": { - "description": "The id of the Product Variant to generate the Line Item from.", - "type": "string" - }, - "unit_price": { - "description": "The potential custom price of the item.", - "type": "integer" - }, - "title": { - "description": "The potential custom title of the item.", - "type": "string" - }, - "quantity": { - "description": "The quantity of the Line Item.", - "type": "integer" - }, - "metadata": { - "description": "The optional key-value map with additional details about the Line Item.", - "type": "object" - } - } - } - }, - "region_id": { - "description": "The id of the region for the draft order", - "type": "string" - }, - "discounts": { - "description": "The discounts to add on the draft order", - "type": "array", - "items": { - "properties": { - "code": { - "description": "The code of the discount to apply", - "type": "string" - } - } - } - }, - "customer_id": { - "description": "The id of the customer to add on the draft order", - "type": "string" - }, - "no_notification_order": { - "description": "An optional flag passed to the resulting order to determine use of notifications.", - "type": "boolean" - }, - "shipping_methods": { - "description": "The shipping methods for the draft order", - "type": "array", - "items": { - "properties": { - "option_id": { - "description": "The id of the shipping option in use", - "type": "string" - }, - "data": { - "description": "The optional additional data needed for the shipping method", - "type": "object" - }, - "price": { - "description": "The potential custom price of the shipping", - "type": "integer" - } - } - } - }, - "metadata": { - "description": "The optional key-value map with additional details about the Draft Order.", - "type": "object" - } - } - } - } - } - }, - "tags": [ - "Draft Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "draft_order": { - "$ref": "#/components/schemas/draft-order" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "GetDraftOrders", - "summary": "List Draft Orders", - "description": "Retrieves an list of Draft Orders", - "tags": [ - "Draft Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "draft_order": { - "$ref": "#/components/schemas/draft-order" - } - } - } - } - } - } - } - } - }, - "/draft-orders/{id}/line-items": { - "post": { - "operationId": "PostDraftOrdersDraftOrderLineItems", - "summary": "Create a Line Item for Draft Order", - "description": "Creates a Line Item for the Draft Order", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "variant_id": { - "description": "The id of the Product Variant to generate the Line Item from.", - "type": "string" - }, - "unit_price": { - "description": "The potential custom price of the item.", - "type": "integer" - }, - "title": { - "description": "The potential custom title of the item.", - "type": "string" - }, - "quantity": { - "description": "The quantity of the Line Item.", - "type": "integer" - }, - "metadata": { - "description": "The optional key-value map with additional details about the Line Item.", - "type": "object" - } - } - } - } - } - }, - "tags": [ - "Draft Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "draft_order": { - "$ref": "#/components/schemas/draft-order" - } - } - } - } - } - } - } - } - }, - "/draft-orders/{id}": { - "delete": { - "operationId": "DeleteDraftOrdersDraftOrder", - "summary": "Delete a Draft Order", - "description": "Deletes a Draft Order", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Draft Order.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Draft Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string", - "description": "The id of the deleted Draft Order." - }, - "object": { - "type": "string", - "description": "The type of the object that was deleted." - }, - "deleted": { - "type": "boolean" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "GetDraftOrdersDraftOrder", - "summary": "Retrieve a Draft Order", - "description": "Retrieves a Draft Order.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Draft Order.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Draft Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "draft_order": { - "$ref": "#/components/schemas/draft-order" - } - } - } - } - } - } - } - } - }, - "/draft-orders/{id}/line-items/{line_id}": { - "delete": { - "operationId": "DeleteDraftOrdersDraftOrderLineItemsItem", - "summary": "Delete a Line Item", - "description": "Removes a Line Item from a Draft Order.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Draft Order.", - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "line_id", - "required": true, - "description": "The id of the Draft Order.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Draft Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "draft_order": { - "$ref": "#/components/schemas/draft-order" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "PostDraftOrdersDraftOrderLineItemsItem", - "summary": "Update a Line Item for a Draft Order", - "description": "Updates a Line Item for a Draft Order", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "unit_price": { - "description": "The potential custom price of the item.", - "type": "integer" - }, - "title": { - "description": "The potential custom title of the item.", - "type": "string" - }, - "quantity": { - "description": "The quantity of the Line Item.", - "type": "integer" - }, - "metadata": { - "description": "The optional key-value map with additional details about the Line Item.", - "type": "object" - } - } - } - } - } - }, - "tags": [ - "Draft Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "draft_order": { - "$ref": "#/components/schemas/draft-order" - } - } - } - } - } - } - } - } - }, - "/draft-orders/{id}/register-payment": { - "post": { - "summary": "Registers a payment for a Draft Order", - "operationId": "PostDraftOrdersDraftOrderRegisterPayment", - "description": "Registers a payment for a Draft Order.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The Draft Order id.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Draft Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "draft_order": { - "$ref": "#/components/schemas/draft-order" - } - } - } - } - } - } - } - } - }, - "/admin/draft-orders/{id}": { - "post": { - "operationId": "PostDraftOrdersDraftOrder", - "summary": "Update a Draft Order\"", - "description": "Updates a Draft Order.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Draft Order.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "region_id": { - "type": "string", - "description": "The id of the Region to create the Draft Order in." - }, - "email": { - "type": "string", - "description": "An email to be used on the Draft Order." - }, - "billing_address": { - "description": "The Address to be used for billing purposes.", - "anyOf": [ - { - "$ref": "#/components/schemas/address" - } - ] - }, - "shipping_address": { - "description": "The Address to be used for shipping.", - "anyOf": [ - { - "$ref": "#/components/schemas/address" - } - ] - }, - "discounts": { - "description": "An array of Discount codes to add to the Draft Order.", - "type": "array", - "items": { - "properties": { - "code": { - "description": "The code that a Discount is identifed by.", - "type": "string" - } - } - } - }, - "no_notification_order": { - "description": "An optional flag passed to the resulting order to determine use of notifications.", - "type": "boolean" - }, - "customer_id": { - "description": "The id of the Customer to associate the Draft Order with.", - "type": "string" - } - } - } - } - } - }, - "tags": [ - "Draft Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "draft_order": { - "$ref": "#/components/schemas/draft-order" - } - } - } - } - } - } - } - } - }, "/discounts/{id}/regions/{region_id}": { "post": { "operationId": "PostDiscountsDiscountRegionsRegion", @@ -1599,6 +1083,526 @@ } } }, + "/draft-orders": { + "post": { + "operationId": "PostDraftOrders", + "summary": "Create a Draft Order", + "description": "Creates a Draft Order", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "description": "The status of the draft order", + "type": "string" + }, + "email": { + "description": "The email of the customer of the draft order", + "type": "string" + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "shipping_address": { + "description": "The Address to be used for shipping.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "items": { + "description": "The Line Items that have been received.", + "type": "array", + "items": { + "properties": { + "variant_id": { + "description": "The id of the Product Variant to generate the Line Item from.", + "type": "string" + }, + "unit_price": { + "description": "The potential custom price of the item.", + "type": "integer" + }, + "title": { + "description": "The potential custom title of the item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + }, + "metadata": { + "description": "The optional key-value map with additional details about the Line Item.", + "type": "object" + } + } + } + }, + "region_id": { + "description": "The id of the region for the draft order", + "type": "string" + }, + "discounts": { + "description": "The discounts to add on the draft order", + "type": "array", + "items": { + "properties": { + "code": { + "description": "The code of the discount to apply", + "type": "string" + } + } + } + }, + "customer_id": { + "description": "The id of the customer to add on the draft order", + "type": "string" + }, + "no_notification_order": { + "description": "An optional flag passed to the resulting order to determine use of notifications.", + "type": "boolean" + }, + "shipping_methods": { + "description": "The shipping methods for the draft order", + "type": "array", + "items": { + "properties": { + "option_id": { + "description": "The id of the shipping option in use", + "type": "string" + }, + "data": { + "description": "The optional additional data needed for the shipping method", + "type": "object" + }, + "price": { + "description": "The potential custom price of the shipping", + "type": "integer" + } + } + } + }, + "metadata": { + "description": "The optional key-value map with additional details about the Draft Order.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetDraftOrders", + "summary": "List Draft Orders", + "description": "Retrieves an list of Draft Orders", + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, + "/draft-orders/{id}/line-items": { + "post": { + "operationId": "PostDraftOrdersDraftOrderLineItems", + "summary": "Create a Line Item for Draft Order", + "description": "Creates a Line Item for the Draft Order", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "variant_id": { + "description": "The id of the Product Variant to generate the Line Item from.", + "type": "string" + }, + "unit_price": { + "description": "The potential custom price of the item.", + "type": "integer" + }, + "title": { + "description": "The potential custom title of the item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + }, + "metadata": { + "description": "The optional key-value map with additional details about the Line Item.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, + "/draft-orders/{id}": { + "delete": { + "operationId": "DeleteDraftOrdersDraftOrder", + "summary": "Delete a Draft Order", + "description": "Deletes a Draft Order", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Draft Order." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetDraftOrdersDraftOrder", + "summary": "Retrieve a Draft Order", + "description": "Retrieves a Draft Order.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, + "/draft-orders/{id}/line-items/{line_id}": { + "delete": { + "operationId": "DeleteDraftOrdersDraftOrderLineItemsItem", + "summary": "Delete a Line Item", + "description": "Removes a Line Item from a Draft Order.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Draft Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "line_id", + "required": true, + "description": "The id of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostDraftOrdersDraftOrderLineItemsItem", + "summary": "Update a Line Item for a Draft Order", + "description": "Updates a Line Item for a Draft Order", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "unit_price": { + "description": "The potential custom price of the item.", + "type": "integer" + }, + "title": { + "description": "The potential custom title of the item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + }, + "metadata": { + "description": "The optional key-value map with additional details about the Line Item.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, + "/draft-orders/{id}/register-payment": { + "post": { + "summary": "Registers a payment for a Draft Order", + "operationId": "PostDraftOrdersDraftOrderRegisterPayment", + "description": "Registers a payment for a Draft Order.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The Draft Order id.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, + "/admin/draft-orders/{id}": { + "post": { + "operationId": "PostDraftOrdersDraftOrder", + "summary": "Update a Draft Order\"", + "description": "Updates a Draft Order.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "region_id": { + "type": "string", + "description": "The id of the Region to create the Draft Order in." + }, + "email": { + "type": "string", + "description": "An email to be used on the Draft Order." + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "shipping_address": { + "description": "The Address to be used for shipping.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "discounts": { + "description": "An array of Discount codes to add to the Draft Order.", + "type": "array", + "items": { + "properties": { + "code": { + "description": "The code that a Discount is identifed by.", + "type": "string" + } + } + } + }, + "no_notification_order": { + "description": "An optional flag passed to the resulting order to determine use of notifications.", + "type": "boolean" + }, + "customer_id": { + "description": "The id of the Customer to associate the Draft Order with.", + "type": "string" + } + } + } + } + } + }, + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, "/gift-cards": { "post": { "operationId": "PostGiftCards", @@ -1835,6 +1839,207 @@ } } }, + "/notes": { + "post": { + "operationId": "PostNotes", + "summary": "Creates a Note", + "description": "Creates a Note which can be associated with any resource as required.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "resource_id": { + "type": "string", + "description": "The id of the resource which the Note relates to." + }, + "resource_type": { + "type": "string", + "description": "The type of resource which the Note relates to." + }, + "value": { + "type": "string", + "description": "The content of the Note to create." + } + } + } + } + } + }, + "tags": [ + "Note" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "note": { + "$ref": "#/components/schemas/note" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetNotes", + "summary": "List Notes", + "description": "Retrieves a list of notes", + "tags": [ + "Note" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "notes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/note" + } + } + } + } + } + } + } + } + } + }, + "/notes/{id}": { + "delete": { + "operationId": "DeleteNotesNote", + "summary": "Deletes a Note", + "description": "Deletes a Note.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Note to delete.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Note" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Note." + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the Note was deleted." + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetNoteNote", + "summary": "Get Note", + "description": "Retrieves a single note using its id", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the note to retrieve.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Note" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "note": { + "$ref": "#/components/schemas/note" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostNotesNote", + "summary": "Updates a Note", + "description": "Updates a Note associated with some resource", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Note to update", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "value": { + "type": "string", + "description": "The updated description of the Note." + } + } + } + } + } + }, + "tags": [ + "Note" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "note": { + "$ref": "#/components/schemas/note" + } + } + } + } + } + } + } + } + }, "/notifications": { "get": { "operationId": "GetNotifications", @@ -1966,6 +2171,208 @@ } } }, + "/orders/{id}/claims/{claim_id}/cancel": { + "post": { + "operationId": "PostOrdersClaimCancel", + "summary": "Cancels a Claim", + "description": "Cancels a Claim", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "claim_id", + "required": true, + "description": "The id of the Claim.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Claim" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "order": { + "$ref": "#/components/schemas/claim_order" + } + } + } + } + } + } + } + } + }, + "/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel": { + "post": { + "operationId": "PostOrdersClaimFulfillmentsCancel", + "summary": "Cancels a fulfilmment related to a Claim", + "description": "Registers a Fulfillment as canceled.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Order which the Claim relates to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "claim_id", + "required": true, + "description": "The id of the Claim which the Fulfillment relates to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "fulfillment_id", + "required": true, + "description": "The id of the Fulfillment.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Fulfillment" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "fulfillment": { + "$ref": "#/components/schemas/fulfillment" + } + } + } + } + } + } + } + } + }, + "/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel": { + "post": { + "operationId": "PostOrdersSwapFulfillmentsCancel", + "summary": "Cancels a fulfilmment related to a Swap", + "description": "Registers a Fulfillment as canceled.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Order which the Swap relates to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "swap_id", + "required": true, + "description": "The id of the Swap which the Fulfillment relates to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "fulfillment_id", + "required": true, + "description": "The id of the Fulfillment.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Fulfillment" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "fulfillment": { + "$ref": "#/components/schemas/fulfillment" + } + } + } + } + } + } + } + } + }, + "/orders/{id}/fulfillments/{fulfillment_id}/cancel": { + "post": { + "operationId": "PostOrdersOrderFulfillmentsCancel", + "summary": "Cancels a fulfilmment", + "description": "Registers a Fulfillment as canceled.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Order which the Fulfillment relates to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "fulfillment_id", + "required": true, + "description": "The id of the Fulfillment", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Fulfillment" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "fulfillment": { + "$ref": "#/components/schemas/fulfillment" + } + } + } + } + } + } + } + } + }, "/orders/{id}/cancel": { "post": { "operationId": "PostOrdersOrderCancel", @@ -2003,6 +2410,52 @@ } } }, + "/orders/{id}/swaps/{swap_id}/cancel": { + "post": { + "operationId": "PostOrdersSwapCancel", + "summary": "Cancels a Swap", + "description": "Cancels a Swap", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "swap_id", + "required": true, + "description": "The id of the Swap.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Swap" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "order": { + "$ref": "#/components/schemas/swap" + } + } + } + } + } + } + } + } + }, "/orders/{id}/capture": { "post": { "operationId": "PostOrdersOrderCapture", @@ -2542,9 +2995,29 @@ } } }, + "custom_shipping_options": { + "description": "The custom shipping options to potentially create a Shipping Method from.", + "type": "array", + "items": { + "properties": { + "option_id": { + "description": "The id of the Shipping Option to override with a custom price.", + "type": "string" + }, + "price": { + "description": "The custom price of the Shipping Option.", + "type": "integer" + } + } + } + }, "no_notification": { "description": "If set to true no notification will be send related to this Swap.", "type": "boolean" + }, + "allow_backorder": { + "description": "If true, swaps can be completed with items out of stock", + "type": "boolean" } } } @@ -5181,6 +5654,51 @@ } } }, + "/return-reason/{id}": { + "delete": { + "operationId": "DeleteReturnReason", + "summary": "Delete a return reason", + "description": "Deletes a return reason.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the return reason", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Return Reason" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted return reason" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, "/return-reasons/{id}": { "get": { "operationId": "GetReturnReasonsReason", @@ -5279,102 +5797,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" - } - } - } - } - } - } - } - } - } - }, - "/returns/{id}receive": { - "post": { - "operationId": "PostReturnsReturnReceive", - "summary": "Receive a Return", - "description": "Registers a Return as received. Updates statuses on Orders and Swaps accordingly.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Return.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "items": { - "description": "The Line Items that have been received.", - "type": "array", - "items": { - "properties": { - "item_id": { - "description": "The id of the Line Item.", - "type": "string" - }, - "quantity": { - "description": "The quantity of the Line Item.", - "type": "integer" - } - } - } - }, - "refund": { - "description": "The amount to refund.", - "type": "integer" - } - } - } - } - } - }, - "tags": [ - "Return" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "return": { - "$ref": "#/components/schemas/return" - } - } - } - } - } - } - } - } - }, "/shipping-options": { "post": { "operationId": "PostShippingOptions", @@ -6110,6 +6532,139 @@ } } } + }, + "/returns/{id}/cancel": { + "post": { + "operationId": "PostReturnsReturnCancel", + "summary": "Cancel a Return", + "description": "Registers a Return as canceled.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Return.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Return" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "return": { + "$ref": "#/components/schemas/order" + } + } + } + } + } + } + } + } + }, + "/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" + } + } + } + } + } + } + } + } + } + }, + "/returns/{id}/receive": { + "post": { + "operationId": "PostReturnsReturnReceive", + "summary": "Receive a Return", + "description": "Registers a Return as received. Updates statuses on Orders and Swaps accordingly.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Return.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "items": { + "description": "The Line Items that have been received.", + "type": "array", + "items": { + "properties": { + "item_id": { + "description": "The id of the Line Item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + } + } + } + }, + "refund": { + "description": "The amount to refund.", + "type": "integer" + } + } + } + } + } + }, + "tags": [ + "Return" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "return": { + "$ref": "#/components/schemas/return" + } + } + } + } + } + } + } + } } }, "components": { @@ -6458,6 +7013,11 @@ "description": "The amount that will be refunded in conjunction with the claim", "type": "integer" }, + "canceled_at": { + "description": "The date with timezone at which the Swap was canceled.", + "type": "string", + "format": "date-time" + }, "created_at": { "type": "string", "format": "date-time" @@ -6567,6 +7127,56 @@ } } }, + "custom_shipping_option": { + "title": "Custom Shipping Option", + "description": "Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option", + "x-resourceId": "custom_shipping_option", + "properties": { + "id": { + "description": "The id of the Custom Shipping Option. This value will be prefixed with `cso_`.", + "type": "string" + }, + "price": { + "description": "The custom price set that will override the shipping option's original price", + "type": "integer" + }, + "shipping_option_id": { + "description": "The id of the Shipping Option that the custom shipping option overrides", + "anyOf": [ + { + "$ref": "#/components/schemas/shipping_option" + } + ] + }, + "cart_id": { + "description": "The id of the Cart that the custom shipping option is attached to", + "anyOf": [ + { + "$ref": "#/components/schemas/cart" + } + ] + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, "customer": { "title": "Customer", "description": "Represents a customer", @@ -7245,6 +7855,56 @@ } } }, + "note": { + "title": "Note", + "description": "Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these.", + "x-resourceId": "note", + "properties": { + "id": { + "description": "The id of the Note. This value will be prefixed by `note_`.", + "type": "string" + }, + "resource_type": { + "description": "The type of resource that the Note refers to.", + "type": "string" + }, + "resource_id": { + "description": "The id of the resource that the Note refers to.", + "type": "string" + }, + "value": { + "description": "The contents of the note.", + "type": "string" + }, + "author": { + "description": "The author of the note.", + "anyOf": [ + { + "$ref": "#/components/schemas/user" + } + ] + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, "notification_provider": { "title": "Notification Provider", "description": "Represents a notification provider plugin and holds its installation status.", @@ -8824,6 +9484,10 @@ "description": "The id of the Cart that the Customer will use to confirm the Swap.", "type": "string" }, + "allow_backorder": { + "description": "If true, swaps can be completed with items out of stock", + "type": "boolean" + }, "confirmed_at": { "description": "The date with timezone at which the Swap was confirmed by the Customer.", "type": "string", @@ -8839,6 +9503,11 @@ "type": "string", "format": "date-time" }, + "canceled_at": { + "description": "The date with timezone at which the Swap was canceled.", + "type": "string", + "format": "date-time" + }, "no_notification": { "description": "If set to true, no notification will be sent related to this swap", "type": "boolean" diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index f08a959765..7e0daf692e 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -36,7 +36,7 @@ tags: - name: Product Variant x-resourceId: product_variant servers: - - url: 'https://api.medusa-commerce.com/admin' + - url: "https://api.medusa-commerce.com/admin" paths: /auth: post: @@ -47,14 +47,14 @@ paths: tags: - Auth responses: - '200': + "200": description: OK content: application/json: schema: properties: user: - $ref: '#/components/schemas/user' + $ref: "#/components/schemas/user" requestBody: content: application/json: @@ -77,14 +77,14 @@ paths: tags: - Auth responses: - '200': + "200": description: OK content: application/json: schema: properties: user: - $ref: '#/components/schemas/user' + $ref: "#/components/schemas/user" /collections: post: operationId: PostCollections @@ -113,14 +113,14 @@ paths: tags: - Collection responses: - '200': + "200": description: OK content: application/json: schema: properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: "#/components/schemas/product_collection" get: operationId: GetCollections summary: List Product Collections @@ -128,15 +128,15 @@ paths: tags: - Collection responses: - '200': + "200": description: OK content: application/json: schema: properties: collection: - $ref: '#/components/schemas/product_collection' - '/collections/{id}': + $ref: "#/components/schemas/product_collection" + "/collections/{id}": delete: operationId: DeleteCollectionsCollection summary: Delete a Product Collection @@ -151,7 +151,7 @@ paths: tags: - Collection responses: - '200': + "200": description: OK content: application/json: @@ -179,14 +179,14 @@ paths: tags: - Collection responses: - '200': + "200": description: OK content: application/json: schema: properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: "#/components/schemas/product_collection" post: operationId: PostCollectionsCollection summary: Update a Product Collection @@ -219,14 +219,14 @@ paths: tags: - Collection responses: - '200': + "200": description: OK content: application/json: schema: properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: "#/components/schemas/product_collection" /customers: post: operationId: PostCustomers @@ -236,14 +236,14 @@ paths: tags: - Customer responses: - '200': + "200": description: OK content: application/json: schema: properties: customer: - $ref: '#/components/schemas/customer' + $ref: "#/components/schemas/customer" requestBody: content: application/json: @@ -273,15 +273,15 @@ paths: tags: - Customer responses: - '200': + "200": description: OK content: application/json: schema: properties: customer: - $ref: '#/components/schemas/customer' - '/customers/{id}': + $ref: "#/components/schemas/customer" + "/customers/{id}": get: operationId: GetCustomersCustomer summary: Retrieve a Customer @@ -296,14 +296,14 @@ paths: tags: - Customer responses: - '200': + "200": description: OK content: application/json: schema: properties: customer: - $ref: '#/components/schemas/customer' + $ref: "#/components/schemas/customer" post: operationId: PostCustomersCustomer summary: Update a Customer @@ -320,6 +320,11 @@ paths: application/json: schema: properties: + email: + type: string + description: >- + The Customer's email. Only providable if user not + registered. first_name: type: string description: The Customer's first name. @@ -332,15 +337,15 @@ paths: tags: - Customer responses: - '200': + "200": description: OK content: application/json: schema: properties: customer: - $ref: '#/components/schemas/customer' - '/discounts/{id}/regions/{region_id}': + $ref: "#/components/schemas/customer" + "/discounts/{id}/regions/{region_id}": post: operationId: PostDiscountsDiscountRegionsRegion summary: Adds Region availability @@ -361,14 +366,14 @@ paths: tags: - Discount responses: - '200': + "200": description: OK content: application/json: schema: properties: discount: - $ref: '#/components/schemas/discount' + $ref: "#/components/schemas/discount" delete: operationId: DeleteDiscountsDiscountRegionsRegion summary: Remove Region availability @@ -391,15 +396,15 @@ paths: tags: - Discount responses: - '200': + "200": description: OK content: application/json: schema: properties: discount: - $ref: '#/components/schemas/discount' - '/discounts/{id}/products/{product_id}': + $ref: "#/components/schemas/discount" + "/discounts/{id}/products/{product_id}": post: operationId: DeleteDiscountsDiscountProductsProduct summary: Remove Product availability @@ -422,14 +427,14 @@ paths: tags: - Discount responses: - '200': + "200": description: OK content: application/json: schema: properties: discount: - $ref: '#/components/schemas/discount' + $ref: "#/components/schemas/discount" /discounts: post: operationId: PostDiscounts @@ -455,7 +460,7 @@ paths: rule: description: The Discount Rule that defines how Discounts are calculated oneOf: - - $ref: '#/components/schemas/discount_rule' + - $ref: "#/components/schemas/discount_rule" is_disabled: type: boolean description: >- @@ -489,14 +494,14 @@ paths: tags: - Discount responses: - '200': + "200": description: OK content: application/json: schema: properties: discount: - $ref: '#/components/schemas/discount' + $ref: "#/components/schemas/discount" get: operationId: GetDiscounts summary: List Discounts @@ -504,15 +509,15 @@ paths: tags: - Discount responses: - '200': + "200": description: OK content: application/json: schema: properties: discount: - $ref: '#/components/schemas/discount' - '/discounts/{id}/dynamic-codes': + $ref: "#/components/schemas/discount" + "/discounts/{id}/dynamic-codes": post: operationId: PostDiscountsDiscountDynamicCodes summary: Create a dynamic Discount code @@ -529,14 +534,14 @@ paths: tags: - Discount responses: - '200': + "200": description: OK content: application/json: schema: properties: discount: - $ref: '#/components/schemas/discount' + $ref: "#/components/schemas/discount" requestBody: content: application/json: @@ -553,7 +558,7 @@ paths: description: >- An optional set of key-value paris to hold additional information. - '/discounts/{id}': + "/discounts/{id}": delete: operationId: DeleteDiscountsDiscount summary: Delete a Discount @@ -568,7 +573,7 @@ paths: tags: - Discount responses: - '200': + "200": description: OK content: application/json: @@ -596,14 +601,14 @@ paths: tags: - Discount responses: - '200': + "200": description: OK content: application/json: schema: properties: discount: - $ref: '#/components/schemas/discount' + $ref: "#/components/schemas/discount" post: operationId: PostDiscountsDiscount summary: Update a Discount @@ -635,7 +640,7 @@ paths: rule: description: The Discount Rule that defines how Discounts are calculated oneOf: - - $ref: '#/components/schemas/discount_rule' + - $ref: "#/components/schemas/discount_rule" is_disabled: type: boolean description: >- @@ -661,15 +666,15 @@ paths: tags: - Discount responses: - '200': + "200": description: OK content: application/json: schema: properties: discount: - $ref: '#/components/schemas/discount' - '/discounts/{id}/dynamic-codes/{code}': + $ref: "#/components/schemas/discount" + "/discounts/{id}/dynamic-codes/{code}": delete: operationId: DeleteDiscountsDiscountDynamicCodesCode summary: Delete a dynamic code @@ -690,15 +695,15 @@ paths: tags: - Discount responses: - '200': + "200": description: OK content: application/json: schema: properties: discount: - $ref: '#/components/schemas/discount' - '/discounts/code/{code}': + $ref: "#/components/schemas/discount" + "/discounts/code/{code}": get: operationId: GetDiscountsDiscountCode summary: Retrieve a Discount by code @@ -713,14 +718,14 @@ paths: tags: - Discount responses: - '200': + "200": description: OK content: application/json: schema: properties: discount: - $ref: '#/components/schemas/discount' + $ref: "#/components/schemas/discount" /draft-orders: post: operationId: PostDraftOrders @@ -740,11 +745,11 @@ paths: billing_address: description: The Address to be used for billing purposes. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" shipping_address: description: The Address to be used for shipping. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" items: description: The Line Items that have been received. type: array @@ -812,14 +817,14 @@ paths: tags: - Draft Order responses: - '200': + "200": description: OK content: application/json: schema: properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: "#/components/schemas/draft-order" get: operationId: GetDraftOrders summary: List Draft Orders @@ -827,15 +832,15 @@ paths: tags: - Draft Order responses: - '200': + "200": description: OK content: application/json: schema: properties: draft_order: - $ref: '#/components/schemas/draft-order' - '/draft-orders/{id}/line-items': + $ref: "#/components/schemas/draft-order" + "/draft-orders/{id}/line-items": post: operationId: PostDraftOrdersDraftOrderLineItems summary: Create a Line Item for Draft Order @@ -867,15 +872,15 @@ paths: tags: - Draft Order responses: - '200': + "200": description: OK content: application/json: schema: properties: draft_order: - $ref: '#/components/schemas/draft-order' - '/draft-orders/{id}': + $ref: "#/components/schemas/draft-order" + "/draft-orders/{id}": delete: operationId: DeleteDraftOrdersDraftOrder summary: Delete a Draft Order @@ -890,7 +895,7 @@ paths: tags: - Draft Order responses: - '200': + "200": description: OK content: application/json: @@ -918,15 +923,15 @@ paths: tags: - Draft Order responses: - '200': + "200": description: OK content: application/json: schema: properties: draft_order: - $ref: '#/components/schemas/draft-order' - '/draft-orders/{id}/line-items/{line_id}': + $ref: "#/components/schemas/draft-order" + "/draft-orders/{id}/line-items/{line_id}": delete: operationId: DeleteDraftOrdersDraftOrderLineItemsItem summary: Delete a Line Item @@ -947,14 +952,14 @@ paths: tags: - Draft Order responses: - '200': + "200": description: OK content: application/json: schema: properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: "#/components/schemas/draft-order" post: operationId: PostDraftOrdersDraftOrderLineItemsItem summary: Update a Line Item for a Draft Order @@ -981,15 +986,15 @@ paths: tags: - Draft Order responses: - '200': + "200": description: OK content: application/json: schema: properties: draft_order: - $ref: '#/components/schemas/draft-order' - '/draft-orders/{id}/register-payment': + $ref: "#/components/schemas/draft-order" + "/draft-orders/{id}/register-payment": post: summary: Registers a payment for a Draft Order operationId: PostDraftOrdersDraftOrderRegisterPayment @@ -1004,15 +1009,15 @@ paths: tags: - Draft Order responses: - '200': + "200": description: OK content: application/json: schema: properties: draft_order: - $ref: '#/components/schemas/draft-order' - '/admin/draft-orders/{id}': + $ref: "#/components/schemas/draft-order" + "/admin/draft-orders/{id}": post: operationId: PostDraftOrdersDraftOrder summary: Update a Draft Order" @@ -1038,11 +1043,11 @@ paths: billing_address: description: The Address to be used for billing purposes. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" shipping_address: description: The Address to be used for shipping. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" discounts: description: An array of Discount codes to add to the Draft Order. type: array @@ -1062,14 +1067,14 @@ paths: tags: - Draft Order responses: - '200': + "200": description: OK content: application/json: schema: properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: "#/components/schemas/draft-order" /gift-cards: post: operationId: PostGiftCards @@ -1111,14 +1116,14 @@ paths: tags: - Gift Card responses: - '200': + "200": description: OK content: application/json: schema: properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: "#/components/schemas/gift_card" get: operationId: GetGiftCards summary: List Gift Cards @@ -1126,7 +1131,7 @@ paths: tags: - Gift Card responses: - '200': + "200": description: OK content: application/json: @@ -1135,8 +1140,8 @@ paths: gift_cards: type: array items: - $ref: '#/components/schemas/gift_card' - '/gift-cards/{id}': + $ref: "#/components/schemas/gift_card" + "/gift-cards/{id}": delete: operationId: DeleteGiftCardsGiftCard summary: Delete a Gift Card @@ -1151,7 +1156,7 @@ paths: tags: - Gift Card responses: - '200': + "200": description: OK content: application/json: @@ -1179,14 +1184,14 @@ paths: tags: - Gift Card responses: - '200': + "200": description: OK content: application/json: schema: properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: "#/components/schemas/gift_card" post: operationId: PostGiftCardsGiftCard summary: Create a Gift Card @@ -1234,14 +1239,140 @@ paths: tags: - Gift Card responses: - '200': + "200": description: OK content: application/json: schema: properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: "#/components/schemas/gift_card" + /notes: + post: + operationId: PostNotes + summary: Creates a Note + description: Creates a Note which can be associated with any resource as required. + requestBody: + content: + application/json: + schema: + properties: + resource_id: + type: string + description: The id of the resource which the Note relates to. + resource_type: + type: string + description: The type of resource which the Note relates to. + value: + type: string + description: The content of the Note to create. + tags: + - Note + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + note: + $ref: "#/components/schemas/note" + get: + operationId: GetNotes + summary: List Notes + description: Retrieves a list of notes + tags: + - Note + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + notes: + type: array + items: + $ref: "#/components/schemas/note" + "/notes/{id}": + delete: + operationId: DeleteNotesNote + summary: Deletes a Note + description: Deletes a Note. + parameters: + - in: path + name: id + required: true + description: The id of the Note to delete. + schema: + type: string + tags: + - Note + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + id: + type: string + description: The id of the deleted Note. + deleted: + type: boolean + description: Whether or not the Note was deleted. + get: + operationId: GetNoteNote + summary: Get Note + description: Retrieves a single note using its id + parameters: + - in: path + name: id + required: true + description: The id of the note to retrieve. + schema: + type: string + tags: + - Note + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + note: + $ref: "#/components/schemas/note" + post: + operationId: PostNotesNote + summary: Updates a Note + description: Updates a Note associated with some resource + parameters: + - in: path + name: id + required: true + description: The id of the Note to update + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + value: + type: string + description: The updated description of the Note. + tags: + - Note + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + note: + $ref: "#/components/schemas/note" /notifications: get: operationId: GetNotifications @@ -1250,7 +1381,7 @@ paths: tags: - Notification responses: - '200': + "200": description: OK content: application/json: @@ -1259,8 +1390,8 @@ paths: notifications: type: array items: - $ref: '#/components/schemas/notification' - '/notifications/{id}/resend': + $ref: "#/components/schemas/notification" + "/notifications/{id}/resend": post: operationId: PostNotificationsNotificationResend summary: Resend Notification @@ -1277,15 +1408,15 @@ paths: tags: - Notification responses: - '200': + "200": description: OK content: application/json: schema: properties: notification: - $ref: '#/components/schemas/notification' - '/orders/{id}/shipping-methods': + $ref: "#/components/schemas/notification" + "/orders/{id}/shipping-methods": post: operationId: PostOrdersOrderShippingMethods summary: Add a Shipping Method @@ -1303,14 +1434,14 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' + $ref: "#/components/schemas/order" requestBody: content: application/json: @@ -1337,7 +1468,135 @@ paths: The data required for the Shipping Option to create a Shipping Method. This will depend on the Fulfillment Provider. - '/orders/{id}/cancel': + "/orders/{id}/claims/{claim_id}/cancel": + post: + operationId: PostOrdersClaimCancel + summary: Cancels a Claim + description: Cancels a Claim + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The id of the Claim. + schema: + type: string + tags: + - Claim + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + order: + $ref: "#/components/schemas/claim_order" + "/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel": + post: + operationId: PostOrdersClaimFulfillmentsCancel + summary: Cancels a fulfilmment related to a Claim + description: Registers a Fulfillment as canceled. + parameters: + - in: path + name: id + required: true + description: The id of the Order which the Claim relates to. + schema: + type: string + - in: path + name: claim_id + required: true + description: The id of the Claim which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The id of the Fulfillment. + schema: + type: string + tags: + - Fulfillment + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + fulfillment: + $ref: "#/components/schemas/fulfillment" + "/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel": + post: + operationId: PostOrdersSwapFulfillmentsCancel + summary: Cancels a fulfilmment related to a Swap + description: Registers a Fulfillment as canceled. + parameters: + - in: path + name: id + required: true + description: The id of the Order which the Swap relates to. + schema: + type: string + - in: path + name: swap_id + required: true + description: The id of the Swap which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The id of the Fulfillment. + schema: + type: string + tags: + - Fulfillment + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + fulfillment: + $ref: "#/components/schemas/fulfillment" + "/orders/{id}/fulfillments/{fulfillment_id}/cancel": + post: + operationId: PostOrdersOrderFulfillmentsCancel + summary: Cancels a fulfilmment + description: Registers a Fulfillment as canceled. + parameters: + - in: path + name: id + required: true + description: The id of the Order which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The id of the Fulfillment + schema: + type: string + tags: + - Fulfillment + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + fulfillment: + $ref: "#/components/schemas/fulfillment" + "/orders/{id}/cancel": post: operationId: PostOrdersOrderCancel summary: Cancel an Order @@ -1355,15 +1614,44 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}/capture': + $ref: "#/components/schemas/order" + "/orders/{id}/swaps/{swap_id}/cancel": + post: + operationId: PostOrdersSwapCancel + summary: Cancels a Swap + description: Cancels a Swap + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The id of the Swap. + schema: + type: string + tags: + - Swap + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + order: + $ref: "#/components/schemas/swap" + "/orders/{id}/capture": post: operationId: PostOrdersOrderCapture summary: Capture an Order @@ -1378,15 +1666,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}/claims/{claim_id}/shipments': + $ref: "#/components/schemas/order" + "/orders/{id}/claims/{claim_id}/shipments": post: operationId: PostOrdersOrderClaimsClaimShipments summary: Create Claim Shipment @@ -1420,15 +1708,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/order/{id}/claims': + $ref: "#/components/schemas/order" + "/order/{id}/claims": post: operationId: PostOrdersOrderClaims summary: Create a Claim @@ -1556,15 +1844,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}/fulfillments': + $ref: "#/components/schemas/order" + "/orders/{id}/fulfillments": post: operationId: PostOrdersOrderFulfillments summary: Create a Fulfillment @@ -1607,15 +1895,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}/shipment': + $ref: "#/components/schemas/order" + "/orders/{id}/shipment": post: operationId: PostOrdersOrderShipment summary: Create a Shipment @@ -1648,15 +1936,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}/swaps/{swap_id}/shipments': + $ref: "#/components/schemas/order" + "/orders/{id}/swaps/{swap_id}/shipments": post: operationId: PostOrdersOrderSwapsSwapShipments summary: Create Swap Shipment @@ -1695,15 +1983,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/order/{id}/swaps': + $ref: "#/components/schemas/order" + "/order/{id}/swaps": post: operationId: PostOrdersOrderSwaps summary: Create a Swap @@ -1756,23 +2044,41 @@ paths: quantity: description: The quantity of the Product Variant to ship. type: integer + custom_shipping_options: + description: >- + The custom shipping options to potentially create a Shipping + Method from. + type: array + items: + properties: + option_id: + description: >- + The id of the Shipping Option to override with a + custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer no_notification: description: >- If set to true no notification will be send related to this Swap. type: boolean + allow_backorder: + description: "If true, swaps can be completed with items out of stock" + type: boolean tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/order/{id}/metadata/{key}': + $ref: "#/components/schemas/order" + "/order/{id}/metadata/{key}": delete: operationId: DeleteOrdersOrderMetadataKey summary: Delete Metadata @@ -1793,15 +2099,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}/claims/{claim_id}/fulfillments': + $ref: "#/components/schemas/order" + "/orders/{id}/claims/{claim_id}/fulfillments": post: operationId: PostOrdersOrderClaimsClaimFulfillments summary: Create a Claim Fulfillment @@ -1837,15 +2143,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}/swaps/{swap_id}/fulfillments': + $ref: "#/components/schemas/order" + "/orders/{id}/swaps/{swap_id}/fulfillments": post: operationId: PostOrdersOrderSwapsSwapFulfillments summary: Create a Swap Fulfillment @@ -1881,15 +2187,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}': + $ref: "#/components/schemas/order" + "/orders/{id}": get: operationId: GetOrdersOrder summary: Retrieve an Order @@ -1904,14 +2210,14 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' + $ref: "#/components/schemas/order" /orders: get: operationId: GetOrders @@ -1920,7 +2226,7 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: @@ -1929,8 +2235,8 @@ paths: orders: type: array items: - $ref: '#/components/schemas/order' - '/orders/{id}/swaps/{swap_id}/process-payment': + $ref: "#/components/schemas/order" + "/orders/{id}/swaps/{swap_id}/process-payment": post: operationId: PostOrdersOrderSwapsSwapProcessPayment summary: Process a Swap difference @@ -1954,15 +2260,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}/swaps/{swap_id}/receive': + $ref: "#/components/schemas/order" + "/orders/{id}/swaps/{swap_id}/receive": post: operationId: PostOrdersOrderSwapsSwapReceive summary: Receive a Swap @@ -1999,15 +2305,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}/refunds': + $ref: "#/components/schemas/order" + "/orders/{id}/refunds": post: operationId: PostOrdersOrderRefunds summary: Create a Refund @@ -2044,15 +2350,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}/returns': + $ref: "#/components/schemas/order" + "/orders/{id}/returns": post: operationId: PostOrdersOrderReturns summary: Request a Return @@ -2118,15 +2424,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/order/{id}/claims/{claim_id}': + $ref: "#/components/schemas/order" + "/order/{id}/claims/{claim_id}": post: operationId: PostOrdersOrderClaimsClaim summary: Update a Claim @@ -2216,15 +2522,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/products/{id}/options': + $ref: "#/components/schemas/order" + "/products/{id}/options": post: operationId: PostProductsProductOptions summary: Add an Option @@ -2249,14 +2555,14 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: schema: properties: product: - $ref: '#/components/schemas/product' + $ref: "#/components/schemas/product" /products: post: operationId: PostProducts @@ -2317,7 +2623,7 @@ paths: description: The id of an existing Tag. type: string value: - description: 'The value of the Tag, these will be upserted.' + description: "The value of the Tag, these will be upserted." type: string options: description: >- @@ -2453,14 +2759,14 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: schema: properties: product: - $ref: '#/components/schemas/product' + $ref: "#/components/schemas/product" get: operationId: GetProducts summary: List Product @@ -2468,7 +2774,7 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: @@ -2486,8 +2792,8 @@ paths: products: type: array items: - $ref: '#/components/schemas/product' - '/products/{id}/variants': + $ref: "#/components/schemas/product" + "/products/{id}/variants": post: operationId: PostProductsProductVariants summary: Create a Product Variant @@ -2596,14 +2902,14 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: schema: properties: product: - $ref: '#/components/schemas/product' + $ref: "#/components/schemas/product" get: operationId: GetProductsProductVariants summary: List a Product's Product Variants @@ -2618,7 +2924,7 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: @@ -2627,8 +2933,8 @@ paths: variants: type: array items: - $ref: '#/components/schemas/product_variant' - '/products/{id}/options/{option_id}': + $ref: "#/components/schemas/product_variant" + "/products/{id}/options/{option_id}": delete: operationId: DeleteProductsProductOptionsOption summary: Delete a Product Option @@ -2653,7 +2959,7 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: @@ -2668,7 +2974,7 @@ paths: deleted: type: boolean product: - $ref: '#/components/schemas/product' + $ref: "#/components/schemas/product" post: operationId: PostProductsProductOptionsOption summary: Update a Product Option. @@ -2697,15 +3003,15 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: schema: properties: product: - $ref: '#/components/schemas/product' - '/products/{id}': + $ref: "#/components/schemas/product" + "/products/{id}": delete: operationId: DeleteProductsProduct summary: Delete a Product @@ -2720,7 +3026,7 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: @@ -2748,14 +3054,14 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: schema: properties: product: - $ref: '#/components/schemas/product' + $ref: "#/components/schemas/product" post: operationId: PostProductsProduct summary: Update a Product @@ -2822,7 +3128,7 @@ paths: description: The id of an existing Tag. type: string value: - description: 'The value of the Tag, these will be upserted.' + description: "The value of the Tag, these will be upserted." type: string options: description: >- @@ -2958,15 +3264,15 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: schema: properties: product: - $ref: '#/components/schemas/product' - '/products/{id}/variants/{variant_id}': + $ref: "#/components/schemas/product" + "/products/{id}/variants/{variant_id}": delete: operationId: DeleteProductsProductVariantsVariant summary: Delete a Product Variant @@ -2987,7 +3293,7 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: @@ -3113,14 +3419,14 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: schema: properties: product: - $ref: '#/components/schemas/product' + $ref: "#/components/schemas/product" /products/types: get: operationId: GetProductsTypes @@ -3129,7 +3435,7 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: @@ -3138,8 +3444,157 @@ paths: types: type: array items: - $ref: '#/components/schemas/product_type' - '/regions/{id}/countries': + $ref: "#/components/schemas/product_type" + /return-reasons: + post: + operationId: PostReturnReasons + summary: Create a Return Reason + description: Creates a Return Reason + requestBody: + content: + application/json: + schema: + properties: + label: + description: The label to display to the Customer. + type: string + value: + description: >- + The value that the Return Reason will be identified by. Must + be unique. + type: string + description: + description: An optional description to for the Reason. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + tags: + - Return Reason + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + return_reason: + $ref: "#/components/schemas/return_reason" + get: + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. + tags: + - Return Reason + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + return_reasons: + type: array + items: + $ref: "#/components/schemas/return_reason" + "/return-reason/{id}": + delete: + operationId: DeleteReturnReason + summary: Delete a return reason + description: Deletes a return reason. + parameters: + - in: path + name: id + required: true + description: The id of the return reason + schema: + type: string + tags: + - Return Reason + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + id: + type: string + description: The id of the deleted return reason + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + "/return-reasons/{id}": + get: + operationId: GetReturnReasonsReason + summary: Retrieve a Return Reason + description: Retrieves a Return Reason. + parameters: + - in: path + name: id + required: true + description: The id of the Return Reason. + schema: + type: string + tags: + - Return Reason + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + return_reason: + $ref: "#/components/schemas/return_reason" + post: + operationId: PostReturnReasonsReason + summary: Update a Return Reason + description: Updates a Return Reason + parameters: + - in: path + name: id + required: true + description: The id of the Return Reason. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + label: + description: The label to display to the Customer. + type: string + value: + description: >- + The value that the Return Reason will be identified by. Must + be unique. + type: string + description: + description: An optional description to for the Reason. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + tags: + - Return Reason + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + return_reason: + $ref: "#/components/schemas/return_reason" + "/regions/{id}/countries": post: operationId: PostRegionsRegionCountries summary: Add Country @@ -3162,15 +3617,15 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: schema: properties: region: - $ref: '#/components/schemas/region' - '/regions/{id}/fulfillment-providers': + $ref: "#/components/schemas/region" + "/regions/{id}/fulfillment-providers": post: operationId: PostRegionsRegionFulfillmentProviders summary: Add Fulfillment Provider @@ -3193,15 +3648,15 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: schema: properties: region: - $ref: '#/components/schemas/region' - '/regions/{id}/payment-providers': + $ref: "#/components/schemas/region" + "/regions/{id}/payment-providers": post: operationId: PostRegionsRegionPaymentProviders summary: Add Payment Provider @@ -3224,14 +3679,14 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: schema: properties: region: - $ref: '#/components/schemas/region' + $ref: "#/components/schemas/region" /regions: post: operationId: PostRegions @@ -3276,14 +3731,14 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: schema: properties: region: - $ref: '#/components/schemas/region' + $ref: "#/components/schemas/region" get: operationId: GetRegions summary: List Regions @@ -3291,7 +3746,7 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: @@ -3300,8 +3755,8 @@ paths: regions: type: array items: - $ref: '#/components/schemas/region' - '/regions/{id}/metadata/{key}': + $ref: "#/components/schemas/region" + "/regions/{id}/metadata/{key}": delete: operationId: DeleteRegionsRegionMetadataKey summary: Delete Metadata @@ -3322,15 +3777,15 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: schema: properties: region: - $ref: '#/components/schemas/region' - '/regions/{id}': + $ref: "#/components/schemas/region" + "/regions/{id}": delete: operationId: DeleteRegionsRegion summary: Delete a Region @@ -3345,7 +3800,7 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: @@ -3373,14 +3828,14 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: schema: properties: region: - $ref: '#/components/schemas/region' + $ref: "#/components/schemas/region" post: operationId: PostRegionsRegion summary: Update a Region @@ -3431,15 +3886,15 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: schema: properties: region: - $ref: '#/components/schemas/region' - '/regions/{id}/fulfillment-options': + $ref: "#/components/schemas/region" + "/regions/{id}/fulfillment-options": get: operationId: GetRegionsRegionFulfillmentOptions summary: List Fulfillment Options available in the Region @@ -3454,7 +3909,7 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: @@ -3464,7 +3919,7 @@ paths: type: array items: type: object - '/regions/{id}/countries/{country_code}': + "/regions/{id}/countries/{country_code}": delete: operationId: PostRegionsRegionCountriesCountry summary: Remove Country @@ -3485,15 +3940,15 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: schema: properties: region: - $ref: '#/components/schemas/region' - '/regions/{id}/fulfillment-providers/{provider_id}': + $ref: "#/components/schemas/region" + "/regions/{id}/fulfillment-providers/{provider_id}": delete: operationId: PostRegionsRegionFulfillmentProvidersProvider summary: Remove Fulfillment Provider @@ -3514,15 +3969,15 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: schema: properties: region: - $ref: '#/components/schemas/region' - '/regions/{id}/payment-providers/{provider_id}': + $ref: "#/components/schemas/region" + "/regions/{id}/payment-providers/{provider_id}": delete: operationId: PostRegionsRegionPaymentProvidersProvider summary: Remove Payment Provider @@ -3543,134 +3998,37 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: schema: properties: region: - $ref: '#/components/schemas/region' - /return-reasons: + $ref: "#/components/schemas/region" + "/returns/{id}/cancel": post: - operationId: PostReturnReasons - summary: Create a Return Reason - description: Creates a Return Reason - requestBody: - content: - application/json: - schema: - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - return_reason: - $ref: '#/components/schemas/return_reason' - get: - operationId: GetReturnReasons - summary: List Return Reasons - description: Retrieves a list of Return Reasons. - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - return_reasons: - type: array - items: - $ref: '#/components/schemas/return_reason' - '/return-reasons/{id}': - get: - operationId: GetReturnReasonsReason - summary: Retrieve a Return Reason - description: Retrieves a Return Reason. + operationId: PostReturnsReturnCancel + summary: Cancel a Return + description: Registers a Return as canceled. parameters: - in: path name: id required: true - description: The id of the Return Reason. + description: The id of the Return. schema: type: string tags: - - Return Reason + - Return responses: - '200': + "200": description: OK content: application/json: schema: properties: - return_reason: - $ref: '#/components/schemas/return_reason' - post: - operationId: PostReturnReasonsReason - summary: Update a Return Reason - description: Updates a Return Reason - parameters: - - in: path - name: id - required: true - description: The id of the Return Reason. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - return_reason: - $ref: '#/components/schemas/return_reason' + return: + $ref: "#/components/schemas/order" /returns: get: operationId: GetReturns @@ -3679,7 +4037,7 @@ paths: tags: - Return responses: - '200': + "200": description: OK content: application/json: @@ -3688,8 +4046,8 @@ paths: returns: type: array items: - $ref: '#/components/schemas/return' - '/returns/{id}receive': + $ref: "#/components/schemas/return" + "/returns/{id}/receive": post: operationId: PostReturnsReturnReceive summary: Receive a Return @@ -3725,14 +4083,14 @@ paths: tags: - Return responses: - '200': + "200": description: OK content: application/json: schema: properties: return: - $ref: '#/components/schemas/return' + $ref: "#/components/schemas/return" /shipping-options: post: operationId: PostShippingOptions @@ -3797,14 +4155,14 @@ paths: tags: - Shipping Option responses: - '200': + "200": description: OK content: application/json: schema: properties: shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: "#/components/schemas/shipping_option" get: operationId: GetShippingOptions summary: List Shipping Options @@ -3812,7 +4170,7 @@ paths: tags: - Shipping Option responses: - '200': + "200": description: OK content: application/json: @@ -3821,8 +4179,8 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' - '/shipping-options/{id}': + $ref: "#/components/schemas/shipping_option" + "/shipping-options/{id}": delete: operationId: DeleteShippingOptionsOption summary: Delete a Shipping Option @@ -3837,7 +4195,7 @@ paths: tags: - Shipping Option responses: - '200': + "200": description: OK content: application/json: @@ -3865,14 +4223,14 @@ paths: tags: - Shipping Option responses: - '200': + "200": description: OK content: application/json: schema: properties: shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: "#/components/schemas/shipping_option" post: operationId: PostShippingOptionsOption summary: Update Shipping Option @@ -3914,14 +4272,14 @@ paths: tags: - Shipping Option responses: - '200': + "200": description: OK content: application/json: schema: properties: shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: "#/components/schemas/shipping_option" /shipping-profiles: post: operationId: PostShippingProfiles @@ -3938,14 +4296,14 @@ paths: tags: - Shipping Profile responses: - '200': + "200": description: OK content: application/json: schema: properties: shipping_profile: - $ref: '#/components/schemas/shipping_profile' + $ref: "#/components/schemas/shipping_profile" get: operationId: GetShippingProfiles summary: List Shipping Profiles @@ -3953,7 +4311,7 @@ paths: tags: - Shipping Profile responses: - '200': + "200": description: OK content: application/json: @@ -3962,8 +4320,8 @@ paths: shipping_profiles: type: array items: - $ref: '#/components/schemas/shipping_profile' - '/shipping-profiles/{id}': + $ref: "#/components/schemas/shipping_profile" + "/shipping-profiles/{id}": delete: operationId: DeleteShippingProfilesProfile summary: Delete a Shipping Profile @@ -3978,7 +4336,7 @@ paths: tags: - Shipping Profile responses: - '200': + "200": description: OK content: application/json: @@ -4006,14 +4364,14 @@ paths: tags: - Shipping Profile responses: - '200': + "200": description: OK content: application/json: schema: properties: shipping_profile: - $ref: '#/components/schemas/shipping_profile' + $ref: "#/components/schemas/shipping_profile" post: operationId: PostShippingProfilesProfile summary: Update a Shipping Profiles @@ -4036,15 +4394,15 @@ paths: tags: - Shipping Profile responses: - '200': + "200": description: OK content: application/json: schema: properties: shipping_profiles: - $ref: '#/components/schemas/shipping_profile' - '/store/currencies/{code}': + $ref: "#/components/schemas/shipping_profile" + "/store/currencies/{code}": post: operationId: PostStoreCurrenciesCode summary: Add a Currency Code @@ -4059,14 +4417,14 @@ paths: tags: - Store responses: - '200': + "200": description: OK content: application/json: schema: properties: store: - $ref: '#/components/schemas/store' + $ref: "#/components/schemas/store" delete: operationId: DeleteStoreCurrenciesCode summary: Remvoe a Currency Code @@ -4081,14 +4439,14 @@ paths: tags: - Store responses: - '200': + "200": description: OK content: application/json: schema: properties: store: - $ref: '#/components/schemas/store' + $ref: "#/components/schemas/store" /store: get: operationId: GetStore @@ -4097,14 +4455,14 @@ paths: tags: - Store responses: - '200': + "200": description: OK content: application/json: schema: properties: store: - $ref: '#/components/schemas/store' + $ref: "#/components/schemas/store" post: operationId: PostStore summary: Update Store details. @@ -4128,14 +4486,14 @@ paths: tags: - Store responses: - '200': + "200": description: OK content: application/json: schema: properties: store: - $ref: '#/components/schemas/store' + $ref: "#/components/schemas/store" /store/payment-providers: get: operationId: GetStorePaymentProviders @@ -4144,7 +4502,7 @@ paths: tags: - Store responses: - '200': + "200": description: OK content: application/json: @@ -4153,8 +4511,8 @@ paths: payment_providers: type: array items: - $ref: '#/components/schemas/store' - '/swaps/{id}': + $ref: "#/components/schemas/store" + "/swaps/{id}": get: operationId: GetSwapsSwap summary: Retrieve a Swap @@ -4169,14 +4527,14 @@ paths: tags: - Swap responses: - '200': + "200": description: OK content: application/json: schema: properties: swap: - $ref: '#/components/schemas/swap' + $ref: "#/components/schemas/swap" /swaps: get: operationId: GetSwaps @@ -4185,7 +4543,7 @@ paths: tags: - Swap responses: - '200': + "200": description: OK content: application/json: @@ -4194,7 +4552,7 @@ paths: swaps: type: array items: - $ref: '#/components/schemas/swap' + $ref: "#/components/schemas/swap" /variants: get: operationId: GetVariants @@ -4203,7 +4561,7 @@ paths: tags: - Product Variant responses: - '200': + "200": description: OK content: application/json: @@ -4212,7 +4570,7 @@ paths: variants: type: array items: - $ref: '#/components/schemas/product_variant' + $ref: "#/components/schemas/product_variant" components: schemas: address: @@ -4239,7 +4597,7 @@ components: country_code: type: string country: - $ref: '#/components/schemas/country' + $ref: "#/components/schemas/country" cart: title: Cart description: Represents a user cart @@ -4252,43 +4610,43 @@ components: billing_address_id: type: string billing_address: - $ref: '#/components/schemas/address' + $ref: "#/components/schemas/address" shipping_address_id: type: string shipping_address: - $ref: '#/components/schemas/address' + $ref: "#/components/schemas/address" items: type: array items: - $ref: '#/components/schemas/line_item' + $ref: "#/components/schemas/line_item" region_id: type: string region: - $ref: '#/components/schemas/region' + $ref: "#/components/schemas/region" discounts: type: array items: - $ref: '#/components/schemas/region' + $ref: "#/components/schemas/region" gift_cards: type: array items: - $ref: '#/components/schemas/gift_card' + $ref: "#/components/schemas/gift_card" customer_id: type: string customer: - $ref: '#/components/schemas/customer' + $ref: "#/components/schemas/customer" payment_session: - $ref: '#/components/schemas/payment_session' + $ref: "#/components/schemas/payment_session" payment_sessions: type: array items: - $ref: '#/components/schemas/payment_session' + $ref: "#/components/schemas/payment_session" payment: - $ref: '#/components/schemas/payment' + $ref: "#/components/schemas/payment" shipping_methods: type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: "#/components/schemas/shipping_method" type: type: string enum: @@ -4355,19 +4713,19 @@ components: images: type: array items: - $ref: '#/components/schemas/claim_image' + $ref: "#/components/schemas/claim_image" claim_order_id: type: string item_id: type: string item: description: The Line Item that the claim refers to - $ref: '#/components/schemas/line_item' + $ref: "#/components/schemas/line_item" variant_id: type: string variant: description: The Product Variant that is claimed. - $ref: '#/components/schemas/product_variant' + $ref: "#/components/schemas/product_variant" reason: description: The reason for the claim type: string @@ -4377,7 +4735,7 @@ components: - production_failure - other note: - description: 'An optional note about the claim, for additional information' + description: "An optional note about the claim, for additional information" type: string quantity: description: >- @@ -4388,7 +4746,7 @@ components: description: User defined tags for easy filtering and grouping. type: array items: - $ref: '#/components/schemas/claim_tag' + $ref: "#/components/schemas/claim_tag" created_at: type: string format: date-time @@ -4437,39 +4795,43 @@ components: description: The items that have been claimed type: array items: - $ref: '#/components/schemas/claim_item' + $ref: "#/components/schemas/claim_item" additional_items: description: >- Refers to the new items to be shipped when the claim order has the type `replace` type: array items: - $ref: '#/components/schemas/line_item' + $ref: "#/components/schemas/line_item" order_id: description: The id of the order that the claim comes from. type: string return_order: description: Holds information about the return if the claim is to be returned - $ref: '#/components/schemas/return' + $ref: "#/components/schemas/return" shipping_address_id: description: The id of the address that the new items should be shipped to type: string shipping_address: description: The address that the new items should be shipped to - $ref: '#/components/schemas/address' + $ref: "#/components/schemas/address" shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: "#/components/schemas/shipping_method" fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: "#/components/schemas/fulfillment" refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer + canceled_at: + description: The date with timezone at which the Swap was canceled. + type: string + format: date-time created_at: type: string format: date-time @@ -4554,6 +4916,49 @@ components: name: description: The written name of the currency type: string + custom_shipping_option: + title: Custom Shipping Option + description: >- + Custom Shipping Options are 'overriden' Shipping Options. Store managers + can attach a Custom Shipping Option to a cart in order to set a custom + price for a particular Shipping Option + x-resourceId: custom_shipping_option + properties: + id: + description: >- + The id of the Custom Shipping Option. This value will be prefixed + with `cso_`. + type: string + price: + description: >- + The custom price set that will override the shipping option's + original price + type: integer + shipping_option_id: + description: >- + The id of the Shipping Option that the custom shipping option + overrides + anyOf: + - $ref: "#/components/schemas/shipping_option" + cart_id: + description: The id of the Cart that the custom shipping option is attached to + anyOf: + - $ref: "#/components/schemas/cart" + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object customer: title: Customer description: Represents a customer @@ -4568,11 +4973,11 @@ components: billing_address: description: The Customer's billing address. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" shipping_addresses: type: array items: - $ref: '#/components/schemas/address' + $ref: "#/components/schemas/address" first_name: type: string last_name: @@ -4630,7 +5035,7 @@ components: description: A set of Products that the discount can be used for. type: array items: - $ref: '#/components/schemas/product' + $ref: "#/components/schemas/product" created_at: description: The date with timezone at which the resource was created. type: string @@ -4669,7 +5074,7 @@ components: rule: description: The Discount Rule that governs the behaviour of the Discount anyOf: - - $ref: '#/components/schemas/discount_rule' + - $ref: "#/components/schemas/discount_rule" is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -4692,7 +5097,7 @@ components: description: The Regions in which the Discount can be used type: array items: - $ref: '#/components/schemas/region' + $ref: "#/components/schemas/region" usage_limit: description: The maximum number of times that a discount can be used. type: integer @@ -4732,12 +5137,12 @@ components: type: string cart: anyOf: - - $ref: '#/components/schemas/cart' + - $ref: "#/components/schemas/cart" order_id: type: string order: anyOf: - - $ref: '#/components/schemas/order' + - $ref: "#/components/schemas/order" canceled_at: type: string format: date-time @@ -4775,7 +5180,7 @@ components: item: description: The Line Item that the Fulfillment Item references. anyOf: - - $ref: '#/components/schemas/line_item' + - $ref: "#/components/schemas/line_item" quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer @@ -4830,7 +5235,7 @@ components: about how many of each Line Item has been fulfilled. type: array items: - $ref: '#/components/schemas/fulfillment_item' + $ref: "#/components/schemas/fulfillment_item" tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -4838,7 +5243,7 @@ components: Provider. type: array items: - $ref: '#/components/schemas/tracking_link' + $ref: "#/components/schemas/tracking_link" tracking_numbers: deprecated: true description: >- @@ -4889,7 +5294,7 @@ components: gift_card: description: The Gift Card that was used in the transaction. anyOf: - - $ref: '#/components/schemas/gift_card' + - $ref: "#/components/schemas/gift_card" order_id: description: The id of the Order that the Gift Card was used to pay for. type: string @@ -4927,7 +5332,7 @@ components: region: description: The Region in which the Gift Card is available. anyOf: - - $ref: '#/components/schemas/region' + - $ref: "#/components/schemas/region" order_id: description: The id of the Order that the Gift Card was purchased in. type: string @@ -5042,7 +5447,7 @@ components: variant: description: The Product Variant contained in the Line Item. anyOf: - - $ref: '#/components/schemas/product_variant' + - $ref: "#/components/schemas/product_variant" quantity: description: The quantity of the content in the Line Item. type: integer @@ -5107,7 +5512,7 @@ components: region: description: The Region that the Money Amount is defined for. anyOf: - - $ref: '#/components/schemas/region' + - $ref: "#/components/schemas/region" created_at: description: The date with timezone at which the resource was created. type: string @@ -5120,6 +5525,45 @@ components: description: The date with timezone at which the resource was deleted. type: string format: date-time + note: + title: Note + description: >- + Notes are elements which we can use in association with different + resources to allow users to describe additional information in relation + to these. + x-resourceId: note + properties: + id: + description: The id of the Note. This value will be prefixed by `note_`. + type: string + resource_type: + description: The type of resource that the Note refers to. + type: string + resource_id: + description: The id of the resource that the Note refers to. + type: string + value: + description: The contents of the note. + type: string + author: + description: The author of the note. + anyOf: + - $ref: "#/components/schemas/user" + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object notification_provider: title: Notification Provider description: >- @@ -5163,7 +5607,7 @@ components: customer: description: The Customer that the Notification was sent to. anyOf: - - $ref: '#/components/schemas/customer' + - $ref: "#/components/schemas/customer" to: description: >- The address that the Notification was sent to. This will usually be @@ -5184,7 +5628,7 @@ components: Notification. type: array items: - $ref: '#/components/schemas/notification_resend' + $ref: "#/components/schemas/notification_resend" provider_id: description: The id of the Notification Provider that handles the Notification. type: string @@ -5286,76 +5730,76 @@ components: discounts: type: array items: - $ref: '#/components/schemas/discount' + $ref: "#/components/schemas/discount" email: type: string billing_address_id: type: string billing_address: anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" shipping_address_id: type: string shipping_address: anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" items: type: array items: - $ref: '#/components/schemas/line_item' + $ref: "#/components/schemas/line_item" region_id: type: string region: anyOf: - - $ref: '#/components/schemas/region' + - $ref: "#/components/schemas/region" gift_cards: type: array items: - $ref: '#/components/schemas/gift_card' + $ref: "#/components/schemas/gift_card" customer_id: type: string customer: anyOf: - - $ref: '#/components/schemas/customer' + - $ref: "#/components/schemas/customer" payment_session: anyOf: - - $ref: '#/components/schemas/payment_session' + - $ref: "#/components/schemas/payment_session" payment_sessions: type: array items: - $ref: '#/components/schemas/payment_session' + $ref: "#/components/schemas/payment_session" payments: type: array items: - $ref: '#/components/schemas/payment' + $ref: "#/components/schemas/payment" shipping_methods: type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: "#/components/schemas/shipping_method" fulfillments: type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: "#/components/schemas/fulfillment" returns: type: array items: - $ref: '#/components/schemas/return' + $ref: "#/components/schemas/return" claims: type: array items: - $ref: '#/components/schemas/claim_order' + $ref: "#/components/schemas/claim_order" refunds: type: array items: - $ref: '#/components/schemas/refund' + $ref: "#/components/schemas/refund" swaps: type: array items: - $ref: '#/components/schemas/refund' + $ref: "#/components/schemas/refund" gift_card_transactions: type: array items: - $ref: '#/components/schemas/gift_card_transaction' + $ref: "#/components/schemas/gift_card_transaction" canceled_at: type: string format: date-time @@ -5621,7 +6065,7 @@ components: description: The Product Option Values that are defined for the Product Option. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: "#/components/schemas/product_option_value" product_id: description: The id of the Product that the Product Option is defined for. type: string @@ -5725,7 +6169,7 @@ components: Region. type: array items: - $ref: '#/components/schemas/money_amount' + $ref: "#/components/schemas/money_amount" sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -5806,7 +6250,7 @@ components: description: The Product Option Values specified for the Product Variant. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: "#/components/schemas/product_option_value" created_at: description: The date with timezone at which the resource was created. type: string @@ -5864,7 +6308,7 @@ components: description: Images of the Product type: array items: - $ref: '#/components/schemas/image' + $ref: "#/components/schemas/image" thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -5875,14 +6319,14 @@ components: Option Values. type: array items: - $ref: '#/components/schemas/product_option' + $ref: "#/components/schemas/product_option" variants: description: >- The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. type: array items: - $ref: '#/components/schemas/product_variant' + $ref: "#/components/schemas/product_variant" profile_id: description: >- The id of the Shipping Profile that the Product belongs to. Shipping @@ -5936,16 +6380,16 @@ components: type: description: The Product Type of the Product (e.g. "Clothing") anyOf: - - $ref: '#/components/schemas/product_type' + - $ref: "#/components/schemas/product_type" collection: description: The Product Collection that the Product belongs to (e.g. "SS20") anyOf: - - $ref: '#/components/schemas/product_collection' + - $ref: "#/components/schemas/product_collection" tags: description: The Product Tags assigned to the Product. type: array items: - $ref: '#/components/schemas/product_tag' + $ref: "#/components/schemas/product_tag" created_at: description: The date with timezone at which the resource was created. type: string @@ -6037,21 +6481,21 @@ components: description: The countries that are included in the Region. type: array items: - $ref: '#/components/schemas/country' + $ref: "#/components/schemas/country" payment_providers: description: >- The Payment Providers that can be used to process Payments in the Region. type: array items: - $ref: '#/components/schemas/payment_provider' + $ref: "#/components/schemas/payment_provider" fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. type: array items: - $ref: '#/components/schemas/fulfillment_provider' + $ref: "#/components/schemas/fulfillment_provider" created_at: description: The date with timezone at which the resource was created. type: string @@ -6083,7 +6527,7 @@ components: item: description: The Line Item that the Return Item references. anyOf: - - $ref: '#/components/schemas/line_item' + - $ref: "#/components/schemas/line_item" quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -6101,7 +6545,7 @@ components: reason: description: The reason for returning the item. anyOf: - - $ref: '#/components/schemas/return_reason' + - $ref: "#/components/schemas/return_reason" note: description: An optional note with additional details about the Return. type: string @@ -6163,7 +6607,7 @@ components: items: description: >- The Return Items that will be shipped back to the warehouse. type: - array items: $ref: + array items: $ref: swap_id: description: The id of the Swap that the Return is a part of. type: string @@ -6178,7 +6622,7 @@ components: The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. anyOf: - - $ref: '#/components/schemas/shipping_method' + - $ref: "#/components/schemas/shipping_method" shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -6229,7 +6673,7 @@ components: shipping_option: description: The Shipping Option that the Shipping Method is built from. anyOf: - - $ref: '#/components/schemas/shipping_option' + - $ref: "#/components/schemas/shipping_option" order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -6315,7 +6759,7 @@ components: region: description: The id of the Region that the Shipping Option belongs to. anyOf: - - $ref: '#/components/schemas/region' + - $ref: "#/components/schemas/region" profile_id: description: >- The id of the Shipping Profile that the Shipping Option belongs to. @@ -6353,7 +6797,7 @@ components: be available for a Cart. type: array items: - $ref: '#/components/schemas/shipping_option_requirement' + $ref: "#/components/schemas/shipping_option_requirement" data: description: >- The data needed for the Fulfillment Provider to identify the @@ -6404,7 +6848,7 @@ components: description: The Products that the Shipping Profile defines Shipping Options for. type: array items: - $ref: '#/components/schemas/product' + $ref: "#/components/schemas/product" shipping_options: description: >- The Shipping Options that can be used to fulfill the Products in the @@ -6412,7 +6856,7 @@ components: type: array items: anyOf: - - $ref: '#/components/schemas/shipping_option' + - $ref: "#/components/schemas/shipping_option" created_at: description: The date with timezone at which the resource was created. type: string @@ -6430,7 +6874,7 @@ components: type: object store: title: Store - description: 'Holds settings for the Store, such as name, currencies, etc.' + description: "Holds settings for the Store, such as name, currencies, etc." x-resourceId: store properties: id: @@ -6448,7 +6892,7 @@ components: description: The currencies that are enabled for the Store. type: array items: - $ref: '#/components/schemas/currency' + $ref: "#/components/schemas/currency" swap_link_template: description: >- A template to generate Swap links from use {{cart_id}} to include @@ -6514,22 +6958,22 @@ components: description: The new Line Items to ship to the Customer. type: array items: - $ref: '#/components/schemas/line_item' + $ref: "#/components/schemas/line_item" return_order: description: The Return that is issued for the return part of the Swap. anyOf: - - $ref: '#/components/schemas/return' + - $ref: "#/components/schemas/return" fulfillments: description: The Fulfillments used to send the new Line Items. type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: "#/components/schemas/fulfillment" payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. anyOf: - - $ref: '#/components/schemas/payment' + - $ref: "#/components/schemas/payment" difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May @@ -6541,15 +6985,18 @@ components: The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" shipping_methods: description: The Shipping Methods used to fulfill the addtional items purchased. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: "#/components/schemas/shipping_method" cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string + allow_backorder: + description: "If true, swaps can be completed with items out of stock" + type: boolean confirmed_at: description: >- The date with timezone at which the Swap was confirmed by the @@ -6564,8 +7011,12 @@ components: description: The date with timezone at which the resource was last updated. type: string format: date-time + canceled_at: + description: The date with timezone at which the Swap was canceled. + type: string + format: date-time no_notification: - description: 'If set to true, no notification will be sent related to this swap' + description: "If set to true, no notification will be sent related to this swap" type: boolean metadata: description: An optional key-value map with additional information. @@ -6623,7 +7074,7 @@ components: last_name: description: The Customer's billing address. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" created_at: type: string format: date-time diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 0cac3289cd..ea00c44b90 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -199,523 +199,6 @@ } } }, - "/customers/{id}/addresses": { - "post": { - "operationId": "PostCustomersCustomerAddresses", - "summary": "Add a Shipping Address", - "description": "Adds a Shipping Address to a Customer's saved addresses.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The Customer id.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "address": { - "description": "The Address to add to the Customer.", - "anyOf": [ - { - "$ref": "#/components/schemas/address" - } - ] - } - } - } - } - } - }, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "A successful response", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, - "/customers": { - "post": { - "operationId": "PostCustomers", - "summary": "Create a Customer", - "description": "Creates a Customer account.", - "parameters": [], - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "email", - "first_name", - "last_name", - "password" - ], - "properties": { - "email": { - "type": "string", - "description": "The Customer's email address." - }, - "first_name": { - "type": "string", - "description": "The Customer's first name." - }, - "last_name": { - "type": "string", - "description": "The Customer's last name." - }, - "password": { - "type": "string", - "description": "The Customer's password for login." - }, - "phone": { - "type": "string", - "description": "The Customer's phone number." - } - } - } - } - } - } - } - }, - "/customers/{id}/addresses/{address_id}": { - "delete": { - "operationId": "DeleteCustomersCustomerAddressesAddress", - "summary": "Delete an Address", - "description": "Removes an Address from the Customer's saved addresse.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Customer.", - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "address_id", - "required": true, - "description": "The id of the Address to remove.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "PostCustomersCustomerAddressesAddress", - "summary": "Update a Shipping Address", - "description": "Updates a Customer's saved Shipping Address.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The Customer id.", - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "address_id", - "required": true, - "description": "The id of the Address to update.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "address": { - "description": "The updated Address.", - "anyOf": [ - { - "$ref": "#/components/schemas/address" - } - ] - } - } - } - } - } - }, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, - "/customers/{id}": { - "get": { - "operationId": "GetCustomersCustomer", - "summary": "Retrieves a Customer", - "description": "Retrieves a Customer - the Customer must be logged in to retrieve their details.", - "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 Customer details", - "description": "Updates a Customer's saved details.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Customer.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "first_name": { - "description": "The Customer's first name.", - "type": "string" - }, - "last_name": { - "description": "The Customer's last name.", - "type": "string" - }, - "billing_address": { - "description": "The Address to be used for billing purposes.", - "anyOf": [ - { - "$ref": "#/components/schemas/address" - } - ] - }, - "password": { - "description": "The Customer's password.", - "type": "string" - }, - "phone": { - "description": "The Customer's phone number.", - "type": "string" - }, - "metadata": { - "description": "Metadata about the customer.", - "type": "object" - } - } - } - } - } - }, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, - "/customers/{id}/payment-methods": { - "get": { - "operationId": "GetCustomersCustomerPaymentMethods", - "summary": "Retrieve saved payment methods", - "description": "Retrieves a list of a Customer's saved payment methods. Payment methods are saved with Payment Providers and it is their responsibility to fetch saved methods.", - "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": { - "payment_methods": { - "type": "array", - "items": { - "properties": { - "provider_id": { - "type": "string", - "description": "The id of the Payment Provider where the payment method is saved." - }, - "data": { - "type": "object", - "description": "The data needed for the Payment Provider to use the saved payment method." - } - } - } - } - } - } - } - } - } - } - } - }, - "/customers/{id}/orders": { - "get": { - "operationId": "GetCustomersCustomerOrders", - "summary": "Retrieve Customer Orders", - "description": "Retrieves a list of a Customer's Orders.", - "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": { - "payment_methods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/order" - } - } - } - } - } - } - } - } - } - }, - "/customers/{id}/password-token": { - "post": { - "operationId": "PostCustomersCustomerPasswordToken", - "summary": "Creates a reset password token", - "description": "Creates a reset password token to be used in a subsequent /reset-password request. The password token should be sent out of band e.g. via email and will not be returned.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Customer.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Customer" - ], - "responses": { - "204": { - "description": "OK" - } - } - } - }, - "/customers/{id}/reset-password": { - "post": { - "operationId": "PostCustomersCustomerResetPassword", - "summary": "Resets Customer password", - "description": "Resets a Customer's password using a password token created by a previous /password-token request.", - "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" - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "email", - "token", - "password" - ], - "properties": { - "email": { - "type": "string", - "description": "The Customer's email." - }, - "token": { - "type": "string", - "description": "The password token created by a /password-token request." - }, - "password": { - "type": "string", - "description": "The new password to set for the Customer." - } - } - } - } - } - } - } - }, "/carts/{id}/shipping-methods": { "post": { "operationId": "PostCartsCartShippingMethod", @@ -1456,6 +939,518 @@ } } }, + "/collections/{id}": { + "get": { + "operationId": "GetCollectionsCollection", + "summary": "Retrieve a Product Collection", + "description": "Retrieves a Product Collection.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Product Collection", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Collection" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "collection": { + "$ref": "#/components/schemas/product_collection" + } + } + } + } + } + } + } + } + }, + "/collections": { + "get": { + "operationId": "GetCollections", + "summary": "List Product Collections", + "description": "Retrieve a list of Product Collection.", + "tags": [ + "Collection" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "collection": { + "$ref": "#/components/schemas/product_collection" + } + } + } + } + } + } + } + } + }, + "/customers/{id}/addresses": { + "post": { + "operationId": "PostCustomersCustomerAddresses", + "summary": "Add a Shipping Address", + "description": "Adds a Shipping Address to a Customer's saved addresses.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The Customer id.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "address": { + "description": "The Address to add to the Customer.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + } + } + } + } + } + }, + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "A successful response", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + } + }, + "/customers": { + "post": { + "operationId": "PostCustomers", + "summary": "Create a Customer", + "description": "Creates a Customer account.", + "parameters": [], + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "email", + "first_name", + "last_name", + "password" + ], + "properties": { + "email": { + "type": "string", + "description": "The Customer's email address." + }, + "first_name": { + "type": "string", + "description": "The Customer's first name." + }, + "last_name": { + "type": "string", + "description": "The Customer's last name." + }, + "password": { + "type": "string", + "description": "The Customer's password for login." + }, + "phone": { + "type": "string", + "description": "The Customer's phone number." + } + } + } + } + } + } + } + }, + "/customers/{id}/addresses/{address_id}": { + "delete": { + "operationId": "DeleteCustomersCustomerAddressesAddress", + "summary": "Delete an Address", + "description": "Removes an Address from the Customer's saved addresse.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Customer.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "address_id", + "required": true, + "description": "The id of the Address to remove.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + } + }, + "/customers/me": { + "get": { + "operationId": "GetCustomersCustomer", + "summary": "Retrieves a Customer", + "description": "Retrieves a Customer - the Customer must be logged in to retrieve their details.", + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostCustomersCustomer", + "summary": "Update Customer details", + "description": "Updates a Customer's saved details.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "first_name": { + "description": "The Customer's first name.", + "type": "string" + }, + "last_name": { + "description": "The Customer's last name.", + "type": "string" + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "password": { + "description": "The Customer's password.", + "type": "string" + }, + "phone": { + "description": "The Customer's phone number.", + "type": "string" + }, + "email": { + "description": "The email of the customer.", + "type": "string" + }, + "metadata": { + "description": "Metadata about the customer.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + } + }, + "/customers/me/payment-methods": { + "get": { + "operationId": "GetCustomersCustomerPaymentMethods", + "summary": "Retrieve saved payment methods", + "description": "Retrieves a list of a Customer's saved payment methods. Payment methods are saved with Payment Providers and it is their responsibility to fetch saved methods.", + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "payment_methods": { + "type": "array", + "items": { + "properties": { + "provider_id": { + "type": "string", + "description": "The id of the Payment Provider where the payment method is saved." + }, + "data": { + "type": "object", + "description": "The data needed for the Payment Provider to use the saved payment method." + } + } + } + } + } + } + } + } + } + } + } + }, + "/customers/me/orders": { + "get": { + "operationId": "GetCustomersCustomerOrders", + "summary": "Retrieve Customer Orders", + "description": "Retrieves a list of a Customer's Orders.", + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "payment_methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/order" + } + } + } + } + } + } + } + } + } + }, + "/customers/password-token": { + "post": { + "operationId": "PostCustomersCustomerPasswordToken", + "summary": "Creates a reset password token", + "description": "Creates a reset password token to be used in a subsequent /reset-password request. The password token should be sent out of band e.g. via email and will not be returned.", + "tags": [ + "Customer" + ], + "responses": { + "204": { + "description": "OK" + } + } + } + }, + "/customers/reset-password": { + "post": { + "operationId": "PostCustomersResetPassword", + "summary": "Resets Customer password", + "description": "Resets a Customer's password using a password token created by a previous /password-token request.", + "parameters": [], + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "email", + "token", + "password" + ], + "properties": { + "email": { + "type": "string", + "description": "The Customer's email." + }, + "token": { + "type": "string", + "description": "The password token created by a /password-token request." + }, + "password": { + "type": "string", + "description": "The new password to set for the Customer." + } + } + } + } + } + } + } + }, + "/customers/me/addresses/{address_id}": { + "post": { + "operationId": "PostCustomersCustomerAddressesAddress", + "summary": "Update a Shipping Address", + "description": "Updates a Customer's saved Shipping Address.", + "parameters": [ + { + "in": "path", + "name": "address_id", + "required": true, + "description": "The id of the Address to update.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "address": { + "description": "The updated Address.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + } + } + } + } + } + }, + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + } + }, "/gift-cards/{code}": { "get": { "operationId": "GetGiftCardsCode", @@ -2038,15 +2033,9 @@ } } }, - "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." - } - } + "return_shipping_option": { + "type": "string", + "description": "The id of the Shipping Option to create the Shipping Method from." }, "additional_items": { "description": "The items to exchange the returned items to.", @@ -2550,6 +2539,11 @@ "description": "The amount that will be refunded in conjunction with the claim", "type": "integer" }, + "canceled_at": { + "description": "The date with timezone at which the Swap was canceled.", + "type": "string", + "format": "date-time" + }, "created_at": { "type": "string", "format": "date-time" @@ -2659,6 +2653,56 @@ } } }, + "custom_shipping_option": { + "title": "Custom Shipping Option", + "description": "Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option", + "x-resourceId": "custom_shipping_option", + "properties": { + "id": { + "description": "The id of the Custom Shipping Option. This value will be prefixed with `cso_`.", + "type": "string" + }, + "price": { + "description": "The custom price set that will override the shipping option's original price", + "type": "integer" + }, + "shipping_option_id": { + "description": "The id of the Shipping Option that the custom shipping option overrides", + "anyOf": [ + { + "$ref": "#/components/schemas/shipping_option" + } + ] + }, + "cart_id": { + "description": "The id of the Cart that the custom shipping option is attached to", + "anyOf": [ + { + "$ref": "#/components/schemas/cart" + } + ] + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, "customer": { "title": "Customer", "description": "Represents a customer", @@ -3337,6 +3381,56 @@ } } }, + "note": { + "title": "Note", + "description": "Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these.", + "x-resourceId": "note", + "properties": { + "id": { + "description": "The id of the Note. This value will be prefixed by `note_`.", + "type": "string" + }, + "resource_type": { + "description": "The type of resource that the Note refers to.", + "type": "string" + }, + "resource_id": { + "description": "The id of the resource that the Note refers to.", + "type": "string" + }, + "value": { + "description": "The contents of the note.", + "type": "string" + }, + "author": { + "description": "The author of the note.", + "anyOf": [ + { + "$ref": "#/components/schemas/user" + } + ] + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, "notification_provider": { "title": "Notification Provider", "description": "Represents a notification provider plugin and holds its installation status.", @@ -4916,6 +5010,10 @@ "description": "The id of the Cart that the Customer will use to confirm the Swap.", "type": "string" }, + "allow_backorder": { + "description": "If true, swaps can be completed with items out of stock", + "type": "boolean" + }, "confirmed_at": { "description": "The date with timezone at which the Swap was confirmed by the Customer.", "type": "string", @@ -4931,6 +5029,11 @@ "type": "string", "format": "date-time" }, + "canceled_at": { + "description": "The date with timezone at which the Swap was canceled.", + "type": "string", + "format": "date-time" + }, "no_notification": { "description": "If set to true, no notification will be sent related to this swap", "type": "boolean" diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index bc112e95c4..a8b7148278 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -38,57 +38,27 @@ tags: - name: Product Variant x-resourceId: product_variant servers: - - url: 'https://api.medusa-commerce.com/store' + - url: "https://api.medusa-commerce.com/store" paths: - '/customers/{id}/addresses': + /auth: post: - operationId: PostCustomersCustomerAddresses - summary: Add a Shipping Address - description: Adds a Shipping Address to a Customer's saved addresses. - parameters: - - in: path - name: id - required: true - description: The Customer id. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - address: - description: The Address to add to the Customer. - anyOf: - - $ref: '#/components/schemas/address' - tags: - - Customer - responses: - '200': - description: A successful response - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - /customers: - post: - operationId: PostCustomers - summary: Create a Customer - description: Creates a Customer account. + operationId: PostAuth + summary: Authenticate Customer + description: >- + Logs a Customer in and authorizes them to view their details. Successful + authentication will set a session cookie in the Customer's browser. parameters: [] tags: - - Customer + - Auth responses: - '200': + "200": description: OK content: application/json: schema: properties: customer: - $ref: '#/components/schemas/customer' + $ref: "#/components/schemas/customer" requestBody: content: application/json: @@ -96,290 +66,62 @@ paths: type: object required: - email - - first_name - - last_name - - password - properties: - email: - type: string - description: The Customer's email address. - first_name: - type: string - description: The Customer's first name. - last_name: - type: string - description: The Customer's last name. - password: - type: string - description: The Customer's password for login. - phone: - type: string - description: The Customer's phone number. - '/customers/{id}/addresses/{address_id}': - delete: - operationId: DeleteCustomersCustomerAddressesAddress - summary: Delete an Address - description: Removes an Address from the Customer's saved addresse. - parameters: - - in: path - name: id - required: true - description: The id of the Customer. - schema: - type: string - - in: path - name: address_id - required: true - description: The id of the Address to remove. - schema: - type: string - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - post: - operationId: PostCustomersCustomerAddressesAddress - summary: Update a Shipping Address - description: Updates a Customer's saved Shipping Address. - parameters: - - in: path - name: id - required: true - description: The Customer id. - schema: - type: string - - in: path - name: address_id - required: true - description: The id of the Address to update. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - address: - description: The updated Address. - anyOf: - - $ref: '#/components/schemas/address' - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - '/customers/{id}': - get: - operationId: GetCustomersCustomer - summary: Retrieves a Customer - description: >- - Retrieves a Customer - the Customer must be logged in to retrieve their - details. - 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 Customer details - description: Updates a Customer's saved details. - parameters: - - in: path - name: id - required: true - description: The id of the Customer. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address' - password: - description: The Customer's password. - type: string - phone: - description: The Customer's phone number. - type: string - metadata: - description: Metadata about the customer. - type: object - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - '/customers/{id}/payment-methods': - get: - operationId: GetCustomersCustomerPaymentMethods - summary: Retrieve saved payment methods - description: >- - Retrieves a list of a Customer's saved payment methods. Payment methods - are saved with Payment Providers and it is their responsibility to fetch - saved methods. - 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: - payment_methods: - type: array - items: - properties: - provider_id: - type: string - description: >- - The id of the Payment Provider where the payment - method is saved. - data: - type: object - description: >- - The data needed for the Payment Provider to use the - saved payment method. - '/customers/{id}/orders': - get: - operationId: GetCustomersCustomerOrders - summary: Retrieve Customer Orders - description: Retrieves a list of a Customer's Orders. - 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: - payment_methods: - type: array - items: - $ref: '#/components/schemas/order' - '/customers/{id}/password-token': - post: - operationId: PostCustomersCustomerPasswordToken - summary: Creates a reset password token - description: >- - Creates a reset password token to be used in a subsequent - /reset-password request. The password token should be sent out of band - e.g. via email and will not be returned. - parameters: - - in: path - name: id - required: true - description: The id of the Customer. - schema: - type: string - tags: - - Customer - responses: - '204': - description: OK - '/customers/{id}/reset-password': - post: - operationId: PostCustomersCustomerResetPassword - summary: Resets Customer password - description: >- - Resets a Customer's password using a password token created by a - previous /password-token request. - 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' - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - token - password properties: email: type: string description: The Customer's email. - token: - type: string - description: The password token created by a /password-token request. password: type: string - description: The new password to set for the Customer. - '/carts/{id}/shipping-methods': + description: The Customer's password. + delete: + operationId: DeleteAuth + summary: Log out + description: Destroys a Customer's authenticated session. + tags: + - Auth + responses: + "200": + description: OK + get: + operationId: GetAuth + summary: Get Session + description: Gets the currently logged in Customer. + tags: + - Auth + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: "#/components/schemas/customer" + "/auth/{email}": + get: + operationId: GetAuthEmail + summary: Check if email has account + description: Checks if a Customer with the given email has signed up. + parameters: + - in: path + name: email + required: true + description: The Customer's email. + schema: + type: string + tags: + - Auth + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + exists: + type: boolean + "/carts/{id}/shipping-methods": post: operationId: PostCartsCartShippingMethod description: Adds a Shipping Method to the Cart. @@ -394,14 +136,14 @@ paths: schema: type: string responses: - '200': + "200": description: A successful response content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' + $ref: "#/components/schemas/cart" requestBody: content: application/json: @@ -420,7 +162,7 @@ paths: process the fulfillment of the order. Look at the documentation for your installed fulfillment providers to find out what to send. - '/carts/{id}/complete': + "/carts/{id}/complete": post: summary: Complete a Cart operationId: PostCartsCartComplete @@ -441,7 +183,7 @@ paths: tags: - Cart responses: - '200': + "200": description: >- If a cart was successfully authorized, but requires further action from the user the response body will contain the cart with an @@ -454,11 +196,11 @@ paths: - type: object properties: order: - $ref: '#/components/schemas/order' + $ref: "#/components/schemas/order" - type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: "#/components/schemas/cart" /carts: post: summary: Create a Cart @@ -504,15 +246,15 @@ paths: tags: - Cart responses: - '200': + "200": description: Successfully created a new Cart content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' - '/carts/{id}/line-items': + $ref: "#/components/schemas/cart" + "/carts/{id}/line-items": post: operationId: PostCartsCartLineItems summary: Add a Line Item @@ -529,14 +271,14 @@ paths: tags: - Cart responses: - '200': + "200": description: OK content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' + $ref: "#/components/schemas/cart" requestBody: content: application/json: @@ -559,7 +301,7 @@ paths: description: >- An optional key-value map with additional details about the Line Item. - '/carts/{id}/payment-sessions': + "/carts/{id}/payment-sessions": post: operationId: PostCartsCartPaymentSessions summary: Initialize Payment Sessions @@ -576,15 +318,15 @@ paths: tags: - Cart responses: - '200': + "200": description: OK content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' - '/carts/{id}/discounts/{code}': + $ref: "#/components/schemas/cart" + "/carts/{id}/discounts/{code}": delete: operationId: DeleteCartsCartDiscountsDiscount description: Removes a Discount from a Cart. @@ -605,15 +347,15 @@ paths: tags: - Cart responses: - '200': + "200": description: OK content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' - '/carts/{id}/line-items/{line_id}': + $ref: "#/components/schemas/cart" + "/carts/{id}/line-items/{line_id}": delete: operationId: DeleteCartsCartLineItemsItem summary: Delete a Line Item @@ -634,14 +376,14 @@ paths: tags: - Cart responses: - '200': + "200": description: OK content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' + $ref: "#/components/schemas/cart" post: operationId: PostCartsCartLineItemsItem summary: Update a Line Item @@ -662,14 +404,14 @@ paths: tags: - Cart responses: - '200': + "200": description: OK content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' + $ref: "#/components/schemas/cart" requestBody: content: application/json: @@ -681,7 +423,7 @@ paths: quantity: type: integer description: The quantity to set the Line Item to. - '/carts/{id}/payment-sessions/{provider_id}': + "/carts/{id}/payment-sessions/{provider_id}": delete: operationId: DeleteCartsCartPaymentSessionsSession summary: Delete a Payment Session @@ -706,14 +448,14 @@ paths: tags: - Cart responses: - '200': + "200": description: OK content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' + $ref: "#/components/schemas/cart" post: operationId: PostCartsCartPaymentSessionUpdate summary: Update a Payment Session @@ -734,14 +476,14 @@ paths: tags: - Cart responses: - '200': + "200": description: OK content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' + $ref: "#/components/schemas/cart" requestBody: content: application/json: @@ -759,7 +501,7 @@ paths: data: type: object description: The data to update the payment session with. - '/carts/{id}': + "/carts/{id}": get: operationId: GetCartsCart summary: Retrieve a Cart @@ -774,15 +516,15 @@ paths: tags: - Cart responses: - '200': + "200": description: OK content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' - '/carts/{id}/payment-session': + $ref: "#/components/schemas/cart" + "/carts/{id}/payment-session": post: operationId: PostCartsCartPaymentSession summary: Select a Payment Session @@ -799,14 +541,14 @@ paths: tags: - Cart responses: - '200': + "200": description: OK content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' + $ref: "#/components/schemas/cart" requestBody: content: application/json: @@ -818,7 +560,7 @@ paths: provider_id: type: string description: The id of the Payment Provider. - '/store/carts/{id}': + "/store/carts/{id}": post: operationId: PostCartsCart summary: Update a Cart" @@ -847,11 +589,11 @@ paths: billing_address: description: The Address to be used for billing purposes. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" shipping_address: description: The Address to be used for shipping. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" gift_cards: description: An array of Gift Card codes to add to the Cart. type: array @@ -877,33 +619,102 @@ paths: tags: - Cart responses: - '200': + "200": description: OK content: application/json: schema: properties: cart: - $ref: '#/components/schemas/cart' - /auth: + $ref: "#/components/schemas/cart" + "/collections/{id}": + get: + operationId: GetCollectionsCollection + summary: Retrieve a Product Collection + description: Retrieves a Product Collection. + parameters: + - in: path + name: id + required: true + description: The id of the Product Collection + schema: + type: string + tags: + - Collection + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + collection: + $ref: "#/components/schemas/product_collection" + /collections: + get: + operationId: GetCollections + summary: List Product Collections + description: Retrieve a list of Product Collection. + tags: + - Collection + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + collection: + $ref: "#/components/schemas/product_collection" + "/customers/{id}/addresses": post: - operationId: PostAuth - summary: Authenticate Customer - description: >- - Logs a Customer in and authorizes them to view their details. Successful - authentication will set a session cookie in the Customer's browser. + operationId: PostCustomersCustomerAddresses + summary: Add a Shipping Address + description: Adds a Shipping Address to a Customer's saved addresses. + parameters: + - in: path + name: id + required: true + description: The Customer id. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + address: + description: The Address to add to the Customer. + anyOf: + - $ref: "#/components/schemas/address" + tags: + - Customer + responses: + "200": + description: A successful response + content: + application/json: + schema: + properties: + customer: + $ref: "#/components/schemas/customer" + /customers: + post: + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer account. parameters: [] tags: - - Auth + - Customer responses: - '200': + "200": description: OK content: application/json: schema: properties: customer: - $ref: '#/components/schemas/customer' + $ref: "#/components/schemas/customer" requestBody: content: application/json: @@ -911,62 +722,247 @@ paths: type: object required: - email + - first_name + - last_name - password properties: email: type: string - description: The Customer's email. + description: The Customer's email address. + first_name: + type: string + description: The Customer's first name. + last_name: + type: string + description: The Customer's last name. password: type: string - description: The Customer's password. + description: The Customer's password for login. + phone: + type: string + description: The Customer's phone number. + "/customers/{id}/addresses/{address_id}": delete: - operationId: DeleteAuth - summary: Log out - description: Destroys a Customer's authenticated session. + operationId: DeleteCustomersCustomerAddressesAddress + summary: Delete an Address + description: Removes an Address from the Customer's saved addresse. + parameters: + - in: path + name: id + required: true + description: The id of the Customer. + schema: + type: string + - in: path + name: address_id + required: true + description: The id of the Address to remove. + schema: + type: string tags: - - Auth + - Customer responses: - '200': - description: OK - get: - operationId: GetAuth - summary: Get Session - description: Gets the currently logged in Customer. - tags: - - Auth - responses: - '200': + "200": description: OK content: application/json: schema: properties: customer: - $ref: '#/components/schemas/customer' - '/auth/{email}': + $ref: "#/components/schemas/customer" + /customers/me: get: - operationId: GetAuthEmail - summary: Check if email has account - description: Checks if a Customer with the given email has signed up. - parameters: - - in: path - name: email - required: true - description: The Customer's email. - schema: - type: string + operationId: GetCustomersCustomer + summary: Retrieves a Customer + description: >- + Retrieves a Customer - the Customer must be logged in to retrieve their + details. tags: - - Auth + - Customer responses: - '200': + "200": description: OK content: application/json: schema: properties: - exists: - type: boolean - '/gift-cards/{code}': + customer: + $ref: "#/components/schemas/customer" + post: + operationId: PostCustomersCustomer + summary: Update Customer details + description: Updates a Customer's saved details. + requestBody: + content: + application/json: + schema: + properties: + first_name: + description: The Customer's first name. + type: string + last_name: + description: The Customer's last name. + type: string + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: "#/components/schemas/address" + password: + description: The Customer's password. + type: string + phone: + description: The Customer's phone number. + type: string + email: + description: The email of the customer. + type: string + metadata: + description: Metadata about the customer. + type: object + tags: + - Customer + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: "#/components/schemas/customer" + /customers/me/payment-methods: + get: + operationId: GetCustomersCustomerPaymentMethods + summary: Retrieve saved payment methods + description: >- + Retrieves a list of a Customer's saved payment methods. Payment methods + are saved with Payment Providers and it is their responsibility to fetch + saved methods. + tags: + - Customer + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + payment_methods: + type: array + items: + properties: + provider_id: + type: string + description: >- + The id of the Payment Provider where the payment + method is saved. + data: + type: object + description: >- + The data needed for the Payment Provider to use the + saved payment method. + /customers/me/orders: + get: + operationId: GetCustomersCustomerOrders + summary: Retrieve Customer Orders + description: Retrieves a list of a Customer's Orders. + tags: + - Customer + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + payment_methods: + type: array + items: + $ref: "#/components/schemas/order" + /customers/password-token: + post: + operationId: PostCustomersCustomerPasswordToken + summary: Creates a reset password token + description: >- + Creates a reset password token to be used in a subsequent + /reset-password request. The password token should be sent out of band + e.g. via email and will not be returned. + tags: + - Customer + responses: + "204": + description: OK + /customers/reset-password: + post: + operationId: PostCustomersResetPassword + summary: Resets Customer password + description: >- + Resets a Customer's password using a password token created by a + previous /password-token request. + parameters: [] + tags: + - Customer + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: "#/components/schemas/customer" + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - token + - password + properties: + email: + type: string + description: The Customer's email. + token: + type: string + description: The password token created by a /password-token request. + password: + type: string + description: The new password to set for the Customer. + "/customers/me/addresses/{address_id}": + post: + operationId: PostCustomersCustomerAddressesAddress + summary: Update a Shipping Address + description: Updates a Customer's saved Shipping Address. + parameters: + - in: path + name: address_id + required: true + description: The id of the Address to update. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + address: + description: The updated Address. + anyOf: + - $ref: "#/components/schemas/address" + tags: + - Customer + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: "#/components/schemas/customer" + "/gift-cards/{code}": get: operationId: GetGiftCardsCode summary: Retrieve Gift Card by Code @@ -981,7 +977,7 @@ paths: tags: - Gift Card responses: - '200': + "200": description: OK content: application/json: @@ -996,8 +992,8 @@ paths: balance: description: The current balanace of the Gift Card region: - $ref: '#/components/schemas/region' - '/orders/cart/{cart_id}': + $ref: "#/components/schemas/region" + "/orders/cart/{cart_id}": get: operationId: GetOrdersOrderCartId summary: Retrieves Order by Cart id @@ -1014,15 +1010,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/orders/{id}': + $ref: "#/components/schemas/order" + "/orders/{id}": get: operationId: GetOrdersOrder summary: Retrieves an Order @@ -1037,14 +1033,14 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: customer: - $ref: '#/components/schemas/customer' + $ref: "#/components/schemas/customer" /orders: get: operationId: GetOrders @@ -1069,15 +1065,15 @@ paths: tags: - Order responses: - '200': + "200": description: OK content: application/json: schema: properties: order: - $ref: '#/components/schemas/order' - '/products/{id}': + $ref: "#/components/schemas/order" + "/products/{id}": get: operationId: GetProductsProduct summary: Retrieves a Product @@ -1092,14 +1088,14 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: schema: properties: product: - $ref: '#/components/schemas/product' + $ref: "#/components/schemas/product" /products: get: operationId: GetProducts @@ -1108,7 +1104,7 @@ paths: tags: - Product responses: - '200': + "200": description: OK content: application/json: @@ -1121,13 +1117,13 @@ paths: description: The offset for pagination. type: integer limit: - description: 'The maxmimum number of Products to return,' + description: "The maxmimum number of Products to return," type: integer products: type: array items: - $ref: '#/components/schemas/product' - '/regions/{id}': + $ref: "#/components/schemas/product" + "/regions/{id}": get: operationId: GetRegionsRegion summary: Retrieves a Region @@ -1142,14 +1138,14 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: schema: properties: region: - $ref: '#/components/schemas/region' + $ref: "#/components/schemas/region" /regions: get: operationId: GetRegions @@ -1158,7 +1154,7 @@ paths: tags: - Region responses: - '200': + "200": description: OK content: application/json: @@ -1171,13 +1167,13 @@ paths: description: The offset for pagination. type: integer limit: - description: 'The maxmimum number of regions to return,' + description: "The maxmimum number of regions to return," type: integer regions: type: array items: - $ref: '#/components/schemas/region' - '/return-reasons/{id}': + $ref: "#/components/schemas/region" + "/return-reasons/{id}": get: operationId: GetReturnReasonsReason summary: Retrieve a Return Reason @@ -1192,14 +1188,14 @@ paths: tags: - Return Reason responses: - '200': + "200": description: OK content: application/json: schema: properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: "#/components/schemas/return_reason" /return-reasons: get: operationId: GetReturnReasons @@ -1208,7 +1204,7 @@ paths: tags: - Return Reason responses: - '200': + "200": description: OK content: application/json: @@ -1217,7 +1213,68 @@ paths: return_reasons: type: array items: - $ref: '#/components/schemas/return_reason' + $ref: "#/components/schemas/return_reason" + /shipping-options: + get: + operationId: GetShippingOptions + summary: Retrieve Shipping Options + description: Retrieves a list of Shipping Options. + parameters: + - in: query + name: is_return + description: >- + Whether return Shipping Options should be included. By default all + Shipping Options are returned. + schema: + type: boolean + - in: query + name: product_ids + description: A comma separated list of Product ids to filter Shipping Options by. + schema: + type: string + - in: query + name: region_id + description: the Region to retrieve Shipping Options from. + schema: + type: string + tags: + - Shipping Option + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + shipping_options: + type: array + items: + $ref: "#/components/schemas/shipping_option" + "/shipping-options/{cart_id}": + get: + operationId: GetShippingOptionsCartId + summary: Retrieve Shipping Options for Cart + description: Retrieves a list of Shipping Options available to a cart. + parameters: + - in: path + name: cart_id + required: true + description: The id of the Cart. + schema: + type: string + tags: + - Shipping Option + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + shipping_options: + type: array + items: + $ref: "#/components/schemas/shipping_option" /returns: post: operationId: PostReturns @@ -1257,75 +1314,14 @@ paths: tags: - Return responses: - '200': + "200": description: OK content: application/json: schema: properties: return: - $ref: '#/components/schemas/return' - /shipping-options: - get: - operationId: GetShippingOptions - summary: Retrieve Shipping Options - description: Retrieves a list of Shipping Options. - parameters: - - in: query - name: is_return - description: >- - Whether return Shipping Options should be included. By default all - Shipping Options are returned. - schema: - type: boolean - - in: query - name: product_ids - description: A comma separated list of Product ids to filter Shipping Options by. - schema: - type: string - - in: query - name: region_id - description: the Region to retrieve Shipping Options from. - schema: - type: string - tags: - - Shipping Option - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - shipping_options: - type: array - items: - $ref: '#/components/schemas/shipping_option' - '/shipping-options/{cart_id}': - get: - operationId: GetShippingOptionsCartId - summary: Retrieve Shipping Options for Cart - description: Retrieves a list of Shipping Options available to a cart. - parameters: - - in: path - name: cart_id - required: true - description: The id of the Cart. - schema: - type: string - tags: - - Shipping Option - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - shipping_options: - type: array - items: - $ref: '#/components/schemas/shipping_option' + $ref: "#/components/schemas/return" /swaps: post: operationId: PostSwaps @@ -1352,18 +1348,11 @@ paths: quantity: description: The quantity to return. type: integer - return_shipping: + return_shipping_option: + type: string 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. + The id of the Shipping Option to create the Shipping Method + from. additional_items: description: The items to exchange the returned items to. type: array @@ -1378,15 +1367,15 @@ paths: tags: - Swap responses: - '200': + "200": description: OK content: application/json: schema: properties: swap: - $ref: '#/components/schemas/swap' - '/swaps/{cart_id}': + $ref: "#/components/schemas/swap" + "/swaps/{cart_id}": get: operationId: GetSwapsSwapCartId summary: Retrieve Swap by Cart id @@ -1401,15 +1390,15 @@ paths: tags: - Swap responses: - '200': + "200": description: OK content: application/json: schema: properties: swap: - $ref: '#/components/schemas/swap' - '/variants/{variant_id}': + $ref: "#/components/schemas/swap" + "/variants/{variant_id}": get: operationId: GetVariantsVariant summary: Retrieve a Product Variant @@ -1424,14 +1413,14 @@ paths: tags: - Product Variant responses: - '200': + "200": description: OK content: application/json: schema: properties: variant: - $ref: '#/components/schemas/product_variant' + $ref: "#/components/schemas/product_variant" /variants: get: operationId: GetVariants @@ -1446,7 +1435,7 @@ paths: tags: - Product Variant responses: - '200': + "200": description: OK content: application/json: @@ -1455,7 +1444,7 @@ paths: variants: type: array items: - $ref: '#/components/schemas/product_variant' + $ref: "#/components/schemas/product_variant" components: schemas: address: @@ -1482,7 +1471,7 @@ components: country_code: type: string country: - $ref: '#/components/schemas/country' + $ref: "#/components/schemas/country" cart: title: Cart description: Represents a user cart @@ -1495,43 +1484,43 @@ components: billing_address_id: type: string billing_address: - $ref: '#/components/schemas/address' + $ref: "#/components/schemas/address" shipping_address_id: type: string shipping_address: - $ref: '#/components/schemas/address' + $ref: "#/components/schemas/address" items: type: array items: - $ref: '#/components/schemas/line_item' + $ref: "#/components/schemas/line_item" region_id: type: string region: - $ref: '#/components/schemas/region' + $ref: "#/components/schemas/region" discounts: type: array items: - $ref: '#/components/schemas/region' + $ref: "#/components/schemas/region" gift_cards: type: array items: - $ref: '#/components/schemas/gift_card' + $ref: "#/components/schemas/gift_card" customer_id: type: string customer: - $ref: '#/components/schemas/customer' + $ref: "#/components/schemas/customer" payment_session: - $ref: '#/components/schemas/payment_session' + $ref: "#/components/schemas/payment_session" payment_sessions: type: array items: - $ref: '#/components/schemas/payment_session' + $ref: "#/components/schemas/payment_session" payment: - $ref: '#/components/schemas/payment' + $ref: "#/components/schemas/payment" shipping_methods: type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: "#/components/schemas/shipping_method" type: type: string enum: @@ -1598,19 +1587,19 @@ components: images: type: array items: - $ref: '#/components/schemas/claim_image' + $ref: "#/components/schemas/claim_image" claim_order_id: type: string item_id: type: string item: description: The Line Item that the claim refers to - $ref: '#/components/schemas/line_item' + $ref: "#/components/schemas/line_item" variant_id: type: string variant: description: The Product Variant that is claimed. - $ref: '#/components/schemas/product_variant' + $ref: "#/components/schemas/product_variant" reason: description: The reason for the claim type: string @@ -1620,7 +1609,7 @@ components: - production_failure - other note: - description: 'An optional note about the claim, for additional information' + description: "An optional note about the claim, for additional information" type: string quantity: description: >- @@ -1631,7 +1620,7 @@ components: description: User defined tags for easy filtering and grouping. type: array items: - $ref: '#/components/schemas/claim_tag' + $ref: "#/components/schemas/claim_tag" created_at: type: string format: date-time @@ -1680,39 +1669,43 @@ components: description: The items that have been claimed type: array items: - $ref: '#/components/schemas/claim_item' + $ref: "#/components/schemas/claim_item" additional_items: description: >- Refers to the new items to be shipped when the claim order has the type `replace` type: array items: - $ref: '#/components/schemas/line_item' + $ref: "#/components/schemas/line_item" order_id: description: The id of the order that the claim comes from. type: string return_order: description: Holds information about the return if the claim is to be returned - $ref: '#/components/schemas/return' + $ref: "#/components/schemas/return" shipping_address_id: description: The id of the address that the new items should be shipped to type: string shipping_address: description: The address that the new items should be shipped to - $ref: '#/components/schemas/address' + $ref: "#/components/schemas/address" shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: "#/components/schemas/shipping_method" fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: "#/components/schemas/fulfillment" refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer + canceled_at: + description: The date with timezone at which the Swap was canceled. + type: string + format: date-time created_at: type: string format: date-time @@ -1797,6 +1790,49 @@ components: name: description: The written name of the currency type: string + custom_shipping_option: + title: Custom Shipping Option + description: >- + Custom Shipping Options are 'overriden' Shipping Options. Store managers + can attach a Custom Shipping Option to a cart in order to set a custom + price for a particular Shipping Option + x-resourceId: custom_shipping_option + properties: + id: + description: >- + The id of the Custom Shipping Option. This value will be prefixed + with `cso_`. + type: string + price: + description: >- + The custom price set that will override the shipping option's + original price + type: integer + shipping_option_id: + description: >- + The id of the Shipping Option that the custom shipping option + overrides + anyOf: + - $ref: "#/components/schemas/shipping_option" + cart_id: + description: The id of the Cart that the custom shipping option is attached to + anyOf: + - $ref: "#/components/schemas/cart" + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object customer: title: Customer description: Represents a customer @@ -1811,11 +1847,11 @@ components: billing_address: description: The Customer's billing address. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" shipping_addresses: type: array items: - $ref: '#/components/schemas/address' + $ref: "#/components/schemas/address" first_name: type: string last_name: @@ -1873,7 +1909,7 @@ components: description: A set of Products that the discount can be used for. type: array items: - $ref: '#/components/schemas/product' + $ref: "#/components/schemas/product" created_at: description: The date with timezone at which the resource was created. type: string @@ -1912,7 +1948,7 @@ components: rule: description: The Discount Rule that governs the behaviour of the Discount anyOf: - - $ref: '#/components/schemas/discount_rule' + - $ref: "#/components/schemas/discount_rule" is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -1935,7 +1971,7 @@ components: description: The Regions in which the Discount can be used type: array items: - $ref: '#/components/schemas/region' + $ref: "#/components/schemas/region" usage_limit: description: The maximum number of times that a discount can be used. type: integer @@ -1975,12 +2011,12 @@ components: type: string cart: anyOf: - - $ref: '#/components/schemas/cart' + - $ref: "#/components/schemas/cart" order_id: type: string order: anyOf: - - $ref: '#/components/schemas/order' + - $ref: "#/components/schemas/order" canceled_at: type: string format: date-time @@ -2018,7 +2054,7 @@ components: item: description: The Line Item that the Fulfillment Item references. anyOf: - - $ref: '#/components/schemas/line_item' + - $ref: "#/components/schemas/line_item" quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer @@ -2073,7 +2109,7 @@ components: about how many of each Line Item has been fulfilled. type: array items: - $ref: '#/components/schemas/fulfillment_item' + $ref: "#/components/schemas/fulfillment_item" tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -2081,7 +2117,7 @@ components: Provider. type: array items: - $ref: '#/components/schemas/tracking_link' + $ref: "#/components/schemas/tracking_link" tracking_numbers: deprecated: true description: >- @@ -2132,7 +2168,7 @@ components: gift_card: description: The Gift Card that was used in the transaction. anyOf: - - $ref: '#/components/schemas/gift_card' + - $ref: "#/components/schemas/gift_card" order_id: description: The id of the Order that the Gift Card was used to pay for. type: string @@ -2170,7 +2206,7 @@ components: region: description: The Region in which the Gift Card is available. anyOf: - - $ref: '#/components/schemas/region' + - $ref: "#/components/schemas/region" order_id: description: The id of the Order that the Gift Card was purchased in. type: string @@ -2285,7 +2321,7 @@ components: variant: description: The Product Variant contained in the Line Item. anyOf: - - $ref: '#/components/schemas/product_variant' + - $ref: "#/components/schemas/product_variant" quantity: description: The quantity of the content in the Line Item. type: integer @@ -2350,7 +2386,7 @@ components: region: description: The Region that the Money Amount is defined for. anyOf: - - $ref: '#/components/schemas/region' + - $ref: "#/components/schemas/region" created_at: description: The date with timezone at which the resource was created. type: string @@ -2363,6 +2399,45 @@ components: description: The date with timezone at which the resource was deleted. type: string format: date-time + note: + title: Note + description: >- + Notes are elements which we can use in association with different + resources to allow users to describe additional information in relation + to these. + x-resourceId: note + properties: + id: + description: The id of the Note. This value will be prefixed by `note_`. + type: string + resource_type: + description: The type of resource that the Note refers to. + type: string + resource_id: + description: The id of the resource that the Note refers to. + type: string + value: + description: The contents of the note. + type: string + author: + description: The author of the note. + anyOf: + - $ref: "#/components/schemas/user" + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object notification_provider: title: Notification Provider description: >- @@ -2406,7 +2481,7 @@ components: customer: description: The Customer that the Notification was sent to. anyOf: - - $ref: '#/components/schemas/customer' + - $ref: "#/components/schemas/customer" to: description: >- The address that the Notification was sent to. This will usually be @@ -2427,7 +2502,7 @@ components: Notification. type: array items: - $ref: '#/components/schemas/notification_resend' + $ref: "#/components/schemas/notification_resend" provider_id: description: The id of the Notification Provider that handles the Notification. type: string @@ -2529,76 +2604,76 @@ components: discounts: type: array items: - $ref: '#/components/schemas/discount' + $ref: "#/components/schemas/discount" email: type: string billing_address_id: type: string billing_address: anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" shipping_address_id: type: string shipping_address: anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" items: type: array items: - $ref: '#/components/schemas/line_item' + $ref: "#/components/schemas/line_item" region_id: type: string region: anyOf: - - $ref: '#/components/schemas/region' + - $ref: "#/components/schemas/region" gift_cards: type: array items: - $ref: '#/components/schemas/gift_card' + $ref: "#/components/schemas/gift_card" customer_id: type: string customer: anyOf: - - $ref: '#/components/schemas/customer' + - $ref: "#/components/schemas/customer" payment_session: anyOf: - - $ref: '#/components/schemas/payment_session' + - $ref: "#/components/schemas/payment_session" payment_sessions: type: array items: - $ref: '#/components/schemas/payment_session' + $ref: "#/components/schemas/payment_session" payments: type: array items: - $ref: '#/components/schemas/payment' + $ref: "#/components/schemas/payment" shipping_methods: type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: "#/components/schemas/shipping_method" fulfillments: type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: "#/components/schemas/fulfillment" returns: type: array items: - $ref: '#/components/schemas/return' + $ref: "#/components/schemas/return" claims: type: array items: - $ref: '#/components/schemas/claim_order' + $ref: "#/components/schemas/claim_order" refunds: type: array items: - $ref: '#/components/schemas/refund' + $ref: "#/components/schemas/refund" swaps: type: array items: - $ref: '#/components/schemas/refund' + $ref: "#/components/schemas/refund" gift_card_transactions: type: array items: - $ref: '#/components/schemas/gift_card_transaction' + $ref: "#/components/schemas/gift_card_transaction" canceled_at: type: string format: date-time @@ -2864,7 +2939,7 @@ components: description: The Product Option Values that are defined for the Product Option. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: "#/components/schemas/product_option_value" product_id: description: The id of the Product that the Product Option is defined for. type: string @@ -2968,7 +3043,7 @@ components: Region. type: array items: - $ref: '#/components/schemas/money_amount' + $ref: "#/components/schemas/money_amount" sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -3049,7 +3124,7 @@ components: description: The Product Option Values specified for the Product Variant. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: "#/components/schemas/product_option_value" created_at: description: The date with timezone at which the resource was created. type: string @@ -3107,7 +3182,7 @@ components: description: Images of the Product type: array items: - $ref: '#/components/schemas/image' + $ref: "#/components/schemas/image" thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -3118,14 +3193,14 @@ components: Option Values. type: array items: - $ref: '#/components/schemas/product_option' + $ref: "#/components/schemas/product_option" variants: description: >- The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. type: array items: - $ref: '#/components/schemas/product_variant' + $ref: "#/components/schemas/product_variant" profile_id: description: >- The id of the Shipping Profile that the Product belongs to. Shipping @@ -3179,16 +3254,16 @@ components: type: description: The Product Type of the Product (e.g. "Clothing") anyOf: - - $ref: '#/components/schemas/product_type' + - $ref: "#/components/schemas/product_type" collection: description: The Product Collection that the Product belongs to (e.g. "SS20") anyOf: - - $ref: '#/components/schemas/product_collection' + - $ref: "#/components/schemas/product_collection" tags: description: The Product Tags assigned to the Product. type: array items: - $ref: '#/components/schemas/product_tag' + $ref: "#/components/schemas/product_tag" created_at: description: The date with timezone at which the resource was created. type: string @@ -3280,21 +3355,21 @@ components: description: The countries that are included in the Region. type: array items: - $ref: '#/components/schemas/country' + $ref: "#/components/schemas/country" payment_providers: description: >- The Payment Providers that can be used to process Payments in the Region. type: array items: - $ref: '#/components/schemas/payment_provider' + $ref: "#/components/schemas/payment_provider" fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. type: array items: - $ref: '#/components/schemas/fulfillment_provider' + $ref: "#/components/schemas/fulfillment_provider" created_at: description: The date with timezone at which the resource was created. type: string @@ -3326,7 +3401,7 @@ components: item: description: The Line Item that the Return Item references. anyOf: - - $ref: '#/components/schemas/line_item' + - $ref: "#/components/schemas/line_item" quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -3344,7 +3419,7 @@ components: reason: description: The reason for returning the item. anyOf: - - $ref: '#/components/schemas/return_reason' + - $ref: "#/components/schemas/return_reason" note: description: An optional note with additional details about the Return. type: string @@ -3406,7 +3481,7 @@ components: items: description: >- The Return Items that will be shipped back to the warehouse. type: - array items: $ref: + array items: $ref: swap_id: description: The id of the Swap that the Return is a part of. type: string @@ -3421,7 +3496,7 @@ components: The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. anyOf: - - $ref: '#/components/schemas/shipping_method' + - $ref: "#/components/schemas/shipping_method" shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -3472,7 +3547,7 @@ components: shipping_option: description: The Shipping Option that the Shipping Method is built from. anyOf: - - $ref: '#/components/schemas/shipping_option' + - $ref: "#/components/schemas/shipping_option" order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -3558,7 +3633,7 @@ components: region: description: The id of the Region that the Shipping Option belongs to. anyOf: - - $ref: '#/components/schemas/region' + - $ref: "#/components/schemas/region" profile_id: description: >- The id of the Shipping Profile that the Shipping Option belongs to. @@ -3596,7 +3671,7 @@ components: be available for a Cart. type: array items: - $ref: '#/components/schemas/shipping_option_requirement' + $ref: "#/components/schemas/shipping_option_requirement" data: description: >- The data needed for the Fulfillment Provider to identify the @@ -3647,7 +3722,7 @@ components: description: The Products that the Shipping Profile defines Shipping Options for. type: array items: - $ref: '#/components/schemas/product' + $ref: "#/components/schemas/product" shipping_options: description: >- The Shipping Options that can be used to fulfill the Products in the @@ -3655,7 +3730,7 @@ components: type: array items: anyOf: - - $ref: '#/components/schemas/shipping_option' + - $ref: "#/components/schemas/shipping_option" created_at: description: The date with timezone at which the resource was created. type: string @@ -3673,7 +3748,7 @@ components: type: object store: title: Store - description: 'Holds settings for the Store, such as name, currencies, etc.' + description: "Holds settings for the Store, such as name, currencies, etc." x-resourceId: store properties: id: @@ -3691,7 +3766,7 @@ components: description: The currencies that are enabled for the Store. type: array items: - $ref: '#/components/schemas/currency' + $ref: "#/components/schemas/currency" swap_link_template: description: >- A template to generate Swap links from use {{cart_id}} to include @@ -3757,22 +3832,22 @@ components: description: The new Line Items to ship to the Customer. type: array items: - $ref: '#/components/schemas/line_item' + $ref: "#/components/schemas/line_item" return_order: description: The Return that is issued for the return part of the Swap. anyOf: - - $ref: '#/components/schemas/return' + - $ref: "#/components/schemas/return" fulfillments: description: The Fulfillments used to send the new Line Items. type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: "#/components/schemas/fulfillment" payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. anyOf: - - $ref: '#/components/schemas/payment' + - $ref: "#/components/schemas/payment" difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May @@ -3784,15 +3859,18 @@ components: The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" shipping_methods: description: The Shipping Methods used to fulfill the addtional items purchased. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: "#/components/schemas/shipping_method" cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string + allow_backorder: + description: "If true, swaps can be completed with items out of stock" + type: boolean confirmed_at: description: >- The date with timezone at which the Swap was confirmed by the @@ -3807,8 +3885,12 @@ components: description: The date with timezone at which the resource was last updated. type: string format: date-time + canceled_at: + description: The date with timezone at which the Swap was canceled. + type: string + format: date-time no_notification: - description: 'If set to true, no notification will be sent related to this swap' + description: "If set to true, no notification will be sent related to this swap" type: boolean metadata: description: An optional key-value map with additional information. @@ -3866,7 +3948,7 @@ components: last_name: description: The Customer's billing address. anyOf: - - $ref: '#/components/schemas/address' + - $ref: "#/components/schemas/address" created_at: type: string format: date-time diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-claim.js b/packages/medusa/src/api/routes/admin/orders/cancel-claim.js index 8ad46c49b3..42090baef3 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-claim.js +++ b/packages/medusa/src/api/routes/admin/orders/cancel-claim.js @@ -8,7 +8,7 @@ import { defaultRelations, defaultFields } from "." * description: "Cancels a Claim" * parameters: * - (path) id=* {string} The id of the Order. - * . (path) claim_id=* {string} The id of the Claim. + * - (path) claim_id=* {string} The id of the Claim. * tags: * - Claim * responses: @@ -19,7 +19,7 @@ import { defaultRelations, defaultFields } from "." * schema: * properties: * order: - * $ref: "#/components/schemas/claim" + * $ref: "#/components/schemas/claim_order" */ export default async (req, res) => { const { id, claim_id } = req.params diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.js b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.js index 043ae269c7..b0b550d19e 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.js +++ b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.js @@ -2,7 +2,7 @@ import { MedusaError } from "medusa-core-utils" import { defaultRelations, defaultFields } from "." /** - * @oas [post] orders//{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel + * @oas [post] /orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel * operationId: "PostOrdersClaimFulfillmentsCancel" * summary: "Cancels a fulfilmment related to a Claim" * description: "Registers a Fulfillment as canceled." diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-swap.js b/packages/medusa/src/api/routes/admin/orders/cancel-swap.js index 0d09a2353e..78e5356795 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-swap.js +++ b/packages/medusa/src/api/routes/admin/orders/cancel-swap.js @@ -8,7 +8,7 @@ import { defaultRelations, defaultFields } from "." * description: "Cancels a Swap" * parameters: * - (path) id=* {string} The id of the Order. - * . (path) swap_id=* {string} The id of the Swap. + * - (path) swap_id=* {string} The id of the Swap. * tags: * - Swap * responses: diff --git a/packages/medusa/src/api/routes/admin/orders/create-swap.js b/packages/medusa/src/api/routes/admin/orders/create-swap.js index 4d4ff3bb1c..2864644f39 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-swap.js +++ b/packages/medusa/src/api/routes/admin/orders/create-swap.js @@ -45,7 +45,7 @@ import { defaultFields, defaultRelations } from "./" * quantity: * description: The quantity of the Product Variant to ship. * type: integer - * custom_shipping_options: + * custom_shipping_options: * description: The custom shipping options to potentially create a Shipping Method from. * type: array * items: diff --git a/packages/medusa/src/api/routes/store/customers/get-payment-methods.js b/packages/medusa/src/api/routes/store/customers/get-payment-methods.js index 0c1cdcfa4c..b0f4e5a032 100644 --- a/packages/medusa/src/api/routes/store/customers/get-payment-methods.js +++ b/packages/medusa/src/api/routes/store/customers/get-payment-methods.js @@ -3,8 +3,6 @@ * operationId: GetCustomersCustomerPaymentMethods * summary: Retrieve saved payment methods * description: "Retrieves a list of a Customer's saved payment methods. Payment methods are saved with Payment Providers and it is their responsibility to fetch saved methods." - * parameters: - * - (path) id=* {string} The id of the Customer. * tags: * - Customer * responses: diff --git a/packages/medusa/src/api/routes/store/customers/list-orders.js b/packages/medusa/src/api/routes/store/customers/list-orders.js index cd339f7e13..730719934b 100644 --- a/packages/medusa/src/api/routes/store/customers/list-orders.js +++ b/packages/medusa/src/api/routes/store/customers/list-orders.js @@ -10,8 +10,6 @@ import { * operationId: GetCustomersCustomerOrders * summary: Retrieve Customer Orders * description: "Retrieves a list of a Customer's Orders." - * parameters: - * - (path) id=* {string} The id of the Customer. * tags: * - Customer * responses: diff --git a/packages/medusa/src/models/custom-shipping-option.ts b/packages/medusa/src/models/custom-shipping-option.ts index 04e7bfaf06..d5e857d429 100644 --- a/packages/medusa/src/models/custom-shipping-option.ts +++ b/packages/medusa/src/models/custom-shipping-option.ts @@ -1,5 +1,6 @@ import { - BeforeInsert, Column, + BeforeInsert, + Column, CreateDateColumn, DeleteDateColumn, Entity, @@ -8,16 +9,15 @@ import { ManyToOne, PrimaryColumn, Unique, - UpdateDateColumn -} from "typeorm"; -import { ulid } from "ulid"; -import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column"; -import { Cart } from './cart'; -import { ShippingOption } from "./shipping-option"; - + UpdateDateColumn, +} from "typeorm" +import { ulid } from "ulid" +import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column" +import { Cart } from "./cart" +import { ShippingOption } from "./shipping-option" @Entity() -@Unique(['shipping_option_id', 'cart_id']) +@Unique(["shipping_option_id", "cart_id"]) export class CustomShippingOption { @PrimaryColumn() id: string @@ -27,8 +27,8 @@ export class CustomShippingOption { @Index() @Column() - shipping_option_id: string; - + shipping_option_id: string + @ManyToOne(() => ShippingOption) @JoinColumn({ name: "shipping_option_id" }) shipping_option: ShippingOption @@ -62,7 +62,7 @@ export class CustomShippingOption { } /** - * @schema Custom shipping_option + * @schema custom_shipping_option * title: "Custom Shipping Option" * description: "Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option" * x-resourceId: custom_shipping_option diff --git a/packages/medusa/src/models/note.ts b/packages/medusa/src/models/note.ts index 77c29f89df..0b3956ec7d 100644 --- a/packages/medusa/src/models/note.ts +++ b/packages/medusa/src/models/note.ts @@ -77,7 +77,8 @@ export class Note { * type: string * author: * description: "The author of the note." - * type: User + * anyOf: + * - $ref: "#/components/schemas/user" * created_at: * description: "The date with timezone at which the resource was created." * type: string