Checkout endpoint
From E-commerce 1.2 this endpoint is deprecated and replaced with v2. This version will be removed in E-commerce 2.0. |
This page describes the checkout
endpoint, which can be used to
interact with your external e-commerce solution’s REST checkout service.
In general, the checkout process involves four steps:
-
Set an address.
-
Get shipping methods.
-
Set a shipping method.
-
Create an order.
Note that in Adobe Commerce (formerly Magento), steps 1 and 2 are combined in step 2. Get shipping
methods, where you must provide the address
object as a required
parameter. Skip step 1 if you are using Adobe Commerce as your external
e-commerce solution.
Magento is now Adobe Commerce, powered by Magento. In the examples and configuration below, we may refer to Adobe Commerce as Magento. |
PUT address
Only relevant for commercetools.
Sets address. The shipping address is set by default and is required for
a successful checkout process. The billing address is set when the
address object contains the field addressType
with a billing
value.
The billing address is optional.
Parameters
Parameter | Description | Type | Data Type | Connector |
---|---|---|---|---|
|
required The definition name. |
|
|
commercetools |
|
required The connection name. |
|
|
commercetools |
|
required The shipping address (does not require |
|
|
commercetools |
|
required The ID for the checkout cart. |
|
|
commercetools |
commercetools example
Sets the shipping address for a cart and returns the cart with the shipping address.
curl --user 'superuser:superuser' --request POST "http://localhost:8080/magnoliaAuthor/.rest/ecommerce/v1/checkouts/address/66d22d22-72e6-408a-bba7-3017376e836e?definitionName=commercetools&connectionName=connection" \ --header "Content-Type: application/json" \ --data "{ "region": "region", "region_id": 1, "region_code": "region_code", "country_id": "country_id", "postcode": "postcode", "city": "city", "customer_id": "customer_id", "email": "email", "telephone": "telephone", "same_as_billing": 1, "first_name": "first_name", "last_name": "last_name", "company": "company", "street_name": "street_name", "street_number": "street_number", "mobile": "mobile", "po_Box": "123", "countryCode": "GB", "salutation": "salutation" } }"
JSON response
{
"anonymousId": "123",
"billingAddress": null,
"cartState": "ACTIVE",
"country": null,
"createdAt": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"zone": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"monthValue": 4,
"hour": 13,
"minute": 53,
"second": 34,
"nano": 48000000,
"year": 2019,
"month": "APRIL",
"dayOfMonth": 5,
"dayOfWeek": "FRIDAY",
"dayOfYear": 95,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"custom": null,
"customLineItems": [],
"customerEmail": null,
"customerGroup": null,
"customerId": null,
"deleteDaysAfterLastModification": null,
"discountCodes": [],
"id": "66d22d22-72e6-408a-bba7-3017376e836e",
"inventoryMode": "NONE",
"itemShippingAddresses": [],
"lastModifiedAt": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"zone": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"monthValue": 4,
"hour": 14,
"minute": 23,
"second": 12,
"nano": 985000000,
"year": 2019,
"month": "APRIL",
"dayOfMonth": 5,
"dayOfWeek": "FRIDAY",
"dayOfYear": 95,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"lineItems": [],
"locale": null,
"origin": "CUSTOMER",
"paymentInfo": null,
"refusedGifts": [],
"shippingAddress": {
"country": "GB",
"id": null,
"key": null,
"title": null,
"salutation": "salutation",
"firstName": null,
"lastName": null,
"streetName": "street_name",
"streetNumber": "street_number",
"additionalStreetInfo": null,
"postalCode": "postcode",
"city": "city",
"region": null,
"state": null,
"company": "company",
"department": null,
"building": null,
"apartment": null,
"poBox": null,
"phone": "telephone",
"mobile": "mobile",
"email": "email",
"additionalAddressInfo": null,
"fax": null,
"externalId": null
},
"shippingInfo": null,
"shippingRateInput": null,
"taxCalculationMode": "LINE_ITEM_LEVEL",
"taxMode": "PLATFORM",
"taxRoundingMode": "HALF_EVEN",
"taxedPrice": {
"totalNet": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": false,
"positiveOrZero": true,
"negativeOrZero": true,
"zero": true,
"negative": false,
"number": 0,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"totalGross": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": false,
"positiveOrZero": true,
"negativeOrZero": true,
"zero": true,
"negative": false,
"number": 0,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"taxPortions": []
},
"totalPrice": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": false,
"positiveOrZero": true,
"negativeOrZero": true,
"zero": true,
"negative": false,
"number": 0,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"version": 4
}
Sets the billing address for a cart and returns the cart with the billing address.
curl --user 'superuser:superuser' --request POST "http://localhost:8080/magnoliaAuthor/.rest/ecommerce/v1/checkouts/address/66d22d22-72e6-408a-bba7-3017376e836e?definitionName=commercetools&connectionName=connection" \ --header "Content-Type: application/json" \ --data "{ "addressType": "billing", "region": "region", "region_id": 1, "region_code": "region_code", "country_id": "country_id", "postcode": "postcode", "city": "city", "customer_id": "customer_id", "email": "email", "telephone": "telephone", "same_as_billing": 1, "first_name": "first_name", "last_name": "last_name", "company": "company", "street_name": "street_name", "street_number": "street_number", "mobile": "mobile", "po_Box": "123", "countryCode": "GB", "salutation": "salutation" } }"
JSON response
{
"anonymousId": "123",
"billingAddress": {
"country": "GB",
"id": null,
"key": null,
"title": null,
"salutation": "salutation",
"firstName": null,
"lastName": null,
"streetName": "street_name",
"streetNumber": "street_number",
"additionalStreetInfo": null,
"postalCode": "postcode",
"city": "city",
"region": null,
"state": null,
"company": "company",
"department": null,
"building": null,
"apartment": null,
"poBox": null,
"phone": "telephone",
"mobile": "mobile",
"email": "email",
"additionalAddressInfo": null,
"fax": null,
"externalId": null
},
"cartState": "ACTIVE",
"country": null,
"createdAt": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"zone": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"monthValue": 4,
"hour": 13,
"minute": 53,
"second": 34,
"nano": 48000000,
"year": 2019,
"month": "APRIL",
"dayOfMonth": 5,
"dayOfWeek": "FRIDAY",
"dayOfYear": 95,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"custom": null,
"customLineItems": [],
"customerEmail": null,
"customerGroup": null,
"customerId": null,
"deleteDaysAfterLastModification": null,
"discountCodes": [],
"id": "66d22d22-72e6-408a-bba7-3017376e836e",
"inventoryMode": "NONE",
"itemShippingAddresses": [],
"lastModifiedAt": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"zone": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"monthValue": 4,
"hour": 14,
"minute": 40,
"second": 54,
"nano": 370000000,
"year": 2019,
"month": "APRIL",
"dayOfMonth": 5,
"dayOfWeek": "FRIDAY",
"dayOfYear": 95,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"lineItems": [],
"locale": null,
"origin": "CUSTOMER",
"paymentInfo": null,
"refusedGifts": [],
"shippingAddress": {
"country": "GB",
"id": null,
"key": null,
"title": null,
"salutation": "salutation",
"firstName": null,
"lastName": null,
"streetName": "street_name",
"streetNumber": "street_number",
"additionalStreetInfo": null,
"postalCode": "postcode",
"city": "city",
"region": null,
"state": null,
"company": "company",
"department": null,
"building": null,
"apartment": null,
"poBox": null,
"phone": "telephone",
"mobile": "mobile",
"email": "email",
"additionalAddressInfo": null,
"fax": null,
"externalId": null
},
"shippingInfo": null,
"shippingRateInput": null,
"taxCalculationMode": "LINE_ITEM_LEVEL",
"taxMode": "PLATFORM",
"taxRoundingMode": "HALF_EVEN",
"taxedPrice": {
"totalNet": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": false,
"positiveOrZero": true,
"negativeOrZero": true,
"zero": true,
"negative": false,
"number": 0,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"totalGross": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": false,
"positiveOrZero": true,
"negativeOrZero": true,
"zero": true,
"negative": false,
"number": 0,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"taxPortions": []
},
"totalPrice": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": false,
"positiveOrZero": true,
"negativeOrZero": true,
"zero": true,
"negative": false,
"number": 0,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"version": 7
}
POST shipping methods
For Magento, sets the address for checkout and gets a list of shipping methods for a cart (make sure the cart has at least one item, otherwise empty is returned).
For commercetools, gets the shipping method for a cart by location and currency.
Parameters
Parameter | Description | Type | Data Type | Connector |
---|---|---|---|---|
|
required The definition name. |
|
|
commercetools Magento |
|
required The connection name. |
|
|
commercetools Magento |
|
required The JSON param for the address object. commercetools requires only the |
|
|
commercetools Magento |
|
required The ID for the checkout cart. |
|
|
commercetools Magento |
commercetools example
Returns a list of shipping methods.
curl --user 'superuser:superuser' --request POST "http://localhost:8080/magnoliaAuthor/.rest/ecommerce/v1/checkouts/shippingmethods/68228972-6676-4ee2-ada9-72aaa34e9f28?definitionName=commercetools&connectionName=connection" \ --header "Content-Type: application/json" \ --data "{ \"address\": { \"countryCode\": \"GB\", \"currencyCode\": \"EUR\" } }"
JSON response
[
{
"isDefault": true,
"createdAt": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"zone": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"monthValue": 6,
"hour": 11,
"minute": 27,
"second": 34,
"nano": 214000000,
"year": 2016,
"month": "JUNE",
"dayOfMonth": 3,
"dayOfWeek": "FRIDAY",
"dayOfYear": 155,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"description": "",
"id": "7774c752-64ad-4030-9a52-31d8d27f5943",
"key": null,
"lastModifiedAt": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"zone": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"monthValue": 6,
"hour": 14,
"minute": 40,
"second": 6,
"nano": 915000000,
"year": 2016,
"month": "JUNE",
"dayOfMonth": 3,
"dayOfWeek": "FRIDAY",
"dayOfYear": 155,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"name": "International Post",
"predicate": null,
"taxCategory": {
"typeId": "tax-category",
"id": "811d23c6-b08b-4036-b219-45e450fb27ff",
"key": null
},
"version": 4,
"zoneRates": [
{
"shippingRates": [
{
"isMatching": true,
"freeAbove": null,
"price": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 10,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"tiers": []
}
],
"zone": {
"typeId": "zone",
"id": "32ed1f48-89e6-4665-bc6e-0df3e1d80e67",
"key": null
}
}
],
"zones": [
{
"typeId": "zone",
"id": "32ed1f48-89e6-4665-bc6e-0df3e1d80e67",
"key": null
}
]
}
]
Magento example
Sets the checkout address as the United States and returns a list of shipping methods.
curl --user 'superuser:superuser' --request POST "http://localhost:8080/magnoliaAuthor/.rest/ecommerce/v1/checkouts/shippingmethods/19?definitionName=magento&connectionName=connection" --header "Content-Type: application/json" --data "{ \"address\": { \"country_id\": \"US\" } }"
JSON response
[
{
“carrier_code”: “flatrate”,
“method_code”: “flatrate”,
“carrier_title”: “Flat Rate”,
“method_title”: “Fixed”,
“amount”: 15,
“base_amount”: 15,
“available”: true,
“error_message”: “”,
“price_excl_tax”: 15,
“price_incl_tax”: 15
},
{
“carrier_code”: “tablerate”,
“method_code”: “bestway”,
“carrier_title”: “Best Way”,
“method_title”: “Table Rate”,
“amount”: 5,
“base_amount”: 5,
“available”: true,
“error_message”: “”,
“price_excl_tax”: 5,
“price_incl_tax”: 5
}
]
PUT shipping method
Returns the payment method and total amounts for the cart.
For commercetools, sets the shipping method for a cart and returns the cart with the shipping method.
Parameters
Parameter | Description | Type | Data Type | Connector |
---|---|---|---|---|
|
required The definition name. |
|
|
commercetools Magento |
|
required The connection name. |
|
|
commercetools Magento |
|
required The ID for the checkout cart. |
|
|
commercetools Magento |
|
required The JSON param for the |
|
|
For commercetools, only the commercetools Magento |
commercetools example
curl --user 'superuser:superuser' --request PUT "http://localhost:8080/magnoliaAuthor/.rest/ecommerce/v1/checkouts/shippingmethod/66d22d22-72e6-408a-bba7-3017376e836e?definitionName=commercetools&connectionName=connection" --header "Content-Type: application/json" --data "{ "addressInformation": { "shippingMethodId": "7774c752-64ad-4030-9a52-31d8d27f5943" } }"
JSON response
{
"anonymousId": "123",
"billingAddress": {
"country": "GB",
"id": null,
"key": null,
"title": null,
"salutation": "salutation",
"firstName": null,
"lastName": null,
"streetName": "street_name",
"streetNumber": "street_number",
"additionalStreetInfo": null,
"postalCode": "postcode",
"city": "city",
"region": null,
"state": null,
"company": "company",
"department": null,
"building": null,
"apartment": null,
"poBox": null,
"phone": "telephone",
"mobile": "mobile",
"email": "email",
"additionalAddressInfo": null,
"fax": null,
"externalId": null
},
"cartState": "ACTIVE",
"country": null,
"createdAt": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"zone": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"monthValue": 4,
"hour": 13,
"minute": 53,
"second": 34,
"nano": 48000000,
"year": 2019,
"month": "APRIL",
"dayOfMonth": 5,
"dayOfWeek": "FRIDAY",
"dayOfYear": 95,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"custom": null,
"customLineItems": [],
"customerEmail": null,
"customerGroup": null,
"customerId": null,
"deleteDaysAfterLastModification": null,
"discountCodes": [],
"id": "66d22d22-72e6-408a-bba7-3017376e836e",
"inventoryMode": "NONE",
"itemShippingAddresses": [],
"lastModifiedAt": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"zone": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"monthValue": 4,
"hour": 6,
"minute": 23,
"second": 3,
"nano": 316000000,
"year": 2019,
"month": "APRIL",
"dayOfMonth": 6,
"dayOfWeek": "SATURDAY",
"dayOfYear": 96,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"lineItems": [],
"locale": null,
"origin": "CUSTOMER",
"paymentInfo": null,
"refusedGifts": [],
"shippingAddress": {
"country": "GB",
"id": null,
"key": null,
"title": null,
"salutation": "salutation",
"firstName": null,
"lastName": null,
"streetName": "street_name",
"streetNumber": "street_number",
"additionalStreetInfo": null,
"postalCode": "postcode",
"city": "city",
"region": null,
"state": null,
"company": "company",
"department": null,
"building": null,
"apartment": null,
"poBox": null,
"phone": "telephone",
"mobile": "mobile",
"email": "email",
"additionalAddressInfo": null,
"fax": null,
"externalId": null
},
"shippingInfo": {
"discountedPrice": null,
"price": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 10,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"shippingMethod": {
"typeId": "shipping-method",
"id": "7774c752-64ad-4030-9a52-31d8d27f5943",
"key": null
},
"shippingMethodName": "International Post",
"shippingMethodState": "MATCHES_CART",
"shippingRate": {
"isMatching": null,
"freeAbove": null,
"price": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 10,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"tiers": []
},
"taxCategory": {
"typeId": "tax-category",
"id": "811d23c6-b08b-4036-b219-45e450fb27ff",
"key": null
},
"taxRate": {
"id": "6uHFNPNw",
"name": "standard",
"amount": 0.2,
"includedInPrice": true,
"country": "GB",
"state": null,
"subRates": []
},
"taxedPrice": {
"totalNet": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 8.33,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"totalGross": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 10,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"taxPortions": null
}
},
"shippingRateInput": null,
"taxCalculationMode": "LINE_ITEM_LEVEL",
"taxMode": "PLATFORM",
"taxRoundingMode": "HALF_EVEN",
"taxedPrice": {
"totalNet": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 8.33,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"totalGross": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 10,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"taxPortions": [
{
"rate": 0.2,
"amount": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 1.67,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"name": "standard"
}
]
},
"totalPrice": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 10,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"version": 11
}
Magento example
curl --user 'superuser:superuser' --request PUT "http://localhost:8080/magnoliaAuthor/.rest/ecommerce/v1/checkouts/shippingmethod/19?definitionName=magento&connectionName=connection" --header "Content-Type: application/json" --data "{ \"addressInformation\": { \“shipping_address\”: { \“country_id\”: \“US\”, \"firstname\": \"Jane\", \"lastname\": \"Doe\", \"city\": \"Purchase\", \"street\": [ \"123 Oak Ave\" ], \"telephone\": \"512-555-1111\", \"postcode\": \"10577\", \"region_id\": 43 }, \“billing_address\”: { \“country_id\”: \“US\”, \"firstname\": \"Jane\", \"lastname\": \"Doe\", \"city\": \"Purchase\", \"street\": [ \"123 Oak Ave\" ], \"telephone\": \"512-555-1111\", \"postcode\": \"10577\", \"region_id\": 43 }, \“shipping_carrier_code\”: \“flatrate\”, \“shipping_method_code\”: \“flatrate\” } }"
JSON response
{
“payment_methods”: [
{
“code”: “cashondelivery”,
“title”: “Cash On Delivery”
},
{
“code”: “banktransfer”,
“title”: “Bank Transfer Payment”
},
{
“code”: “purchaseorder”,
“title”: “Purchase Order”
},
{
“code”: “checkmo”,
“title”: “Check / Money order”
}
],
“totals”: {
“grand_total”: 165,
“base_grand_total”: 165,
“subtotal”: 160,
“base_subtotal”: 160,
“discount_amount”: 0,
“base_discount_amount”: 0,
“subtotal_with_discount”: 160,
“base_subtotal_with_discount”: 160,
“shipping_amount”: 5,
“base_shipping_amount”: 5,
...
}
}
POST an order
For Magento, creates an order and returns an orderId
.
For commercetools, creates and returns an order.
Parameters
Parameter | Description | Type | Data Type | Connector |
---|---|---|---|---|
|
required The definition name. |
|
|
commercetools Magento |
|
required The connection name. |
|
|
commercetools Magento |
|
required The ID for the checkout cart. |
|
|
commercetools Magento |
|
required (Magento only) The JSON param for the |
|
|
Magento |
commercetools example
curl --user 'superuser:superuser' --request POST "http://localhost:8080/magnoliaAuthor/.rest/ecommerce/v1/checkouts/order/66d22d22-72e6-408a-bba7-3017376e836e?definitionName=commercetools&connectionName=connection" \ --header "Content-Type: application/json"
JSON response
{
"anonymousId": "123",
"billingAddress": {
"country": "GB",
"id": null,
"key": null,
"title": null,
"salutation": "salutation",
"firstName": null,
"lastName": null,
"streetName": "street_name",
"streetNumber": "street_number",
"additionalStreetInfo": null,
"postalCode": "postcode",
"city": "city",
"region": null,
"state": null,
"company": "company",
"department": null,
"building": null,
"apartment": null,
"poBox": null,
"phone": "telephone",
"mobile": "mobile",
"email": "email",
"additionalAddressInfo": null,
"fax": null,
"externalId": null
},
"cart": {
"typeId": "cart",
"id": "66d22d22-72e6-408a-bba7-3017376e836e",
"key": null
},
"completedAt": null,
"country": null,
"createdAt": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"zone": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"monthValue": 4,
"hour": 6,
"minute": 59,
"second": 42,
"nano": 980000000,
"year": 2019,
"month": "APRIL",
"dayOfMonth": 6,
"dayOfWeek": "SATURDAY",
"dayOfYear": 96,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"custom": null,
"customLineItems": [],
"customerEmail": null,
"customerGroup": null,
"customerId": null,
"discountCodes": [],
"id": "025c7893-e01f-4489-bc19-f881d530eab6",
"inventoryMode": "NONE",
"itemShippingAddresses": [],
"lastMessageSequenceNumber": 1,
"lastModifiedAt": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"zone": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"monthValue": 4,
"hour": 6,
"minute": 59,
"second": 42,
"nano": 980000000,
"year": 2019,
"month": "APRIL",
"dayOfMonth": 6,
"dayOfWeek": "SATURDAY",
"dayOfYear": 96,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"lineItems": [
{
"custom": null,
"discountedPricePerQuantity": [],
"distributionChannel": null,
"id": "562beee0-5b45-4471-adb8-e69fc0e8373a",
"lineItemMode": "STANDARD",
"name": {
"en": "Paco Rabanne"
},
"price": {
"channel": null,
"country": null,
"custom": null,
"customerGroup": null,
"discounted": null,
"id": "93029315-3c55-4090-ae5a-68a02e35d507",
"tiers": null,
"validFrom": null,
"validUntil": null,
"value": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 72,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
}
},
"priceMode": "PLATFORM",
"productId": "84e64c7c-7f98-4a1c-af4a-e8cc2b7f483c",
"productSlug": {
"en": "paco-rabanne"
},
"productType": {
"typeId": "product-type",
"id": "495ab177-e063-43cc-87be-fdb216113274",
"key": null
},
"quantity": 5,
"shippingDetails": null,
"state": [
{
"state": {
"typeId": "state",
"id": "97211d7c-cf9f-4de8-885a-36f492163dfe",
"key": null
},
"quantity": 5
}
],
"supplyChannel": null,
"taxRate": {
"id": "6uHFNPNw",
"name": "standard",
"amount": 0.2,
"includedInPrice": true,
"country": "GB",
"state": null,
"subRates": []
},
"taxedPrice": {
"totalNet": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 300,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"totalGross": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 360,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"taxPortions": null
},
"totalPrice": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 360,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"variant": {
"assets": [],
"attributes": [
{
"name": "baseId",
"value": "624"
}
],
"availability": null,
"id": 1,
"images": [
{
"url": "https://55b04f920fa53a42249e-5110a72d79ca30656f0873e4e7b95dbe.ssl.cf3.rackcdn.com/paco-rabanne-olympea--SdfLcCO.jpg",
"dimensions": {
"w": 215,
"h": 251
},
"label": null
}
],
"key": "34",
"price": null,
"prices": [
{
"channel": null,
"country": null,
"custom": null,
"customerGroup": null,
"discounted": null,
"id": "93029315-3c55-4090-ae5a-68a02e35d507",
"tiers": null,
"validFrom": null,
"validUntil": null,
"value": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 72,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
}
}
],
"scopedPrice": null,
"sku": "12341234",
"isMatchingVariant": null,
"scopedPriceDiscounted": null
}
}
],
"locale": null,
"orderNumber": null,
"orderState": "OPEN",
"origin": "CUSTOMER",
"paymentInfo": null,
"paymentState": null,
"refusedGifts": [],
"returnInfo": [],
"shipmentState": null,
"shippingAddress": {
"country": "GB",
"id": null,
"key": null,
"title": null,
"salutation": "salutation",
"firstName": null,
"lastName": null,
"streetName": "street_name",
"streetNumber": "street_number",
"additionalStreetInfo": null,
"postalCode": "postcode",
"city": "city",
"region": null,
"state": null,
"company": "company",
"department": null,
"building": null,
"apartment": null,
"poBox": null,
"phone": "telephone",
"mobile": "mobile",
"email": "email",
"additionalAddressInfo": null,
"fax": null,
"externalId": null
},
"shippingInfo": {
"deliveries": [],
"discountedPrice": null,
"price": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 10,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"shippingMethod": {
"typeId": "shipping-method",
"id": "7774c752-64ad-4030-9a52-31d8d27f5943",
"key": null
},
"shippingMethodName": "International Post",
"shippingMethodState": "MATCHES_CART",
"shippingRate": {
"isMatching": null,
"freeAbove": null,
"price": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 10,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"tiers": []
},
"taxCategory": {
"typeId": "tax-category",
"id": "811d23c6-b08b-4036-b219-45e450fb27ff",
"key": null
},
"taxRate": {
"id": "6uHFNPNw",
"name": "standard",
"amount": 0.2,
"includedInPrice": true,
"country": "GB",
"state": null,
"subRates": []
},
"taxedPrice": {
"totalNet": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 8.33,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"totalGross": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 10,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"taxPortions": null
}
},
"shippingRateInput": null,
"state": null,
"syncInfo": [],
"taxCalculationMode": "LINE_ITEM_LEVEL",
"taxMode": "PLATFORM",
"taxRoundingMode": "HALF_EVEN",
"taxedPrice": {
"totalNet": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 308.33,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"totalGross": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 370,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"taxPortions": [
{
"rate": 0.2,
"amount": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 61.67,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"name": "standard"
}
]
},
"totalPrice": {
"factory": {
"defaultMonetaryContext": {
"fixedScale": false,
"maxScale": 63,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
},
"amountType": "org.javamoney.moneta.Money",
"maxNumber": null,
"minNumber": null,
"maximalMonetaryContext": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 0,
"empty": false,
"providerName": null
}
},
"context": {
"fixedScale": false,
"maxScale": -1,
"amountType": "org.javamoney.moneta.Money",
"precision": 256,
"empty": false,
"providerName": null
},
"positive": true,
"positiveOrZero": true,
"negativeOrZero": false,
"zero": false,
"negative": false,
"number": 370,
"currency": {
"context": {
"empty": false,
"providerName": "java.util.Currency"
},
"currencyCode": "EUR",
"defaultFractionDigits": 2,
"numericCode": 978
}
},
"version": 1
}
Magento example
Sets the payment method to checkmo
.
curl --user 'superuser:superuser' --request POST "http://localhost:8080/magnoliaAuthor/.rest/ecommerce/v1/checkouts/order/19?definitionName=magento&connectionName=connection" \
--header "Content-Type: application/json" \
--data "{
\"email\": \"test@gmail.com\",
\"paymentMethod\": {
\"method\": \"checkmo\"
}
}"
JSON response
A number representing the ID of the order (orderId
) that has been
created successfully.
+
8