4WS Suite
Home
API Reference
  • Data mangement API
  • Documents API
Home
API Reference
  • Data mangement API
  • Documents API
Fourwayshop
  1. Missed Opportunity
  • Four Way Shop API
  • Before start develop
  • Why we use Resource-oriented design
  • Technical Prerequisites
  • Concepts
    • Date Handling
    • Managing Languages
    • Handling Field Updates and Null Values in Service Requests
    • ISO Code
    • Vat rates
    • Product structure
    • Product Images
    • Product dimensions
    • Product pricing
    • Dimension group vs Dimension grouping
    • Subjects overview
    • Documents structure
  • Best Practices
    • Best Practices for Error Handling in External System
    • How Testing callback response
    • Best Practices for delopers
  • Data management
    • Authentication
    • Rate Limits
    • Paginated Responses
    • Getting Started
    • API Changelog
    • Use cases
      • Cataloging a Dimension
      • Creating a New Product
      • Retriving a product details
      • Defining Product Pricing
      • Updating External System Product Catalog
      • Activate product variants and add barcodes to SKUs
      • Move a Barcode from One Product to Another
    • API
      • Login
        • login
      • Product
        • Brand
          • Get All Brands
          • Get A Brand
          • Insert brand
          • Update brand
        • Season
          • Get All Seasons
          • Get A Season
          • Insert season
          • Update season
        • Attribute
          • Get All Attribute Types
          • Get Attribute Type
          • Get Attribute
          • Insert attribute
          • Update attribute
        • Hierarchy
          • Insert hierarchy
          • Update hierarchy
        • Dimension groups
          • Insert dimension group
          • Update dimension group
        • Dimension
          • Insert dimension
          • Update dimension
          • Delete dimension
        • Product
          • Get products
          • Get product
          • Get product grouping
          • Get SKU's barcodes
          • Get product stock
          • Insert product
          • Update product
        • Activate dimensions on products
          • Insert active dimensions
          • Delete active dimensions
        • Barcode
          • Get SKU from barcode
          • Generate missing barcodes
          • Generate missing barcode for SKU
          • Insert barcode
          • Delete barcode
        • Prices
          • Get product prices
        • Price dimension groupings
          • Get Dimension Price Grouping
          • Get All Dimension Price Grouping
          • Insert dimension grouping
          • Update dimension grouping
          • Delete dimension grouping
        • Assortment
          • insert product assortment
          • delete product assortment
        • Image
          • Get images
          • Add image
          • Replace image
          • Delete image
        • Supplier
          • Get Item suppliers
          • Insert item supplier
          • Delete item supplier
          • Update item supplier
        • Custom category
          • Get Custom code
          • Insert Custom code
          • Update Custom code
        • Vat
          • Vat types
            • Get VAT type
            • Get VAT types
          • VATs
            • Get VATs
            • Get VATs by type
            • Get VAT
          • Vat rates
            • Get VAT rates
            • Get single VAT rates
        • Stock
          • Insert stock
          • Get stock
      • Price lists
        • Get price lists
        • Get price lists by type
        • Get price list
        • Get prices from price list
        • Get entities from price lists
        • Insert Price List
        • Insert Product Price
        • Insert Entity On Price Lists
        • Update price list
        • Delete all product prices
        • Delete single product price
        • Delete entity from a price lists
      • Supplier
        • Supplier contacts
        • Supplier addresses
        • Get Suppliers
        • Get A Specific Supplier
        • Insert supplier
        • Update supplier
      • Entities
        • Get entities
        • Get entity
        • Insert entity
        • Update entity
      • Miscellaneous
        • Get requests rate limits
      • Catalog
        • Get Catalogs details
        • Get Catalog details by Code
        • Get products by Catalog Code
      • Export
        • Get bulk CSV Export
  • Documents
    • Authentication
    • Paginated responses
    • Managing API Callbacks
    • Document notifications
    • Customer promo data notifications
    • Use cases
      • Updating External System Stock
      • E-commerce Recipt Processing
      • E-commerce Return Receipt Processing
      • E-commerce Order sale Processing
      • E-commerce Return Order Processing
      • E-commerce Order Handling and Internal Stock Transfer
      • E-commerce & Gift Card
      • Creating a free entry
      • Retrieving a Document by Identifier
      • Cart Validation Service
      • Sale and Shipping costs
      • Handling Line Item Discounts
      • Managing Price Forcing in Cart Items
      • Purchase Order Registration
      • Supplier Goods Entry From Purchase Order
      • Update an Orchestrated Order
      • New Orchestrated Return Orders
    • API
      • Document Manager
        • Orders
          • Save Sale Order
          • Save Return Order
        • Orchestrated Orders
          • Orchestrated Order
          • Orchestrated Return order
          • Orchestrated Update order
        • Cart
          • Cart Validation
          • Cart Full Validation
        • Sales
          • Save receipt
          • Salve only Order
          • Replace or update sale
          • Get last digital order
        • Warehouse
          • Save Entry from supplier
          • Save Transfer document
          • Save Free Entry
        • Purchase
          • Save Purchase
        • Get Document
        • Update Document external references
      • Customer
        • Get Customer
        • Set Customer Opt-in
      • Loyalty vouchers
        • Get customer loyalty vouchers
        • Get loyalty vouchers at a time interval
        • Get last loyalty vouchers
      • Giftcard
        • Get Giftcard
        • Update Giftcard
        • Generate Gift Card Barcode
        • Gift Card PDF Generation
      • Stock
        • Get Stock
        • Get last stock
        • Insert Stock
  • 🚫 KeepIT
    • Authentication
    • Use cases
    • Articles (deprecated)
      • Get Articles
      • Insert/Update dimensional groups
      • Insert/Update price groupings
      • Insert/Update dimensions
      • Insert/Update attributes
      • Insert/Update hieararchies
      • Insert/Update seasons
      • Insert/Update articles
      • Insert/Update Articles Master data
      • Insert/Update Lists
      • Insert/Update Dimensions Groups
      • Create EAN13 barcode
      • Insert/Update Barcode
      • Assign dimensions to groupings
    • Price Lists (deprecated)
      • Insert price list
      • Add entity to price list
      • Add item price to price list
      • Insert sale profile
      • Insert sale period
      • Add item price to sale period
    • Stock (deprecated)
      • Get Stock
      • Get Stock Date
      • Get Stock CSV
      • Insert/Update Stock
    • Sales (deprecated)
      • Insert/Update sales
      • Delete sales
      • Upload printer sales archive
    • Deposit (deprecated)
      • Insert/Update deposits
    • Services
      • Insert/Update services
      • Delete services
    • Points
      • Insert/Update points
      • Calculate and Insert/Update Points
      • Delete points
    • Subjects
      • Check customers
      • Anonymize customers
      • Get subject data
      • Get customer discount
      • Insert/Update customer
      • Insert/Update billing customers
      • Insert/Update CRM customer
      • Insert/Update children
      • Change/Replacement card
      • Insert CRM user
    • Giftcards & Vouchers
      • Get giftcard
      • Insert/Update giftcards
      • Insert/Update Vouchers
    • Missed Opportunity
      • Get Lost Opportunities
        GET
      • Insert/Update missed opportunities
        POST
      • Delete missed opportunity
        POST
    • Documents (deprecated)
      • Insert documents
      • Get document
    • Catalogs
      • Get Catalog
      • Insert/update catalog
      • Insert/Update hierarchies item catalog
      • Insert/Update entity clusters
    • Suppliers (deprecated)
      • Insert/Update tailor
      • Insert/Update supplier
    • Export (deprecated)
      • Get Items Export
      • Get Barcodes Export
      • Get Prices Export
      • Get Customers Export
      • Get Suppliers Export
      • Get Sales Export
      • Get Movements Export
      • Get Vouchers Export
    • Configuration Mobile Shop (deprecated)
      • Insert/Update Entities
      • Insert Seller
    • Mappings
      • Insert Mappings
      • Get Mappings
  1. Missed Opportunity

