All URIs are relative to https://api.medusa-commerce.com/store
Method | HTTP request | Description |
---|---|---|
deleteCartsCartDiscountsDiscount | DELETE /carts/{id}/discounts/{code} | Remove Discount |
deleteCartsCartLineItemsItem | DELETE /carts/{id}/line-items/{line_id} | Delete a Line Item |
deleteCartsCartPaymentSessionsSession | DELETE /carts/{id}/payment-sessions/{provider_id} | Delete a Payment Session |
getCartsCart | GET /carts/{id} | Get a Cart |
postCart | POST /carts | Create a Cart |
postCartsCart | POST /carts/{id} | Update a Cart |
postCartsCartComplete | POST /carts/{id}/complete | Complete a Cart |
postCartsCartLineItems | POST /carts/{id}/line-items | Add a Line Item |
postCartsCartLineItemsItem | POST /carts/{id}/line-items/{line_id} | Update a Line Item |
postCartsCartPaymentSession | POST /carts/{id}/payment-session | Select a Payment Session |
postCartsCartPaymentSessionUpdate | POST /carts/{id}/payment-sessions/{provider_id} | Update a Payment Session |
postCartsCartPaymentSessions | POST /carts/{id}/payment-sessions | Create Payment Sessions |
postCartsCartPaymentSessionsSession | POST /carts/{id}/payment-sessions/{provider_id}/refresh | Refresh a Payment Session |
postCartsCartShippingMethod | POST /carts/{id}/shipping-methods | Add a Shipping Method |
postCartsCartTaxes | POST /carts/{id}/taxes | Calculate Cart Taxes |
StoreCartsRes deleteCartsCartDiscountsDiscount(id, code)
Remove Discount
Removes a Discount from a Cart.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The id of the Cart.
String code = "code_example"; // String | The unique Discount code.
try {
StoreCartsRes result = apiInstance.deleteCartsCartDiscountsDiscount(id, code);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#deleteCartsCartDiscountsDiscount");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the Cart. | |
code | String | The unique Discount code. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
StoreCartsRes deleteCartsCartLineItemsItem(id, lineId)
Delete a Line Item
Removes a Line Item from a Cart.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The id of the Cart.
String lineId = "lineId_example"; // String | The id of the Line Item.
try {
StoreCartsRes result = apiInstance.deleteCartsCartLineItemsItem(id, lineId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#deleteCartsCartLineItemsItem");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the Cart. | |
lineId | String | The id of the Line Item. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
StoreCartsRes deleteCartsCartPaymentSessionsSession(id, providerId)
Delete a Payment Session
Deletes a Payment Session on a Cart. May be useful if a payment has failed.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The id of the Cart.
String providerId = "providerId_example"; // String | The id of the Payment Provider used to create the Payment Session to be deleted.
try {
StoreCartsRes result = apiInstance.deleteCartsCartPaymentSessionsSession(id, providerId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#deleteCartsCartPaymentSessionsSession");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the Cart. | |
providerId | String | The id of the Payment Provider used to create the Payment Session to be deleted. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
StoreCartsRes getCartsCart(id)
Get a Cart
Retrieves a Cart.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The id of the Cart.
try {
StoreCartsRes result = apiInstance.getCartsCart(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#getCartsCart");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the Cart. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
StoreCartsRes postCart(body)
Create a Cart
Creates a Cart within the given region and with the initial items. If no `region_id` is provided the cart will be associated with the first Region available. If no items are provided the cart will be empty after creation. If a user is logged in the cart's customer id and email will be set.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
StorePostCartReq body = new StorePostCartReq(); // StorePostCartReq |
try {
StoreCartsRes result = apiInstance.postCart(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#postCart");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | StorePostCartReq | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
StoreCartsRes postCartsCart(id, body)
Update a Cart
Updates a Cart.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The id of the Cart.
StorePostCartsCartReq body = new StorePostCartsCartReq(); // StorePostCartsCartReq |
try {
StoreCartsRes result = apiInstance.postCartsCart(id, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#postCartsCart");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the Cart. | |
body | StorePostCartsCartReq | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
StoreCompleteCartRes postCartsCartComplete(id)
Complete a Cart
Completes a cart. The following steps will be performed. Payment authorization is attempted and if more work is required, we simply return the cart for further updates. If payment is authorized and order is not yet created, we make sure to do so. The completion of a cart can be performed idempotently with a provided header `Idempotency-Key`. If not provided, we will generate one for the request.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The Cart id.
try {
StoreCompleteCartRes result = apiInstance.postCartsCartComplete(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#postCartsCartComplete");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The Cart id. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
StoreCartsRes postCartsCartLineItems(id, body)
Add a Line Item
Generates a Line Item with a given Product Variant and adds it to the Cart
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The id of the Cart to add the Line Item to.
StorePostCartsCartLineItemsReq body = new StorePostCartsCartLineItemsReq(); // StorePostCartsCartLineItemsReq |
try {
StoreCartsRes result = apiInstance.postCartsCartLineItems(id, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#postCartsCartLineItems");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the Cart to add the Line Item to. | |
body | StorePostCartsCartLineItemsReq | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
StoreCartsRes postCartsCartLineItemsItem(id, lineId, body)
Update a Line Item
Updates a Line Item if the desired quantity can be fulfilled.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The id of the Cart.
String lineId = "lineId_example"; // String | The id of the Line Item.
StorePostCartsCartLineItemsItemReq body = new StorePostCartsCartLineItemsItemReq(); // StorePostCartsCartLineItemsItemReq |
try {
StoreCartsRes result = apiInstance.postCartsCartLineItemsItem(id, lineId, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#postCartsCartLineItemsItem");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the Cart. | |
lineId | String | The id of the Line Item. | |
body | StorePostCartsCartLineItemsItemReq | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
StoreCartsRes postCartsCartPaymentSession(id, body)
Select a Payment Session
Selects a Payment Session as the session intended to be used towards the completion of the Cart.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The ID of the Cart.
StorePostCartsCartPaymentSessionReq body = new StorePostCartsCartPaymentSessionReq(); // StorePostCartsCartPaymentSessionReq |
try {
StoreCartsRes result = apiInstance.postCartsCartPaymentSession(id, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#postCartsCartPaymentSession");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the Cart. | |
body | StorePostCartsCartPaymentSessionReq | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
StoreCartsRes postCartsCartPaymentSessionUpdate(id, providerId, body)
Update a Payment Session
Updates a Payment Session with additional data.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The id of the Cart.
String providerId = "providerId_example"; // String | The id of the payment provider.
StorePostCartsCartPaymentSessionUpdateReq body = new StorePostCartsCartPaymentSessionUpdateReq(); // StorePostCartsCartPaymentSessionUpdateReq |
try {
StoreCartsRes result = apiInstance.postCartsCartPaymentSessionUpdate(id, providerId, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#postCartsCartPaymentSessionUpdate");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the Cart. | |
providerId | String | The id of the payment provider. | |
body | StorePostCartsCartPaymentSessionUpdateReq | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
StoreCartsRes postCartsCartPaymentSessions(id)
Create Payment Sessions
Creates Payment Sessions for each of the available Payment Providers in the Cart's Region.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The id of the Cart.
try {
StoreCartsRes result = apiInstance.postCartsCartPaymentSessions(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#postCartsCartPaymentSessions");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the Cart. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
StoreCartsRes postCartsCartPaymentSessionsSession(id, providerId)
Refresh a Payment Session
Refreshes a Payment Session to ensure that it is in sync with the Cart - this is usually not necessary.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The id of the Cart.
String providerId = "providerId_example"; // String | The id of the Payment Provider that created the Payment Session to be refreshed.
try {
StoreCartsRes result = apiInstance.postCartsCartPaymentSessionsSession(id, providerId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#postCartsCartPaymentSessionsSession");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The id of the Cart. | |
providerId | String | The id of the Payment Provider that created the Payment Session to be refreshed. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
StoreCartsRes postCartsCartShippingMethod(id, body)
Add a Shipping Method
Adds a Shipping Method to the Cart.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The cart ID.
StorePostCartsCartShippingMethodReq body = new StorePostCartsCartShippingMethodReq(); // StorePostCartsCartShippingMethodReq |
try {
StoreCartsRes result = apiInstance.postCartsCartShippingMethod(id, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#postCartsCartShippingMethod");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The cart ID. | |
body | StorePostCartsCartShippingMethodReq | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
StoreCartsRes postCartsCartTaxes(id)
Calculate Cart Taxes
Calculates taxes for a cart. Depending on the cart's region this may involve making 3rd party API calls to a Tax Provider service.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.CartApi;
CartApi apiInstance = new CartApi();
String id = "id_example"; // String | The Cart ID.
try {
StoreCartsRes result = apiInstance.postCartsCartTaxes(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CartApi#postCartsCartTaxes");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | The Cart ID. |
No authorization required
- Content-Type: Not defined
- Accept: application/json