last updated: 2024-09-06
Norce Commerce Services examples
Examples based on common practices
_Set testdata
Set PG - norce-open-demo
Method: GET
URL: https://{{apihost}}/commerce/metadata/1.1/GetApplication?format={{contentType}}&cultureCode={{contextCultureCode}}
Configuration data
Calls to Norce Commerce Metadata Service to fetch common configuration data.
This can be cached for a long time.
Get Application
Method: GET
URL: https://{{apihost}}/commerce/metadata/1.1/GetApplication?format={{contentType}}&cultureCode={{contextCultureCode}}
List Error messages
Method: GET
URL: https://{{apihost}}/commerce/metadata/1.1/ListErrorMessages?format={{contentType}}&cultureCode={{contextCultureCode}}
Products and Search
Examples on how to work with Product and Search using Norce Commerce Product Service
Getting metadata
Some examples on how to get metadata from the product catalog.
This is data that usuallys is cached and required where entities from Norce has id´s instead of more information on the specific fields.
List Warehouses
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListWarehouseInfo?format={{contentType}}&cultureCode={{contextCultureCode}}
List Statuses
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListStatuses?format={{contentType}}&cultureCode={{contextCultureCode}}
List Product Types
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListSkuTypes?format={{contentType}}&cultureCode={{contextCultureCode}}
List Price lists
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListPricelists?format={{contentType}}&cultureCode={{contextCultureCode}}
List Parametric Information
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListParametricInfo?format={{contentType}}&cultureCode={{contextCultureCode}}
List Parametric Values
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListParametricValues2?format={{contentType}}&cultureCode={{contextCultureCode}}
List Manufacturers
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListManufacturers?format={{contentType}}&searchString=&pageNo=1&pageSize={{contextPageSize}}&cultureCode={{contextCultureCode}}
List flags
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListFlags?format={{contentType}}&cultureCode={{contextCultureCode}}
List File types
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListFileTypeIds?format={{contentType}}&cultureCode={{contextCultureCode}}
List Categories
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListCategories?format={{contentType}}&cultureCode={{contextCultureCode}}
List Categories as a hierarchy
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListCategoryItems?format={{contentType}}&categoryStructureId=&level=&parentId=&cultureCode={{contextCultureCode}}
List Assortments
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListAssortments?format={{contentType}}&cultureCode={{contextCultureCode}}
List Product Relation types
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProductRelationTypes?format={{contentType}}&cultureCode={{contextCultureCode}}
Show Products
Examples when using Storm API for displaying Product pages, with or without variants and other functions.
Details
Some calls give more details on the product information.
GetProductOnhand information
Method: POST
URL: https://{{apihost}}/commerce/product/1.1/GetProductOnHandByPartNo?format={{contentType}}&partNo=100014&warehouses =&statusSeed={{contextStatusSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Headers:
Content-Type:application/json
Body:
[
{
"_comment": "Warehousecode: wh_strd_se and Locationcode: whl_strd_se",
"StoreId": null,
"WarehouseId": 4,
"LocationId": 4,
"OnHand": null
},
{
"_comment": "Warehousecode: wh_strd_no and Locationcode: wh_strd_no",
"StoreId": null,
"WarehouseId": 5,
"LocationId": 5,
"OnHand": null
},
{
"_comment": "Storecode: str_goth",
"StoreId": 2,
"WarehouseId": null,
"LocationId": null,
"OnHand": null
}
]
Quantity breaks
List Qty Break prices
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProductPriceQtyBreak?format={{contentType}}&id=26&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Get Product by UniqueName
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/GetProductByUniqueName?format={{contentType}}&uniqueName=husqvarna-branslefilter&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Get Product by PartNo
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/GetProductByPartNo?format={{contentType}}&partNo=100014&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Get Variants by UniqueName
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/GetProductByUniqueName?format={{contentType}}&uniqueName=blaklader-4949-softshelljacka&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Get Promotions on a Product by unique name
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListPromotionsByProductUniqueName?format={{contentType}}&uniqueName=husqvarna-branslefilter&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Get Promotions on a Product by ProductId
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListPromotionsByProductId?format={{contentType}}&id=26&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Get Relations on a product
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProductRelations?format={{contentType}}&productId=26&relationTypeSeed=&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&sort={{contextSortCode}}&size={{contextPageSize}}&asVariants=false&isForAllVariants=true&assortmentSeed=1
Update Product view count
Method: POST
URL: https://{{apihost}}/commerce/product/1.1/UpdateProductViewCount?format={{contentType}}
Body:
Form data:
categoryId: 23productId: 26
Listing and finding
Examples when using Norce Commerce Product Service for search and finding. Common on smaller and simpler product catalogs.
Search and Filter
ListProduct by category and status
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProducts2?format={{contentType}}&searchString=whatever&categorySeed=5&manufacturerSeed=&flagSeed=¶metrics=&assortmentSeed=1&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&sort={{contextSortCode}}&asVariants=false&pageNo=1&pageSize={{contextPageSize}}&filter=
ListProduct by category and status (drilling down on a specific filter)
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProducts2?format={{contentType}}&searchString=whatever&categorySeed=5&manufacturerSeed=&flagSeed=¶metrics=&assortmentSeed=1&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&sort={{contextSortCode}}&asVariants=false&pageNo=1&pageSize={{contextPageSize}}&filter=parf|L8_34
ListProductFilters by category and status
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProductFilters2?format={{contentType}}&searchString=whatever&categorySeed=5&manufacturerSeed=&flagSeed=¶metrics=&assortmentSeed=1&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&sort={{contextSortCode}}&asVariants=false&filter=
ListProductFilters by category and status (drilling down on a specific filter)
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProductFilters2?format={{contentType}}&searchString=whatever&categorySeed=5&manufacturerSeed=&flagSeed=¶metrics=&assortmentSeed=1&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&sort={{contextSortCode}}&asVariants=false&filter=parf|L8_34
List Products and working variant data
Examples showing different ways to work with variant information in product listings.
ListProduct with asVariant = true
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProducts2?format={{contentType}}&searchString=whatever&categorySeed=16&manufacturerSeed=&flagSeed=¶metrics=&assortmentSeed=1&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&sort={{contextSortCode}}&asVariants=true&pageNo=1&pageSize={{contextPageSize}}&filter=
ListProduct with asVariant = false
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProducts2?format={{contentType}}&searchString=whatever&categorySeed=16&manufacturerSeed=&flagSeed=¶metrics=&assortmentSeed=1&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&sort={{contextSortCode}}&asVariants=false&pageNo=1&pageSize={{contextPageSize}}&filter=
ListVariantItems
Method: POST
URL: https://{{apihost}}/commerce/product/1.1/ListVariantItems?format={{contentType}}¶metrics=&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&expand=Price, OnHand, OnHandStore&productIds=
Headers:
Content-Type:application/json
Body:
[
17
]
Paging and Sorting
List first 10 products with sort
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProducts2?format={{contentType}}&searchString=&categorySeed=5&manufacturerSeed=&flagSeed=¶metrics=&assortmentSeed=1&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}&sort={{contextSortCode}}&pageNo=1&pageSize={{contextPageSize}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&asVariants=false&filter=
List 2nd 10 products with sort
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProducts2?format={{contentType}}&searchString=&categorySeed=5&manufacturerSeed=&flagSeed=¶metrics=&assortmentSeed=1&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&sort={{contextSortCode}}&asVariants=false&pageNo=2&pageSize={{contextPageSize}}&filter=
Listing in suggestion box
Norce has a lite version of search, specially built for suggestions when writing in a search box.
Simple search for Suggestionbox
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/SearchProductsLite2?format={{contentType}}&searchString=hus&assortmentSeed=1&statusSeed={{contextStatusSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&size=5
Listing and finding, using external Search engine
Examples when using An esternal search engine, exporting data using Norce Commerce Product Feed.
Only using Norce Commerce Product Service for non-cachable additions.
ListProducts from Product Ids
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProductsByIds3?format={{contentType}}&idSeed=17,26,19&statusSeed ={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&sort={{contextSortCode}}&asVariants=false&returnAllVariants=false&filter=
Headers:
Content-Type:application/json
ListProductFilters from product ids
Method: GET
URL: https://{{apihost}}/commerce/product/1.1/ListProductFiltersByIds?format={{contentType}}&idSeed=17,26,19&statusSeed={{contextStatusSeed}}&storeSeed={{contextStoreSeed}}&pricelistSeed={{contextPriceListSeed}}&customerId={{contextCustomerId}}&companyId={{contextCompanyId}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&sort={{contextSortCode}}&asVariants=false
Shopping
Examples on how to work with Shopping processes using Norce [Storm] API
Getting metadata
Some examples on how to get metadata for the shopping experience.
List types of baskets
Method: GET
URL: https://{{apihost}}/commerce/shopping/1.1/ListBasketTypes?format={{contentType}}&cultureCode={{contextCultureCode}}
List statuses of baskets
Method: GET
URL: https://{{apihost}}/commerce/shopping/1.1/ListBasketStatuses?format={{contentType}}&cultureCode={{contextCultureCode}}
List basket info types
Method: GET
URL: https://{{apihost}}/commerce/shopping/1.1/ListBasketInfoTypes?format={{contentType}}&cultureCode={{contextCultureCode}}
List basket item info types
Method: GET
URL: https://{{apihost}}/commerce/shopping/1.1/ListBasketItemInfoTypes?format={{contentType}}&cultureCode={{contextCultureCode}}
List promotions
Method: GET
URL: https://{{apihost}}/commerce/shopping/1.1/ListPromotions?format={{contentType}}&excludeRequirementSeed=&cultureCode={{contextCultureCode}}
List Customer flags
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/ListCustomerFlags?format={{contentType}}&cultureCode={{contextCultureCode}}
List Company flags
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/ListCompanyFlags?format={{contentType}}&cultureCode={{contextCultureCode}}
List info type for Customers
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/ListCustomerInfoTypes?format={{contentType}}&cultureCode={{contextCultureCode}}
List info type for Companies
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/ListCompanyInfoTypes?format={{contentType}}&cultureCode={{contextCultureCode}}
Basket management
Create basket
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/CreateBasket?format={{contentType}}&basket=&ipAddress=127.0.0.1&createdBy={{userAccountId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Headers:
Content-Type:application/json
Body:
Create basket (from a basket entity)
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/CreateBasket?format={{contentType}}&basket=&ipAddress=127.0.0.1&createdBy={{userAccountId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Headers:
Content-Type:application/json
Body:
{
"_comment" : "This is a subset of all basket properties that is allowed to be updated or created directly. See api doc for details.",
"CustomerId": null,
"CompanyId": null,
"Comment": "This is my basket comment",
"OrderReference" : "This i my order reference",
"InvoiceReference" : "this is my invoice reference",
"PaymentMethodId" : 14,
"DeliveryMethodId" : 12,
"Items": [
{
"PartNo": "PRD0000024",
"Quantity": 2,
"Comment": "This is a basket item comment",
"PriceListId": 1,
"Info": [
{
"TypeId": 209,
"Value": "size1",
"Code": "SIZE"
},
{
"TypeId": 241,
"Value": "234er",
"Code": "234"
},
{
"TypeId": 95,
"Value": "95er",
"Code": null
}
]
}
],
"Info": [
{
"TypeId": 169,
"Value": "true",
"Code": "Demo"
},
{
"TypeId": 293,
"Value": "false",
"Code": "test"
}
]
}
Add to basket (one item)
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/InsertBasketItem?format={{contentType}}&basketid={{basketId}}&item=&createdBy={{userAccountId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Headers:
Content-Type:application/json
Body:
{
"PartNo": "{{testPartNo1}}",
"Quantity": 1,
"Comment": "This is a test",
"PriceListId": {{testPriceListId1}}
}
Add to basket (several items)
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/InsertBasketItems?format={{contentType}}&basketid={{basketId}}&items=&createdBy={{userAccountId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Headers:
Content-Type:application/json
Body:
[
{
"PartNo": "{{testPartNo1}}",
"Quantity": 1,
"Comment": "Another item",
"PriceListId": {{testPriceListId1}}
},
{
"PartNo": "{{testPartNo2}}",
"Quantity": 2,
"Comment": "An item with quantity 2",
"PriceListId": {{testPriceListId2}}
}
]
Get Basket
Method: GET
URL: https://{{apihost}}/commerce/shopping/1.1/GetBasket?format={{contentType}}&id={{basketId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Update a Basket
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/UpdateBasket2?format={{contentType}}&basket=&updatedBy={{userAccountId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Headers:
Content-Type:application/json
Body:
{
"Id": {{basketId}},
"StatusId": 3,
"Comment": "Trying to add a discount code, if it is saved on the basket it is applied.",
"OrderReference": "This is an order reference",
"DiscountCode": "I_AM_NEW_HERE",
"Info": [
{
"Value": "Adding additonal order info to the basket that must be passed to the ERP",
"Code": "bit_additionalorderinfo"
}
]
}
Update a basket item
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/UpdateBasketItem?format={{contentType}}&basketId={{basketId}}&item=&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Headers:
Content-Type:application/json
Body:
{
"_comment" : "a basket item update MUST have the row 'Id' from the database.",
"_comment_Id": 3,
"LineNo": "3",
"ParentLineNo": null,
"PartNo": "{{testPartNo2}}",
"_Price_comment" : "Use Price to set a manual price, and set IsPriceManual = true below.",
"PriceListId": {{testPriceListId2}},
"Price": null,
"Quantity": 3,
"Comment": "Changed quantity to 3 and added additional info",
"Info": [
{
"Value": "2024-06-01",
"Code": "bit_deliverydate"
}
],
"IsPriceManual": false
}
Delete basket item
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/DeleteBasketItem?format={{contentType}}&basketId={{basketId}}&lineNo=2&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Clear a basket
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/ClearBasket?format={{contentType}}&id={{basketId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Delete basket
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/DeleteBasket?format={{contentType}}&basketId={{basketId}}&updatedBy={{userAccountId}}
Checkout processes
Simple checkout process
This example shows the simplest workflow for a checkout process.
No bells or whistles. No psp payment.
Create basket
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/CreateBasket?format={{contentType}}&ipAddress=127.0.0.1&createdBy={{userAccountId}}&basket=
Headers:
Content-Type:application/json
Body:
Add to basket (several items)
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/InsertBasketItems?format={{contentType}}&basketid={{basketId}}&items=&createdBy={{userAccountId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Headers:
Content-Type:application/json
Body:
[
{
"PartNo": "{{testPartNo1}}",
"Quantity": 1,
"Comment": "Another item",
"PriceListId": {{testPriceListId1}}
},
{
"PartNo": "{{testPartNo2}}",
"Quantity": 2,
"Comment": "An item with quantity 2",
"PriceListId": {{testPriceListId2}}
}
]
Get Basket
Method: GET
URL: https://{{apihost}}/commerce/shopping/1.1/GetBasket?format={{contentType}}&id={{basketId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Get Checkout
Method: GET
URL: https://{{apihost}}/commerce/shopping/1.1/GetCheckout2?format={{contentType}}&basketId={{basketId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&dropPointSize=20
Update Buyer
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/UpdateBuyer2?format={{contentType}}&basketId={{basketId}}&updatedBy={{userAccountId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&dropPointSize=20&buyer=
Headers:
Content-Type:application/json
Body:
{
"_comment": "creating customer information on checkout, not an existing customer",
"Email": "anonymous@myprivateemail.se",
"FirstName": "Guest",
"LastName": "Customer",
"InvoiceAddress": {
"Line1": "Gueststreet 1",
"Line2": null,
"Zip": "12345",
"City": "GuestCity",
"Country": "Sweden"
}
}
Update ShipTo
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/UpdateShipTo2?format={{contentType}}&basketId={{basketId}}&updatedBy={{userAccountId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&dropPointSize=20&shipTo=
Headers:
Content-Type:application/json
Body:
{
"_comment": "update shipping address manually, not an existing customer",
"DeliveryAddresses": [
{
"CareOf": "Guest Customer",
"Line1": "SummerCottageStreet 1",
"Line2": null,
"Zip": "54321",
"City": "CountryVillage",
"Country": "Sweden",
"ShippingPhoneNumber": "12345678"
}
]
}
Update Delivery Method
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/UpdateDeliveryMethod3?format={{contentType}}&basketId={{basketId}}&deliveryMethodId=133&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&dropPointSize=20
Headers:
Content-Type:application/json
Update Payment Method
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/UpdatePaymentMethod2?format={{contentType}}&basketId={{basketId}}&paymentMethodId=14&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&dropPointSize=20
Purchase
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/Purchase?format={{contentType}}&ipAddress=127.0.0.1&basketId={{basketId}}&userAgent=Postman&pricelistSeed={{contextPriceListSeed}}&cultureCode={{contextCultureCode}}
Simple B2B Checkout process
A full checkout process for a B2B use case.
Create basket for B2B
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/CreateBasket?format={{contentType}}&ipAddress=127.0.0.1&createdBy={{userAccountId}}&basket=&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Body:
{
"_comment" : "To add information from the loged in customer and/or company you must add a template basket object in the body like this.",
"CustomerId": {{contextCustomerId}},
"CompanyId": {{contextCompanyId}},
"Comment": "An already logged in customer with a company object.",
"OrderReference" : "This i my order reference",
"InvoiceReference" : "this is my invoice reference",
"_PaymentMethodId" : "Setting the ERP invoice as default payment method",
"PaymentMethodId" : 14,
"_DeliveryMethodId" : "But no default delivery method",
"DeliveryMethodId" : null,
"_Items" : "No items, but could be added here directly.",
"Items": null
}
Add to basket (several items and with B2B price lists)
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/InsertBasketItems?format={{contentType}}&basketid={{basketId}}&items=&createdBy={{userAccountId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Body:
[
{
"ParentLineNo": null,
"PartNo": "{{testPartNo1}}",
"Quantity": 1,
"Comment": null,
"PriceListId": {{testPriceListId1}}
},
{
"ParentLineNo": null,
"PartNo": "{{testPartNo2}}",
"Quantity": 1,
"Comment": null,
"PriceListId": {{testPriceListId2}}
}
]
Get Checkout
Method: GET
URL: https://{{apihost}}/commerce/shopping/1.1/GetCheckout2?format={{contentType}}&basketId={{basketId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}
Get Customer with company addresses
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/GetCustomer?id={{contextCustomerId}}&format={{contentType}}
Update ShipTo to a non default saved shipping address
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/UpdateShipTo2?format={{contentType}}&basketId={{basketId}}&updatedBy={{userAccountId}}&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&shipTo=
Body:
{
"_comment" : "You can pass in the whole object from GetCustomer call, here we have removed some info for clarity",
"Id": {{contextCustomerId}},
"Companies": [
{
"Id": {{contextCompanyId}},
"Name": "Huge Ventures",
"_comment" : "To change delivery address to one saved on the company entity you need to remove the others from the list you get back from GetCustomer (or GetCompany), here the second address is the only past in. Cut and paste from 'GetCustomer with company addresses request' You can also change it before calling this request.",
"DeliveryAddresses": [
{
"Id": 17,
"CareOf": "Adding Careof before save",
"Line1": "Subsidiary street 1",
"Line2": null,
"Zip": "23456",
"City": "Gothenburg",
"CountryId": 1,
"Country": "Sweden",
"Region": null,
"IsValidated": false,
"GlobalLocationNo": null,
"ShippingPhoneNumber": null
}
],
"UseInvoiceAddressAsDeliveryAddress": false
}
]
}
Update Delivery Method Copy
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/UpdateDeliveryMethod3?format={{contentType}}&basketId={{basketId}}&deliveryMethodId=3&pricelistSeed={{contextPriceListSeed}}¤cyId={{contextCurrencyId}}&cultureCode={{contextCultureCode}}&dropPointSize=20
Headers:
Content-Type:application/json
Purchase
Method: POST
URL: https://{{apihost}}/commerce/shopping/1.1/Purchase?format={{contentType}}&ipAddress=127.0.0.1&basketId={{basketId}}&userAgent=Postman&pricelistSeed={{contextPriceListSeed}}&cultureCode={{contextCultureCode}}
Customer Accounts and Login
Getting Metadata
List Account roles
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/ListAccountRoles?format={{contentType}}&cultureCode={{contextCultureCode}}
Authentiation using Storm API
Change and Forgotten password
Get a customer by email
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/GetCustomerByEmail?format={{contentType}}&email=janedoe@myprivateemail.se&cultureCode={{contextCultureCode}}
Update Customer
Method: POST
URL: https://{{apihost}}/commerce/customer/1.1/UpdateCustomer3?format={{contentType}}&password=Initialpassword&doSendMail=false&updatedBy={{userAccountId}}&cultureCode={{contextCultureCode}}
Headers:
Content-Type:application/json
Body:
{
"Id": 6,
"Key": "97e22f26-61e6-465a-8e4b-6a95363c8eea",
"Code": null,
"Email": "janedoe@myprivateemail.se",
"FirstName": "Jane",
"LastName": "Doe",
"CellPhone": "123456-11",
"_comment_DeliveryAddresses": "If you want to copy and paste a invoice address to a delivery address remove Address:'Id', the id will move the address record, not copy it.",
"DeliveryAddresses": [
{
"CareOf": "Delivery",
"Line1": "Firststreet 1",
"Line2": null,
"Zip": "123 45",
"City": "Stockholm",
"CountryId": 1,
"Country": "Sweden",
"Region": null,
"IsValidated": false,
"GlobalLocationNo": null,
"ShippingPhoneNumber": "123456-11"
}
],
"InvoiceAddress": {
"CareOf": "Invoicing",
"Line1": "Firststreet 1",
"Line2": null,
"Zip": "123 45",
"City": "Stockholm",
"CountryId": 1,
"Country": "Sweden",
"Region": null,
"IsValidated": false,
"GlobalLocationNo": null
},
"Flags": [
{
"Id": 7,
"Name": "Clothes Products",
"Group": 2,
"IsSelected": false
},
{
"Id": 6,
"Name": "Machine product",
"Group": 2,
"IsSelected": true
}
],
"Info": [
{
"Id": 2,
"Value": "Updated from Norce Services",
"Code": "cuit_description"
}
]
}
Register Customer
Method: POST
URL: https://{{apihost}}/commerce/customer/1.1/RegisterCustomer3?format={{contentType}}&password=Initialpassword&doSendMail=false&updatedBy={{userAccountId}}&cultureCode={{contextCultureCode}}&customer=
Headers:
Content-Type:application/json
Body:
{
"_comment": "creates or updates the customer, matches on email or code",
"Email": "bildo@hobbiton.se",
"FirstName": "Bilbo",
"LastName": "Baggins",
"CellPhone": "123456-11",
"Account": {
"LoginName": "Bilbobaggins1",
"Name": "Bilbo Baggins",
"Roles": [
6
],
"IsActive": true
}
}
Validate a Login try (success)
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/Login?format={{contentType}}&loginName=JaneDoe&password=Initialpassword&cultureCode={{contextCultureCode}}
Validate a Login try (fail)
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/Login?format={{contentType}}&loginName=JaneDoe&password=WrongPassword&cultureCode={{contextCultureCode}}
Validate an account (success)
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/GetCustomerByAccountId?format={{contentType}}&accountId=5&cultureCode={{contextCultureCode}}
Validate an account (fail)
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/GetCustomerByAccountId?format={{contentType}}&accountId=0&cultureCode={{contextCultureCode}}
Customers
Create Customers
Some different ways to create customers, with or without accounts, companies, etc.
The two ways to create customers are with the method CreateCustomer and RegisterCustomer, the latter are more forgiving and lets you send in customers that already exists and update it with the information you provide. The former will throw exception in those cases.
Register Customer with address info
Method: POST
URL: https://{{apihost}}/commerce/customer/1.1/RegisterCustomer3?format={{contentType}}&password=InitialPassword&doSendMail=false&updatedBy={{userAccountId}}&cultureCode={{contextCultureCode}}&customer=
Headers:
Content-Type:application/json
Body:
{
"Id": 6,
"Key": "97e22f26-61e6-465a-8e4b-6a95363c8eea",
"Code": null,
"Email": "janedoe@myprivateemail.se",
"FirstName": "Jane",
"LastName": "Doe",
"CellPhone": "123456-11",
"_comment_DeliveryAddresses": "If you want to copy and paste a invoice address to a delivery address remove Address:'Id', the id will move the address record, not copy it.",
"DeliveryAddresses": [
{
"CareOf": "Delivery",
"Line1": "Firststreet 1",
"Line2": null,
"Zip": "123 45",
"City": "Stockholm",
"CountryId": 1,
"Country": "Sweden",
"Region": null,
"IsValidated": false,
"GlobalLocationNo": null,
"ShippingPhoneNumber": "123456-11"
}
],
"InvoiceAddress": {
"CareOf": "Invoicing",
"Line1": "Firststreet 1",
"Line2": null,
"Zip": "123 45",
"City": "Stockholm",
"CountryId": 1,
"Country": "Sweden",
"Region": null,
"IsValidated": false,
"GlobalLocationNo": null
},
"Flags": [
{
"Id": 7,
"Name": "Clothes Products",
"Group": 2,
"IsSelected": false
},
{
"Id": 6,
"Name": "Machine product",
"Group": 2,
"IsSelected": true
}
],
"Info": [
{
"Id": 2,
"Value": "Updated from Norce Services",
"Code": "cuit_description"
}
]
}
Create a Customer with link to a company
Method: POST
URL: https://{{apihost}}/commerce/customer/1.1/CreateCustomer3?format={{contentType}}&password=InitialPassword&doSendMail=false&createdBy={{userAccountId}}&cultureCode={{contextCultureCode}}&customer=
Headers:
Content-Type:application/json
Body:
{
"_comment": "A new contact with login that should be added to an existing company, if customer already exist, use UpdateCustomer3",
"Email": "adamwarlock@hugeventures.se",
"FirstName": "Adam",
"LastName": "Warlock",
"CellPhone": "654321",
"Account": {
"LoginName": "AdamWarlock",
"Name": "Adam Warlock",
"_comment_Roles": "In PG Demo - Buyer: 13, Approver: 12, Guest: 11, Restricted User: 6, see 'ListAccountRoles' for other clients",
"Roles": [
11
],
"Authorizations": [],
"IsActive": true
},
"Companies": [
{
"_comment": "Only id and name is needed to set the link to an existing company",
"Id": 6,
"Name": "Norce AB"
}
]
}
Change Customers
Different ways to change data on a customer
Customer activation
InactivateCustomer and ActivateCustomer makes it so that the account associated with this customer are not able to login. The GetCustomer methods will not reply with any data for a customer that is inactivated.
After a preset time an inactive customer is removed and forgotten in Norce.
(This is a time set in Admin Settings for the client.)
####### Inactivate a Customer
Method: POST
URL: https://{{apihost}}/commerce/customer/1.1/InactivateCustomer?format={{contentType}}&customerId=7&inactivatedBy={{userAccountId}}
####### Re-Activate a Customer
Method: POST
URL: https://{{apihost}}/commerce/customer/1.1/ActivateCustomer?format={{contentType}}&customerId=7&activatedBy={{userAccountId}}
Update a customer
Method: POST
URL: https://{{apihost}}/commerce/customer/1.1/UpdateCustomer3?format={{contentType}}&password=Initialpassword&doSendMail=false&updatedBy={{userAccountId}}&cultureCode={{contextCultureCode}}
Headers:
Content-Type:application/json
Body:
{
"_comment": "Update CellPhone on existing customer",
"Id": 6,
"Email": "janedoe@myprivateemail.se",
"FirstName": "Jane",
"LastName": "Doe",
"CellPhone": "123456-99"
}
Get a Customer from Code
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/GetCustomerByCode?format={{contentType}}&code=TestCustomerCode01&cultureCode={{contextCultureCode}}
Get a Customer from email
Method: GET
URL: https://{{apihost}}/commerce/customer/1.1/GetCustomerByEmail?format={{contentType}}&email=johndoe@hugeventures.se&cultureCode={{contextCultureCode}}
Companies
Create a Company
There is no CreateCompany method, but you can create company together with a customer update or a customer creation.
Use CreateCustomer (to create both a customer and a company) Use UpdateCustomer (when you want to add a new company to an existing customer) Use RegisterCustomer (when you dont know if the customer already exists and the company is created at the same time)
Create Customer with a new Company (TBD)
Method: GET
URL: ``
Update Customer with a new Company (TBD)
Method: GET
URL: ``
Register Customer with a new Company (TBD)
Method: GET
URL: ``
Change Companies
UpdateCompany change information on companies. But will not remove associations to other collections, like addresses, delivery notes, flags or info fields.
Use DeleteCompanyDeliveryMethod, DeleteCompanyPaymentMethod to specifically remove associations to those collections.
Use InactivateCompany to remove a company. This will not delete the customers linked to the company.
Update a Company (TBD)
Method: GET
URL: ``
Delete CompanyCustomer (TBD)
Method: GET
URL: ``
Delete DeliveryMethod (TBD)
Method: GET
URL: ``
Inactivate a Company (TBD)
Method: GET
URL: ``
Get a Company from Code (TBD)
Method: GET
URL: ``
Get a Company from OrgNo (TBD)
Method: GET
URL: ``
Create, add or update a Customer for the Company (TBD)
Method: GET
URL: ``