Insert/Update missed opportunities

POST
/api
Last modified:2024-08-14 15:39:53
To insert one or more missed opportunities, it's necessary to make a POST call, passing a JSON body as specified below.
The web service response will be composed of:
success: Boolean that indicated wether the request was successful or not
code : HTTP Code for the response
200 means the request was correctly processed
204 means a duplicate record was found in KeepIT, and that no insertion was performed
206 means that not all records were inserted or processed
400 means that the request body is invalid or contains syntax errors
500 means a server error has happened
message: response message for the request (e.g. "Insertion successful" or "Missing required parameter")
errorObjects: Array that contains the objects that caused errors when processed
entityCode : store code specified in the JSON request
documentDate : document date specified in the JSON request
refDocument: reference document specified in the JSON request
insertedObjects: Array that contains the correctly processed objects
progId: identifier for the inserted object
This is the list of fields that can be passed in the request body:
FieldDescriptionTypeMandatory
missedOpportunity
Array of missed opportunities objecs

See below for the the object structure
To update an attribute also specify the progId, which is the identifier for the attribute. If not specified, a new missed opportunity will be created
✓
To specify the loyal customer who marked the missed opportunity, the field `subjectCard` must be set or, alternatively, the customer email in the field `subjectEmail`.
To specift the employee who caught the missed opportunity set the field vendorCode.
The field itemCode refer to the article code of some articles that must be already set in KeepIT when the report occurs.
missedOpportunity structure
FieldDescriptionTypeMandatory
missedOpportunityType
Type of the missed opportunity. (referenced on the master table)
Varchar(250)
✓
opportunityDate
Date of the missed opportunity
Date
✓
itemCode
Code of the product
Varchar(250)
itemDescription
Description of the product
Varchar(250)
barcode
Barcode of the SKU
Varchar(250)
origHierarchyLevel1 to origHierarchyLevel10
Description of the hierarchy level of the product if specified
Varchar(250)
origAttributeLevel1 to origAttributeLevel10
Description of the attributes of the product if specified
Varchar(250)
origDimension1 to origDimension5
Description of the dimensions of the product if specified (color, size etc.)
Varchar(250)
hierarchyLevel1 to hierarchyLevel10
Description of the hierarchy of the product requested by the customer
Varchar(250)
attributeLevel1 to attributeLevel10
Description of the attributes of the product requested by the customer
Varchar(250)
dimension1 to dimension5
Description of the dimensions of the product requested by the customer (color, size etc.)
Varchar(250)
note
Note for the missed opportunity
Varchar(2048)
subjectCard
Card barcode of the customer
Varchar(250)
vendorCode
Code of the vendor
Varchar(250)
itemCode1
Code of the product if specified
Varchar(250)
Response example
{
    "success": true,
    "code": 200,
    "message": "Inserimento/Update riuscito con successo.",
    "errorObjects": [
    ],
    "insertedObjects": [
        {
            "progId": "15"
        }
    ]
}
Notes
There's a limit of 100 calls for this API.

