Hi again,
We thought it would be helpful with some recreational steps to how we're using the endpoints.
1. create cart with POST "/dwapi/ecommerce/carts?CurrencyCode=DKK&CountryCode=DK&LanguageId=LANG1"
2. add product with POST "/dwapi/ecommerce/carts/{secret}/items" with the body:
{
"ProductId": "{insert product id}",
"Quantity": 1
}
3. create order with POST "/dwapi/ecommerce/carts/{secret}/createorder" with the body of the cart
Also here's how the cart information we're trying to post to it looks like:
We have tried setting a ShopId to SHOP1 and set Completed to true, with no luck so far.
{
"Id": "CART17817",
"SecondaryUserName": "",
"Secret": "d114a85921a64361b326532e517e0df0",
"VoucherCode": "",
"CreatedAt": "2022-01-14T08:50:50.1683277+01:00",
"Modified": "2022-01-14T08:58:56.0245688+01:00",
"Completed": false,
"IntegrationOrderId": "",
"RecurringOrderId": 0,
"CustomerUserId": 33119,
"CustomerNumber": "100083",
"CustomerCompany": "Test company",
"CustomerTitle": "",
"CustomerName": "Test name",
"CustomerFirstName": "",
"CustomerSurname": "",
"CustomerMiddleName": "",
"CustomerHouseNumber": "",
"CustomerAddress": "Test address 12",
"CustomerAddress2": "",
"CustomerZip": "4621",
"CustomerCity": "GADSTRUP",
"CustomerCountry": "Denmark",
"CustomerCountryCode": "DK",
"CustomerRegion": "",
"CustomerPhone": "*",
"CustomerEmail": "test@test.com",
"CustomerCell": "",
"CustomerAccepted": false,
"OrderLines": [
{
"Id": "OL306935",
"ProductId": "72459",
"ProductLanguageId": "LANG1",
"ProductName": "SAVAGE MINNOW TAIL80 8CM 6G BLUE PEARL SILVER 5PCS",
"ProductNumber": "72459",
"ProductImage": "/Files/Images/missing_image.jpg",
"PrimaryOrDefaultGroup": {},
"Quantity": 1.0,
"OrderLineFields": {},
"Price": {
"Price": 10.38,
"PriceFormatted": "kr. 10.38",
"PriceWithoutVat": 10.38,
"PriceWithoutVatFormatted": "kr. 10.38",
"PriceWithVat": 12.98,
"PriceWithVatFormatted": "kr. 12.98",
"Vat": 2.6,
"VatFormatted": "kr. 2.60",
"VATPercent": 25.0,
"VATPercentFormatted": "25%",
"CurrencyCode": "EUR"
},
"UnitPrice": {
"Price": 10.38,
"PriceFormatted": "kr. 10.38",
"PriceWithoutVat": 10.38,
"PriceWithoutVatFormatted": "kr. 10.38",
"PriceWithVat": 12.98,
"PriceWithVatFormatted": "kr. 12.98",
"Vat": 2.6,
"VatFormatted": "kr. 2.60",
"VATPercent": 25.0,
"VATPercentFormatted": "25%",
"CurrencyCode": "EUR"
},
"UnitPriceBeforeDiscount": {
"PriceFormatted": "kr. 0.00",
"PriceWithoutVatFormatted": "kr. 0.00",
"PriceWithVatFormatted": "kr. 0.00",
"VatFormatted": "kr. 0.00",
"VATPercent": 25.0,
"VATPercentFormatted": "25%",
"CurrencyCode": "EUR"
},
"TotalDiscount": {
"PriceFormatted": "kr. 0.00",
"PriceWithoutVatFormatted": "kr. 0.00",
"PriceWithVatFormatted": "kr. 0.00",
"VatFormatted": "kr. 0.00",
"VATPercentFormatted": "0%",
"CurrencyCode": "EUR"
}
}
],
"OrderFields": {
"SpAxOrderStatus": {
"SystemName": "SpAxOrderStatus",
"Name": "Order status",
"Type": "Text(255)"
},
"SpAxIsAxOrder": {
"SystemName": "SpAxIsAxOrder",
"Name": "Order is from AX",
"Type": "Checkbox"
},
"AXMiscFee": {
"SystemName": "AXMiscFee",
"Name": "AXMiscellaneousFee",
"Type": ""
},
"AXMiscText": {
"SystemName": "AXMiscText",
"Name": "AXMiscellaneousText",
"Type": ""
},
"AXDeliveryFee": {
"SystemName": "AXDeliveryFee",
"Name": "AXDeliveryFee",
"Type": ""
},
"AXTotalDiscount": {
"SystemName": "AXTotalDiscount",
"Name": "AXTotalDiscount",
"Type": ""
},
"AXDeliveryFeeTax": {
"SystemName": "AXDeliveryFeeTax",
"Name": "AXDeliveryFeeTax",
"Type": ""
},
"AXVoucherDisc": {
"SystemName": "AXVoucherDisc",
"Name": "AXVoucherDisc",
"Type": ""
},
"SpAxFirstAvailableDeliveryDate": {
"SystemName": "SpAxFirstAvailableDeliveryDate",
"Name": "First available delivery date",
"Type": "Date"
},
"SpAxChosenDeliveryDate": {
"SystemName": "SpAxChosenDeliveryDate",
"Name": "Chosen delivery date",
"Type": "Date"
},
"SpAxLastKnownVoucherValue": {
"SystemName": "SpAxLastKnownVoucherValue",
"Name": "Last known voucher value",
"Type": "Text(255)"
},
"SpGeneratedQuote": {
"SystemName": "SpGeneratedQuote",
"Name": "Sp generated quote",
"Type": "Checkbox"
},
"SpAxDWOrderId": {
"SystemName": "SpAxDWOrderId",
"Name": "Order Id from AX",
"Type": "Text(50)"
},
"SpAxIsJustImported": {
"SystemName": "SpAxIsJustImported",
"Name": "Order just imported from AX",
"Type": "Checkbox"
}
},
"TotalDiscount": {
"PriceFormatted": "kr. 0.00",
"PriceWithoutVatFormatted": "kr. 0.00",
"PriceWithVatFormatted": "kr. 0.00",
"VatFormatted": "kr. 0.00",
"VATPercentFormatted": "0%",
"CurrencyCode": "EUR"
},
"TotalProductDiscount": {
"PriceFormatted": "kr. 0.00",
"PriceWithoutVatFormatted": "kr. 0.00",
"PriceWithVatFormatted": "kr. 0.00",
"VatFormatted": "kr. 0.00",
"VATPercentFormatted": "0%",
"CurrencyCode": "EUR"
},
"TotalOrderDiscount": {
"PriceFormatted": "kr. 0.00",
"PriceWithoutVatFormatted": "kr. 0.00",
"PriceWithVatFormatted": "kr. 0.00",
"VatFormatted": "kr. 0.00",
"VATPercentFormatted": "0%",
"CurrencyCode": "EUR"
},
"Price": {
"Price": 87.38,
"PriceFormatted": "kr. 87.38",
"PriceWithoutVat": 87.38,
"PriceWithoutVatFormatted": "kr. 87.38",
"PriceWithVat": 89.98,
"PriceWithVatFormatted": "kr. 89.98",
"Vat": 2.6,
"VatFormatted": "kr. 2.60",
"VATPercent": 2.9755092698558023,
"VATPercentFormatted": "2.98%",
"CurrencyCode": "EUR"
},
"PriceBeforeFees": {
"Price": 10.38,
"PriceFormatted": "kr. 10.38",
"PriceWithoutVat": 10.38,
"PriceWithoutVatFormatted": "kr. 10.38",
"PriceWithVat": 12.98,
"PriceWithVatFormatted": "kr. 12.98",
"Vat": 2.6,
"VatFormatted": "kr. 2.60",
"VATPercent": 25.0,
"VATPercentFormatted": "25%",
"CurrencyCode": "EUR"
},
"TotalPriceBeforeFeesAndTaxes": {
"Price": 10.379999999999995,
"PriceFormatted": "kr. 10.38",
"PriceWithoutVat": 10.379999999999995,
"PriceWithoutVatFormatted": "kr. 10.38",
"PriceWithVat": 12.980000000000004,
"PriceWithVatFormatted": "kr. 12.98",
"Vat": 2.6,
"VatFormatted": "kr. 2.60",
"VATPercent": 25.04816955684009,
"VATPercentFormatted": "25.05%",
"CurrencyCode": "EUR"
},
"TotalTaxes": {
"PriceFormatted": "kr. 0.00",
"PriceWithoutVatFormatted": "kr. 0.00",
"PriceWithVatFormatted": "kr. 0.00",
"VatFormatted": "kr. 0.00",
"VATPercentFormatted": "0%",
"CurrencyCode": "EUR"
},
"ShippingFee": {
"PriceFormatted": "kr. 0.00",
"PriceWithoutVatFormatted": "kr. 0.00",
"PriceWithVatFormatted": "kr. 0.00",
"VatFormatted": "kr. 0.00",
"VATPercentFormatted": "0%",
"CurrencyCode": "EUR"
},
"PaymentMethod": {
"Id": "PAY3",
"Name": "Invoice",
"Description": "",
"Icon": "",
"Code": "",
"TermsCode": "",
"TermsDescription": ""
},
"PaymentFee": {
"Price": 77.0,
"PriceFormatted": "kr. 77.00",
"PriceWithoutVat": 77.0,
"PriceWithoutVatFormatted": "kr. 77.00",
"PriceWithVat": 77.0,
"PriceWithVatFormatted": "kr. 77.00",
"VatFormatted": "kr. 0.00",
"VATPercentFormatted": "0%",
"CurrencyCode": "EUR"
}
}
Best regards,
Mikkel