Request

Query Params

Header Params

Body Params text/plain
Example
Example:{ "missedOpportunity": [ { "progId":"15", "missedOpportunityType":"NO_SIZE", "opportunityDate" : "2018-01-01 12:30:00", "itemCode": "MISSED_OPPORTUNITY_123", "itemDescription": "Opportunità mancata 123", "barcode": "999999999999", "origHierarchyLevel1": "Gerarchia orgine 1", "origHierarchyLevel2": "Gerarchia orgine 2", "origHierarchyLevel3": "Gerarchia orgine 3", "origHierarchyLevel4": "Gerarchia orgine 4", "origHierarchyLevel5": "Gerarchia orgine 5", "origHierarchyLevel6": "Gerarchia orgine 6", "origHierarchyLevel7": "Gerarchia orgine 7", "origHierarchyLevel8": "Gerarchia orgine 8", "origHierarchyLevel9": "Gerarchia orgine 9", "origHierarchyLevel10": "Gerarchia orgine 10", "origAttributeLevel1": "Livello attributo 11", "origAttributeLevel2": "Livello attributo 22", "origAttributeLevel3": "Livello attributo 33", "origAttributeLevel4": "Livello attributo 44", "origAttributeLevel5": "Livello attributo 55", "origAttributeLevel6": "Livello attributo 66", "origAttributeLevel7": "Livello attributo 77", "origAttributeLevel8": "Livello attributo 88", "origAttributeLevel9": "Livello attributo 99", "origAttributeLevel10": "Livello attributo 10", "origDimension1": "Dimesnione d1", "origDimension2": "Dimesnione d2", "origDimension3": "Dimesnione d3", "origDimension4": "Dimesnione d4", "origDimension5": "Dimesnione d5", "hierarchyLevel1": "Livello dimesnione l1", "hierarchyLevel2": "Livello dimesnione l2", "hierarchyLevel3": "Livello dimesnione l3", "hierarchyLevel4": "Livello dimesnione l4", "hierarchyLevel5": "Livello dimesnione l5", "hierarchyLevel6": "Livello dimesnione l6", "hierarchyLevel7": "Livello dimesnione l7", "hierarchyLevel8": "Livello dimesnione l8", "hierarchyLevel9": "Livello dimesnione l9", "hierarchyLevel10": "Livello dimesnione l10", "attributeLevel1": "Livello attributo 1", "attributeLevel2": "Livello attributo 2", "attributeLevel3": "Livello attributo 3", "attributeLevel4": "Livello attributo 4", "attributeLevel5": "Livello attributo 5", "attributeLevel6": "Livello attributo 6", "attributeLevel7": "Livello attributo 7", "attributeLevel8": "Livello attributo 8", "attributeLevel9": "Livello attributo 9", "attributeLevel10": "Livello attributo 10", "dimension1": "Dimesnione dd1", "dimension2": "Dimesnione dd2", "dimension3": "Dimesnione dd3", "dimension4": "Dimesnione dd4", "dimension5": "Dimesnione dd5", "note": "Delle note", "subjectEmail": "luca.biasotto@sinesy.it", "vendorCode": "60330", "itemCode1": "U01_TMB755WD022", "itemCode2": "U38_MNFM13WU183" } ] }

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api?cmd=insertMissedOpportunity_v3&appId=KEEPIT&applicationId=KEEPIT' \
--header 'username: {{USERNAME}}' \
--header 'password: {{PASSWORD}}' \
--header 'companyId: {{COMPANY_ID}}' \
--header 'siteId: {{SITE_ID}}' \
--header 'Content-Type: text/plain' \
--data-raw '{
  "missedOpportunity": [
    { 
      "progId":"15",
      "missedOpportunityType":"NO_SIZE",
      "opportunityDate" : "2018-01-01 12:30:00",
      "itemCode": "MISSED_OPPORTUNITY_123",
      "itemDescription": "Opportunità mancata 123",
      "barcode": "999999999999",
      "origHierarchyLevel1": "Gerarchia orgine 1",
      "origHierarchyLevel2": "Gerarchia orgine 2",
      "origHierarchyLevel3": "Gerarchia orgine 3",
      "origHierarchyLevel4": "Gerarchia orgine 4",
      "origHierarchyLevel5": "Gerarchia orgine 5",
      "origHierarchyLevel6": "Gerarchia orgine 6",
      "origHierarchyLevel7": "Gerarchia orgine 7",
      "origHierarchyLevel8": "Gerarchia orgine 8",
      "origHierarchyLevel9": "Gerarchia orgine 9",
      "origHierarchyLevel10": "Gerarchia orgine 10",
      "origAttributeLevel1": "Livello attributo 11",
      "origAttributeLevel2": "Livello attributo 22",
      "origAttributeLevel3": "Livello attributo 33",
      "origAttributeLevel4": "Livello attributo 44",
      "origAttributeLevel5": "Livello attributo 55",
      "origAttributeLevel6": "Livello attributo 66",
      "origAttributeLevel7": "Livello attributo 77",
      "origAttributeLevel8": "Livello attributo 88",
      "origAttributeLevel9": "Livello attributo 99",
      "origAttributeLevel10": "Livello attributo 10",
      "origDimension1": "Dimesnione d1",
      "origDimension2": "Dimesnione d2",
      "origDimension3": "Dimesnione d3",
      "origDimension4": "Dimesnione d4",
      "origDimension5": "Dimesnione d5",
      "hierarchyLevel1": "Livello dimesnione l1",
      "hierarchyLevel2": "Livello dimesnione l2",
      "hierarchyLevel3": "Livello dimesnione l3",
      "hierarchyLevel4": "Livello dimesnione l4",
      "hierarchyLevel5": "Livello dimesnione l5",
      "hierarchyLevel6": "Livello dimesnione l6",
      "hierarchyLevel7": "Livello dimesnione l7",
      "hierarchyLevel8": "Livello dimesnione l8",
      "hierarchyLevel9": "Livello dimesnione l9",
      "hierarchyLevel10": "Livello dimesnione l10",
      "attributeLevel1": "Livello attributo 1",
      "attributeLevel2": "Livello attributo 2",
      "attributeLevel3": "Livello attributo 3",
      "attributeLevel4": "Livello attributo 4",
      "attributeLevel5": "Livello attributo 5",
      "attributeLevel6": "Livello attributo 6",
      "attributeLevel7": "Livello attributo 7",
      "attributeLevel8": "Livello attributo 8",
      "attributeLevel9": "Livello attributo 9",
      "attributeLevel10": "Livello attributo 10",
      "dimension1": "Dimesnione dd1",
      "dimension2": "Dimesnione dd2",
      "dimension3": "Dimesnione dd3",
      "dimension4": "Dimesnione dd4",
      "dimension5": "Dimesnione dd5",
      "note": "Delle note",
      "subjectEmail": "luca.biasotto@sinesy.it",
      "vendorCode": "60330",
      "itemCode1": "U01_TMB755WD022",
      "itemCode2": "U38_MNFM13WU183"
    }
  ]
}'

Responses

🟢200Insert Missed opportunity - Fail
text/html
Body

Example
{"success":false,"code":400,"message":"Errore: non è stato eseguito l'inserimento/update, verificare il messaggio di errore dei record ritornati.","errorObjects":[{"itemCode":"MISSED_OPPORTUNITY_123","barcode":"999999999999","errorMessage":"Error: opportunityDate is not set."}],"insertedObjects":[]}
🟢200Update Missed opportunity - Success
🟢200Insert Missed opportunity - Success
🟠422Unique constraint error
Modified at 2024-08-14 15:39:53
Previous
Get Lost Opportunities
Next
Delete missed opportunity
Built with